v=[1,2,3]
v =
1 2 3
v(:)
ans =
1
2
3
w=[1;2;3]
w =
1
2
3
w(:)
ans =
1
2
3
uiopen('/home/accounts/personale/clrmrc90/aa1112/equazioni_differenziali/stiff.m', true);
stiff
stiff
k =
0.0800
k =
0.0667
k =
0.0571
k =
0.0500
k =
0.0444
k =
0.0400
k =
0.0364
k =
0.0333
k =
0.0308
k =
0.0286
k =
0.0267
k =
0.0250
k =
0.0235
k =
0.0222
k =
0.0211
k =
0.0200
k =
0.0190
k =
0.0182
k =
0.0174
k =
0.0167
k =
0.0160
axis([1e2,1e4,1e-16,1])
erree
erree =
1.0e+281 *
Columns 1 through 4
NaN NaN NaN NaN
Columns 5 through 8
NaN NaN NaN NaN
Columns 9 through 12
NaN NaN NaN 5.5720
Columns 13 through 16
0.0000 0.0000 0.0000 0.0000
Columns 17 through 20
0.0000 0.0000 0.0000 0.0000
Column 21
0.0000
errei
errei =
1.0e-16 *
Columns 1 through 4
0.1517 0.1098 0.0853 0.0693
Columns 5 through 8
0.0583 0.0501 0.0439 0.0391
Columns 9 through 12
0.0352 0.0319 0.0293 0.0270
Columns 13 through 16
0.0250 0.0233 0.0219 0.0206
Columns 17 through 20
0.0194 0.0184 0.0174 0.0166
Column 21
0.0158
axis([1e2,1e4,1e-18,1])
axis([1e2,1e4,1e-18,1e-15])
axis([1e2,1e4,1e-19,1e-16])
axis([1e2,1e4,1e-19,1e-16])
stiff
k =
0.0800
k =
0.0667
k =
0.0571
k =
0.0500
k =
0.0444
k =
0.0400
k =
0.0364
k =
0.0333
k =
0.0308
k =
0.0286
k =
0.0267
k =
0.0250
k =
0.0235
k =
0.0222
k =
0.0211
k =
0.0200
k =
0.0190
k =
0.0182
k =
0.0174
k =
0.0167
k =
0.0160
help ode23
ODE23 Solve non-stiff differential equations, low order method.
[TOUT,YOUT] = ODE23(ODEFUN,TSPAN,Y0) with TSPAN = [T0 TFINAL] integrates
the system of differential equations y' = f(t,y) from time T0 to TFINAL
with initial conditions Y0. ODEFUN is a function handle. For a scalar T
and a vector Y, ODEFUN(T,Y) must return a column vector corresponding
to f(t,y). Each row in the solution array YOUT corresponds to a time
returned in the column vector TOUT. To obtain solutions at specific
times T0,T1,...,TFINAL (all increasing or all decreasing), use TSPAN =
[T0 T1 ... TFINAL].
[TOUT,YOUT] = ODE23(ODEFUN,TSPAN,Y0,OPTIONS) solves as above with default
integration properties replaced by values in OPTIONS, an argument created
with the ODESET function. See ODESET for details. Commonly used options
are scalar relative error tolerance 'RelTol' (1e-3 by default) and vector
of absolute error tolerances 'AbsTol' (all components 1e-6 by default).
If certain components of the solution must be non-negative, use
ODESET to set the 'NonNegative' property to the indices of these
components.
ODE23 can solve problems M(t,y)*y' = f(t,y) with mass matrix M that is
nonsingular. Use ODESET to set the 'Mass' property to a function handle
MASS if MASS(T,Y) returns the value of the mass matrix. If the mass matrix
is constant, the matrix can be used as the value of the 'Mass' option. If
the mass matrix does not depend on the state variable Y and the function
MASS is to be called with one input argument T, set 'MStateDependence' to
'none'. ODE15S and ODE23T can solve problems with singular mass matrices.
[TOUT,YOUT,TE,YE,IE] = ODE23(ODEFUN,TSPAN,Y0,OPTIONS) with the 'Events'
property in OPTIONS set to a function handle EVENTS, solves as above
while also finding where functions of (T,Y), called event functions,
are zero. For each function you specify whether the integration is
to terminate at a zero and whether the direction of the zero crossing
matters. These are the three column vectors returned by EVENTS:
[VALUE,ISTERMINAL,DIRECTION] = EVENTS(T,Y). For the I-th event function:
VALUE(I) is the value of the function, ISTERMINAL(I)=1 if the integration
is to terminate at a zero of this event function and 0 otherwise.
DIRECTION(I)=0 if all zeros are to be computed (the default), +1 if only
zeros where the event function is increasing, and -1 if only zeros where
the event function is decreasing. Output TE is a column vector of times
at which events occur. Rows of YE are the corresponding solutions, and
indices in vector IE specify which event occurred.
SOL = ODE23(ODEFUN,[T0 TFINAL],Y0...) returns a structure that can be
used with DEVAL to evaluate the solution or its first derivative at
any point between T0 and TFINAL. The steps chosen by ODE23 are returned
in a row vector SOL.x. For each I, the column SOL.y(:,I) contains
the solution at SOL.x(I). If events were detected, SOL.xe is a row vector
of points at which events occurred. Columns of SOL.ye are the corresponding
solutions, and indices in vector SOL.ie specify which event occurred.
Example
[t,y]=ode23(@vdp1,[0 20],[2 0]);
plot(t,y(:,1));
solves the system y' = vdp1(t,y), using the default relative error
tolerance 1e-3 and the default absolute tolerance of 1e-6 for each
component, and plots the first component of the solution.
Class support for inputs TSPAN, Y0, and the result of ODEFUN(T,Y):
float: double, single
See also
other ODE solvers: ode45, ode113, ode15s, ode23s, ode23t, ode23tb
implicit ODEs: ode15i
options handling: odeset, odeget
output functions: odeplot, odephas2, odephas3, odeprint
evaluating solution: deval
ODE examples: rigidode, ballode, orbitode
function handles: function_handle
NOTE:
The interpretation of the first input argument of the ODE solvers and
some properties available through ODESET have changed in MATLAB 6.0.
Although we still support the v5 syntax, any new functionality is
available only with the new syntax. To see the v5 help, type in
the command line
more on, type ode23, more off
Reference page in Help browser
doc ode23
doc ode23
edit ode45
doc ode23
diary off