Info
此问题已关闭。 请重新打开它进行编辑或回答。
I would like to check the code that I did for solving ordinary differential equation using "dsolve" function
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!