SolveODE
SolveODE[
eqns
,
y
,
{
x
,
xmin
,
xmax
}
]
finds a numerical solution to the ordinary differential equations
eqns
for the function
y
with the independent variable
x
in the range
xmin
to
xmax
.
SolveODE[
eqns
,
y
,
{
x
,
xmin
,
xmax
}
,
{
t
,
tmin
,
tmax
}
]
finds a numerical solution to the partial differential equations
eqns
.
SolveODE[
eqns
,
{
,
,
...
}
,
{
x
,
xmin
,
xmax
}
]
finds numerical solutions for the functions
.
SolveODE
gives results in terms of
InterpolatingFunction
objects.
SolveODE[
eqns
,
y
[
x
],
{
x
,
xmin
,
xmax
}
]
gives solutions for
y
[
x
]
rather than for the function
y
itself.
SolveODE
solves a wide range of ordinary differential equations, and some partial differential equations.
In ordinary differential equations, the functions
must depend only on the single variable
x
. In partial differential equations, they may depend on more than one variable.
The differential equations must contain enough initial or boundary conditions to determine the solutions for the
completely.
Initial and boundary conditions are typically stated in form
y
[
]
==
,
y
'[
]
==
, etc., but may consist of more complicated equations.
The point
that appears in the initial or boundary conditions need not lie in the range
xmin
to
xmax
over which the solution is sought.
The differential equations in
SolveODE
can involve complex numbers.
See also:
D
,
Integrate
,
ND
,
NIntegrate
,
SolveEquation
.
Examples
Using InstantCalculators
Here are the InstantCalculators for the
SolveODE
function. Enter the parameters for your calculation and click
Calculate
to see the result.
In[1]:=
Out[1]=
In[2]:=
In[3]:=
Out[3]=
In[4]:=
Out[4]=
Entering Commands Directly
You can paste a template for this command via the Text Input button on the
SolveODE
Function Controller.
This command finds a numerical approximation to a function that is equal to its first derivative at each point
x
between
and
, and that has the value
when
x
is
.
SolveODE
returns an
InterpolatingFunction
object.
In[5]:=
Out[5]=
This can be plotted by making a function from the
InterpolatingFunction
object.
In[6]:=
Here is another example. This finds a numerical approximation to a function whose square is equal to its first derivative.
In[7]:=
Out[7]=
The warning is appropriate, since this function goes to as it approaches 1 along the horizontal axis.
In[8]:=
Here is how to see a graph of an approximation to the function which is the reciprocal of its derivative.
Not too surprisingly, this plot looks very much like the square root function.
In[9]:=
Out[9]=
In[10]:=
Solving systems of equations works similarly. For systems of two equations a so-called phase plot is often a good way to visualize
the solution. Here is a phase plot that describes the motion of a weakly damped pendulum.
In[11]:=
Out[11]=
In[12]:=
Clear the function definition.
In[13]:=