Click or drag to resize
FunctionMathIntegrateConservativeOde Method (FuncDouble, Double, Double, Double, Double, Double, Double, OdeEvaluationSettings)
Solves a conservative second order ordinary differential equation initial value problem using the given settings.

Namespace:  Meta.Numerics.Analysis
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: (
public static OdeResult IntegrateConservativeOde(
	Func<double, double, double> rhs,
	double x0,
	double y0,
	double yPrime0,
	double x1,
	OdeEvaluationSettings settings


Type: SystemFuncDouble, Double, Double
The right hand side function.
Type: SystemDouble
The initial value of the independent variable.
Type: SystemDouble
The initial value of the function variable.
Type: SystemDouble
The intial value of the function derivative.
Type: SystemDouble
The final value of the independent variable.
Type: Meta.Numerics.AnalysisOdeEvaluationSettings
The settings to use when solving the problem.

Return Value

Type: OdeResult
The solution, including the final value of the function and its derivative.
ArgumentNullExceptionThe rhs or settings is null.
NonconvergenceExceptionThe ODE could not be integrated to the required precision before exhausting the maximum allowed number of rhs evaluations.

A conservative ODE is an ODE of the form

where the right-hand-side depends only on x and y, not on the derivative y'. ODEs of this form are called conservative because they exhibit conserved quantities: combinations of y and y' that maintain the same value as the system evolves. Many forms of Newtonian equations of motion, for example, are conservative ODEs, with conserved quantities such as energy, momentum, and angular momentum. Our specialized conservative ODE integrator is not only more efficient for conservative ODEs, but does a better job of maintaining the conserved quantities.

See Also