ode45 Error differential equation system
Show older comments
I'm trying to solve a system of differential equations with ode45 but an appears. Could someone help me spot the mistake(s)?
%%Parameters
R_la= 0.4;
R_sa_b= 5.03;
R_sv= 1.32;
R_lv= 0.56;
P_a_b= 100;
P_v= 6;
V_la=1;
V_sa_b= 12;
P_ic= 10;
Ca= 0.205;
k_ven= 0.186;
P_v1= -2.25;
V_vn= 28;
G_q= 3;
tau_q= 20;
Pa_co2_b= 40;
tau_co2= 40;
%%State parameters
F=@(t,V_sa,P1,P2) [ Ca.*(P1-P_ic);
((P_a_b-P1)./(R_la + 0.5 .*R_sa_b) - (P1-P2)./(0.5 .*R_sa_b+R_sv))./Ca;
((P1-P2)./(0.5 .*R_sa +R_sv)-(P2-P_v)./R_lv)./ (1./(k_ven.*(P2-P_ic-P_v1))) ]
[t,V_sa,P1,P2]= ode45(F,[0 10],[0 0 0]);
q= (P1-P2)./0.5 .*R_sa + R_sv ;
F1=@(t,xq,xc) [ (-xq+G_q .*(q-q_b)./q_b)./tau_q ;
(-xc +0.3+3.*tanh(Pa_co2./Pa_co2_b -1.1))./tau_co2 ]
[t,xq,xc]= ode45(F1,[0 10],[0 0 0]);
Error message:
Not enough input arguments.
Error in
CBF_v2>@(t,V_sa,P1,P2)[Ca.*(P1-P_ic);((P_a_b-P1)./(R_la+0.5.*R_sa_b)-(P1-P2)./(0.5.*R_sa_b+R_sv))./Ca;((P1-P2)./(0.5.*R_sa+R_sv)-(P2-P_v)./R_lv)./(1./(k_ven.*(P2-P_ic-P_v1)))]
Error in odearguments (line 87)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in CBF_v2 (line 37)
[t,V_sa,P1,P2]= ode45(F,[0 10],[0 0 0]);
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!