package scipy

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `Complex_ode
]
type t = [ `Complex_ode | `Object ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val create : ?jac:Py.Object.t -> f:Py.Object.t -> unit -> t

A wrapper of ode for complex systems.

This functions similarly as `ode`, but re-maps a complex-valued equation system to a real-valued one before using the integrators.

Parameters ---------- f : callable ``f(t, y, *f_args)`` Rhs of the equation. t is a scalar, ``y.shape == (n,)``. ``f_args`` is set by calling ``set_f_params( *args)``. jac : callable ``jac(t, y, *jac_args)`` Jacobian of the rhs, ``jaci,j = d fi / d yj``. ``jac_args`` is set by calling ``set_f_params( *args)``.

Attributes ---------- t : float Current time. y : ndarray Current variable values.

Examples -------- For usage examples, see `ode`.

val get_return_code : [> tag ] Obj.t -> Py.Object.t

Extracts the return code for the integration to enable better control if the integration fails.

In general, a return code > 0 implies success, while a return code < 0 implies failure.

Notes ----- This section describes possible return codes and their meaning, for available integrators that can be selected by `set_integrator` method.

'vode'

=========== ======= Return Code Message =========== ======= 2 Integration successful. -1 Excess work done on this call. (Perhaps wrong MF.) -2 Excess accuracy requested. (Tolerances too small.) -3 Illegal input detected. (See printed message.) -4 Repeated error test failures. (Check all input.) -5 Repeated convergence failures. (Perhaps bad Jacobian supplied or wrong choice of MF or tolerances.) -6 Error weight became zero during problem. (Solution component i vanished, and ATOL or ATOL(i) = 0.) =========== =======

'zvode'

=========== ======= Return Code Message =========== ======= 2 Integration successful. -1 Excess work done on this call. (Perhaps wrong MF.) -2 Excess accuracy requested. (Tolerances too small.) -3 Illegal input detected. (See printed message.) -4 Repeated error test failures. (Check all input.) -5 Repeated convergence failures. (Perhaps bad Jacobian supplied or wrong choice of MF or tolerances.) -6 Error weight became zero during problem. (Solution component i vanished, and ATOL or ATOL(i) = 0.) =========== =======

'dopri5'

=========== ======= Return Code Message =========== ======= 1 Integration successful. 2 Integration successful (interrupted by solout). -1 Input is not consistent. -2 Larger nsteps is needed. -3 Step size becomes too small. -4 Problem is probably stiff (interrupted). =========== =======

'dop853'

=========== ======= Return Code Message =========== ======= 1 Integration successful. 2 Integration successful (interrupted by solout). -1 Input is not consistent. -2 Larger nsteps is needed. -3 Step size becomes too small. -4 Problem is probably stiff (interrupted). =========== =======

'lsoda'

=========== ======= Return Code Message =========== ======= 2 Integration successful. -1 Excess work done on this call (perhaps wrong Dfun type). -2 Excess accuracy requested (tolerances too small). -3 Illegal input detected (internal error). -4 Repeated error test failures (internal error). -5 Repeated convergence failures (perhaps bad Jacobian or tolerances). -6 Error weight became zero during problem. -7 Internal workspace insufficient to finish (internal error). =========== =======

val integrate : ?step:bool -> ?relax:bool -> t:float -> [> tag ] Obj.t -> float

Find y=y(t), set y as an initial condition, and return y.

Parameters ---------- t : float The endpoint of the integration step. step : bool If True, and if the integrator supports the step method, then perform a single integration step and return. This parameter is provided in order to expose internals of the implementation, and should not be changed from its default value in most cases. relax : bool If True and if the integrator supports the run_relax method, then integrate until t_1 >= t and return. ``relax`` is not referenced if ``step=True``. This parameter is provided in order to expose internals of the implementation, and should not be changed from its default value in most cases.

Returns ------- y : float The integrated value at t

val set_f_params : Py.Object.t list -> [> tag ] Obj.t -> Py.Object.t

Set extra parameters for user-supplied function f.

val set_initial_value : ?t:Py.Object.t -> y:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Set initial conditions y(t) = y.

val set_integrator : ?integrator_params:(string * Py.Object.t) list -> name:string -> [> tag ] Obj.t -> Py.Object.t

Set integrator by name.

Parameters ---------- name : str Name of the integrator integrator_params Additional parameters for the integrator.

val set_jac_params : Py.Object.t list -> [> tag ] Obj.t -> Py.Object.t

Set extra parameters for user-supplied function jac.

val set_solout : solout:Py.Object.t -> [> tag ] Obj.t -> Py.Object.t

Set callable to be called at every successful integration step.

Parameters ---------- solout : callable ``solout(t, y)`` is called at each internal integrator step, t is a scalar providing the current independent position y is the current soloution ``y.shape == (n,)`` solout should return -1 to stop integration otherwise it should return None or 0

val successful : [> tag ] Obj.t -> Py.Object.t

Check if integration was successful.

val t : t -> float

Attribute t: get value or raise Not_found if None.

val t_opt : t -> float option

Attribute t: get value as an option.

val y : t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t

Attribute y: get value or raise Not_found if None.

val y_opt : t -> [ `ArrayLike | `Ndarray | `Object ] Np.Obj.t option

Attribute y: get value as an option.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty-print the object to a formatter.