Info
This question is closed. Reopen it to edit or answer.
I would like to check the code that I did for solving ordinary differential equation using "dsolve" function
1 view (last 30 days)
Show older comments
Hi All
I would like to check the code that I did is correct for solving ordinary differential equation by using "dsolve" function, the equation is: u*(dc/dx)-Ws*dc/dz-kc*(d2c/dz2)=0 % dc/dx , u, Ws, and kc are known any help will be so appreciated
Riyadh
This is the code:
for i=1:3
for j=1:12
syms C(z);
ode =diff(C,z,2)==u_014(i,j)*dc_dx_ws1(i,j)/Kc(i,j)-Ws1*diff(C,z)/Kc(i,j);
Dc = diff(C,z);
%Conditions
CC(i,1)=TSS_014_ws1(i,1);
Dc_c(i,1)=abs((TSS_014_ws1(i,2)-TSS_014_ws1(i,1))/0.5);
a1=CC(i,1);
a2=Dc_c(i,1);
cond = [C(1)==a1, Dc(1)==a2];
cSol(z) = dsolve(ode,cond);
Res(i,j)={cSol(z)}; % to make matrix of equations
end
end
% to solve the equations for z
for i=1:3 for j=1:12 syms f(z) f(z) = Res(i,j); z=ZF(i,j); f2(i,j)=f(z); doubleN(i,j) = double(f2(i,j)); end end
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!