Ode23 error using odearguments
7 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to run a code found on web (linked below) and I am encountering a problem with ODE23 function:
Code:
%% Numerical Solution for 2 Element WM
t=(n-1)*Tc :.01: n*Tc ;
I = @ ( t ) I0* sine ( t-(n-1)*Tc ) .* ( t <= (( n-1)*Tc+Ts )) ;
Y2= @ ( t , y2 ) (-y2 / ( R*C )+I ( t ) /C ) ;
[t_m2 , P_m2 ] = ode23 (Y2, [(n-1)*Tc; n*Tc], P_ss2 ) ;
P_ss2=P_m2 ( end ) ;
subplot (4,1,3)
hold on
plot ( t_m2 , P_m2)
ylim ([ 0 150])
xlim ([0 cycle *Tc ] )
title ( ' Aortic Blood Pressure ( Numerical Analysis 2 Element WM) ' )
ylabel ( ' Pressure (mmHg) ' )
xlabel ( ' time ( s ) ' )
Errors:
Error using odearguments
Inputs must be floats, namely single or double.
Error in ode23 (line 106)
odearguments(odeIsFuncHandle, odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in prject1 (line 68)
[t_m2 , P_m2 ] = ode23 (Y2, [(n-1)*Tc; n*Tc], P_ss2 ) ;
Thank you for all help in advence
Used code does not belong to me, I found it here: https://isn.ucsd.edu/courses/beng221/problems/2012/BENG221_Project%20-%20Catanho%20Sinha%20Vijayan.pdf
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!