RungeKutta

class RungeKutta(*args)

Runge-Kutta fourth-order method.

See also

ODESolver

Examples

>>> import openturns as ot
>>> f = ot.SymbolicFunction(['t', 'y0', 'y1'], ['t - y0', 'y1 + t^2'])
>>> phi = ot.VertexValueFunction(f)
>>> solver = ot.RungeKutta(phi)
>>> Y0 = [1.0, -1.0]
>>> nt = 100
>>> timeGrid = list(map(lambda i:(i**2.0) / (nt - 1.0)**2.0, range(nt)))
>>> result = solver.solve(Y0, timeGrid)

Methods

getClassName() Accessor to the object’s name.
getId() Accessor to the object’s id.
getName() Accessor to the object’s name.
getShadowedId() Accessor to the object’s shadowed id.
getTransitionFunction() Transition function accessor.
getVisibility() Accessor to the object’s visibility state.
hasName() Test if the object is named.
hasVisibleName() Test if the object has a distinguishable name.
setName(name) Accessor to the object’s name.
setShadowedId(id) Accessor to the object’s shadowed id.
setTransitionFunction(transitionFunction) Transition function accessor.
setVisibility(visible) Accessor to the object’s visibility state.
solve(initialState, timeGrid) Solve ODE.
__init__(*args)
getClassName()

Accessor to the object’s name.

Returns:

class_name : str

The object class name (object.__class__.__name__).

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getShadowedId()

Accessor to the object’s shadowed id.

Returns:

id : int

Internal unique identifier.

getTransitionFunction()

Transition function accessor.

Returns:

transitionFunction : FieldFunction

Transition function.

getVisibility()

Accessor to the object’s visibility state.

Returns:

visible : bool

Visibility flag.

hasName()

Test if the object is named.

Returns:

hasName : bool

True if the name is not empty.

hasVisibleName()

Test if the object has a distinguishable name.

Returns:

hasVisibleName : bool

True if the name is not empty and not the default one.

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

setShadowedId(id)

Accessor to the object’s shadowed id.

Parameters:

id : int

Internal unique identifier.

setTransitionFunction(transitionFunction)

Transition function accessor.

Parameters:

transitionFunction : FieldFunction

Transition function.

setVisibility(visible)

Accessor to the object’s visibility state.

Parameters:

visible : bool

Visibility flag.

solve(initialState, timeGrid)

Solve ODE.

Parameters:

initialState : sequence of float

Initial value of the equation

timeGrid : sequence of float

Time steps

Returns:

values : Sample

The solution of the equation at grid points.