Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how

Legacy Documentation

Mathematica 8 (2010)

This is documentation for Mathematica 8, which was
based on an earlier version of Wolfram Language.
View current documentation (Version 14.3)

Introduction to Numerical Differential Equations

NDSolve[eqns,y,{x,xmin,xmax}] solve numerically for the function y, with the independent variable x in the range to
NDSolve[eqns,{y1,y2,...},{x,xmin,xmax}]
solve a system of equations for the

Numerical solution of differential equations.

This generates a numerical solution to the equation with . The result is given in terms of an InterpolatingFunction .
Out[1]=
Here is the value of .
Out[2]=
With an algebraic equation such as , each solution for is simply a single number. For a differential equation, however, the solution is a function, rather than a single number. For example, in the equation , you want to get an approximation to the function as the independent variable varies over some range.
Mathematica represents numerical approximations to functions as InterpolatingFunction objects. These objects are functions which, when applied to a particular , return the approximate value of at that point. The InterpolatingFunction effectively stores a table of values for , then interpolates this table to find an approximation to at the particular you request.
y[x]/.solution use the list of rules for the function y to get values for
InterpolatingFunction[data][x] evaluate an interpolated function at the point x
Plot[Evaluate[y[x]/.solution],{x,xmin,xmax}]
plot the solution to a differential equation

Using results from NDSolve .

This solves a system of two coupled differential equations.
Out[3]=
Here is the value of found from the solution.
Out[4]=
Here is a plot of the solution for found on line 3. Plot is discussed in "Basic Plotting".
Out[5]=
NDSolve[eqn,u,{x,xmin,xmax},{t,tmin,tmax},...]
solve a partial differential equation

Numerical solution of partial differential equations.



ja zh

AltStyle によって変換されたページ (->オリジナル) /