My differantial equation is 1/x*d/dx(x*dy/dx)=10.
And my code is below. I can solve x, y but i can not solve dy/dx, how to find dy/dx value of this problem. (My Code is correct)
function SteadyHeat1DNumericclc; clear;x1=0.06; x2=0.08;t=linspace(x1,x2,21);tspan = [x1 x2];xmesh = linspace(x1,x2);solinit = bvpinit(xmesh, @guess);sol= bvp5c( @heatcylinder1D, @bcfcn, solinit);for t=linspace(x1,x2,11) fprintf('%12.5f',t,deval(sol,t,1));fprintf('\n')endfunction res = bcfcn(ya,yb)global h k Ts qres = [ya(1)-150 yb(1)-60]; function g = guess(x)g = [1 1000];function dxdy = heatcylinder1D(x,y)global g k dxdy = zeros(2,1);dxdy(1) = y(2)/x;dxdy(2) = 10;
Best Answer