an example of using ode15i

I'm trying to use ODE15i to solve a very easy problem (y'=y with y(0)=1). since I will have more complicated relationships to deal with later. I'm not familiar with this coding language so my example can not run. I ran and there is an error saying no enough parameters is provided. How should I make it right?
That's my main code:
clearvars;
tspan=[0 1];
y0=1;
yp0=1;
options=odeset('AbsTol',1e-10);
[t,y] = ode15i(odefun_try,tspan,y0,yp0);
plot(t,y,'--blue'); title('real');
and function defined in another .m file named odefun_try.m:
function f = odefun_try(t,y,yp)
f = yp - y;
end

 Risposta accettata

Torsten
Torsten il 7 Gen 2024
Spostato: Dyuman Joshi il 7 Gen 2024
[t,y] = ode15i(@odefun_try,tspan,y0,yp0);
instead of
[t,y] = ode15i(odefun_try,tspan,y0,yp0);

Più risposte (0)

Categorie

Scopri di più su App Building in Centro assistenza e File Exchange

Prodotti

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by