Matlab Function Ode45
Matlab Function Ode45
Function
ode45
Numerical
Integration
of
Differential
Equations
Rakinder
Kalsi
and
Katherine
Lloyd
The
function:
[T,Y,TE,YE,IE] = ode45(odefun,tspan,y0,options)
!"
odefun
function
handle
to
()
from
differential
equation
= ()
!"
tspan
vector
of
interval
of
integration
[! , ! ].
y0
initial
conditions.
options
structure
created
by
function
odeset.
T
Time
points
the
solution
is
returned
for.
Y
Solution
().
TE
Time
points
at
which
events
occur.
YE
Value
of
()
when
events
occur.
IE
Array
index
of
events
in
Y.
odeset
options = odeset('name1',value1,'name2',value2,...)
% Run ode45
[T,Y] = ode45(@g,tspan,y0,options);
end
function dy_dt=g(t,y)
dy_dt= -t*y/sqrt(2-y^2);
end