differential equations system to be solved on matlab code
이전 댓글 표시
how do i solved these set of differential equantions on matlab what is the code ? attached below is the image of the qeuations
답변 (1개)
HWIK
2021년 11월 29일
This code should work, but you must specify your initial conditions. You might want to look into other ode solvers, as with these specs the output looks pretty stiff.
%%%%%%%% Specify your volume and initial conditions!%%%%%%%%%%%
Vspan = [0 200];
Initial_conditions = [2, 1, 0]; %In the order of Fa0, Fb0 & Fc0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[t, y] = ode45(@your_ode_solver_fcn,Vspan,Initial_conditions);
plot(t,y(:,1),t,y(:,2),t,y(:,3))
function out = your_ode_solver_fcn(t,in)
%Specify the input:
Fa = in(1);
Fb = in(2);
Fc = in(3);
%Define your relationships
Kc = 0.01;
Ft = Fa+ Fb+ Fc;
Co = 1;
K = 10;
Kb = 40;
ra = - (K*Co/Ft)* (Fa-Co^2*Fb*Fc^2/ (Kc*Ft^2));
Ka = 1;
Ra = Ka*Co*Fa/Ft;
Rb = Kb*Co*Fb/Ft;
%Specify the output
dFa = ra-Ra;
dFb = -ra-Rb;
dFc = -2*ra;
out = [dFa; dFb; dFc];
end
카테고리
도움말 센터 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!