Ode23 error using odearguments
12 views (last 30 days)
Show older comments
Justyna Hodurek
on 24 May 2022
Commented: Justyna Hodurek
on 24 May 2022
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 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!