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

NDSolve

Updated In 6 Graphic
NDSolve[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.
NDSolve[eqns, y, {x, xmin, xmax}, {t, tmin, tmax}]
finds a numerical solution to the partial differential equations eqns.
NDSolve[eqns, {y1, y2, ...}, {x, xmin, xmax}]
finds numerical solutions for the functions yi.
  • NDSolve[eqns, y[x], {x, xmin, xmax}] gives solutions for y[x] rather than for the function y itself.
  • Differential equations must be stated in terms of derivatives such as y'[x], obtained with D, not total derivatives obtained with Dt.
  • NDSolve solves a wide range of ordinary differential equations as well as many partial differential equations.
  • In ordinary differential equations the functions yi 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 yi completely.
  • Initial and boundary conditions are typically stated in the form y[x0]c0, y'[x0]dc0, etc., but may consist of more complicated equations.
  • The c0, dc0, etc. can be lists, specifying that y[x] is a function with vector or general list values.
  • Periodic boundary conditions can be specified using y[x0]y[x1].
  • The point x0 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 NDSolve can involve complex numbers.
  • NDSolve can solve many differential-algebraic equations, in which some of the eqns are purely algebraic, or some of the variables are implicitly algebraic.
  • The yi can be functions of the dependent variables, and need not include all such variables.
  • The following options can be given:
AccuracyGoalAutomaticdigits of absolute accuracy sought
DependentVariablesAutomaticthe list of all dependent variables
EvaluationMonitorNoneexpression to evaluate whenever the function is evaluated
InterpolationOrderAutomaticthe continuity degree of the final output
MaxStepFraction1/10maximum fraction of range to cover in each step
MaxSteps10000maximum number of steps to take
MaxStepSizeAutomaticmaximum size of each step
MethodAutomaticmethod to use
NormFunctionAutomaticthe norm to use for error estimation
PrecisionGoalAutomaticdigits of precision sought
StartingStepSizeAutomaticinitial step size used
StepMonitorNoneexpression to evaluate when a step is taken
WorkingPrecisionMachinePrecisionprecision to use in internal computations
  • The option NormFunction->f specifies that the estimated errors for each of the yi should be combined using f[{e1, e2, ...}].
  • AccuracyGoal effectively specifies the absolute local error allowed at each step in finding a solution, while PrecisionGoal specifies the relative local error.
  • If solutions must be followed accurately when their values are close to zero, AccuracyGoal should be set larger, or to Infinity.
  • The setting for MaxStepFraction specifies the maximum step to be taken by NDSolve as a fraction of the range of values for each independent variable.
  • Possible explicit settings for the Method option include:
"Adams"predictor-corrector Adams method with orders 1 through 12
"BDF"implicit backward differentiation formulas with orders 1 through 5
"ExplicitRungeKutta"adaptive embedded pairs of 2(1) through 9(8) Runge-Kutta methods
"ImplicitRungeKutta"families of arbitrary-order implicit Runge-Kutta methods
"SymplecticPartitionedRungeKutta"
interleaved Runge-Kutta methods for separable Hamiltonian systems
  • With Method->{"controller", Method->"submethod"} or Method->{"controller", Method->{m1, m2, ...}} possible controller methods include:
"Composition"compose a list of submethods
"DoubleStep"adapt step size by the double-step method
"EventLocator"respond to specified events
"Extrapolation"adapt order and step size using polynomial extrapolation
"FixedStep"use a constant step size
"OrthogonalProjection"project solutions to fulfill orthogonal constraints
"Projection"project solutions to fulfill general constraints
"Splitting"split equations and use different submethods
"StiffnessSwitching"switch from explicit to implicit methods if stiffness is detected
  • Methods used mainly as submethods include:
"ExplicitEuler"forward Euler method
"ExplicitMidpoint"midpoint rule method
"ExplicitModifiedMidpoint"midpoint rule method with Gragg smoothing
"LinearlyImplicitEuler"linearly implicit Euler method
"LinearlyImplicitMidpoint"linearly implicit midpoint rule method
"LinearlyImplicitModifiedMidpoint"
linearly implicit Bader-smoothed midpoint rule method
"LocallyExact"numerical approximation to locally exact symbolic solution
  • The setting InterpolationOrder->All specifies that NDSolve should generate solutions that use interpolation of the same order as the underlying method used. »
New in 2 | Last modified in 6