This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

InitialConditions, TimeMesh

Initial conditions of the ODE

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

InitialConditions, TimeMeshMandatoryList of arithmetical expressions

Graphics Primitives

ObjectsDefault Values
plot::Ode2d, plot::Ode3d 


InitialConditions = [y1(t0), y2(t0), …] sets the initial conditions for the initial value problem


TimeMesh = [t0, t1, t2, …] sets the values of the independent variable t (the “time”) of the ODE at which graphical points of the solution curve are plotted. The first entry t0 is the initial time for which initial conditions are set by InitialConditions.

Internally, plot::Ode2d and plot::Ode3d call the routine numeric::odesolve for solving the given ODE numerically.

The list of initial conditions set by InitialConditions is forwarded to numeric::odesolve. See the corresponding help page for further details.


Example 1

We solve the initial value problem numerically:

f := (t, Y) -> [-Y[1]]:
Y0 := [1]:
timemesh:= [0, 0.2, 0.5, 1, 1.5, 2, 3, 5]:
plot(plot::Ode2d(f, InitialConditions = Y0,
                 TimeMesh = timemesh))

delete f, Y0, timemesh:
Was this topic helpful?