Extract value from function
이전 댓글 표시
Hello friends, I have this code that return values for dc1dt and dq1dt. But I want to see the values for dc1dz, how can I do that?
function dydt=f(t,y,R,P,epsb,u,LDF1,b1,qm1,c10,Nz,dz,rhop,nco2,T)
dydt=zeros(length(y),1);
dc1dt=zeros(Nz,1);
dq1dt=zeros(Nz,1);
%Assign values
c1=y(1:Nz);
q1=y(Nz+1:2*Nz);
%BC
c1(1)=c10;
c1(end)=(4*c1(end-1)-c1(end-2))./3;
%interior
for i=2:Nz-1
dc1dz(i)=(c1(i+1)-c1(i-1))./(2.*dz);
q1star(i)=qm1.*((b1.*0.197).^(1/nco2))./(1+(b1.*0.197).^(1/nco2));
dq1dt(i)=LDF1.*(q1star(i)-q1(i));
%main f
dc1dt(i)=-u*dc1dz(i)-(rhop.*R.*T./P *((1-epsb)./epsb).*dq1dt(i));
end
dydt=[dc1dt;dq1dt];
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!