Ode23 error using odearguments
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Justyna Hodurek
le 24 Mai 2022
Commenté : Justyna Hodurek
le 24 Mai 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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!