module Quadrature:sig
..end
Support for backward quadrature equations that may or may not depend on forward sensitivities.
type 'd
bquadrhsfn_args = {
|
t : |
(* | The value of the independent variable. | *) |
|
y : |
(* | The vector of dependent-variable values $y(t)$. | *) |
|
yb : |
(* | The vector of backward dependent-variable values $y_B(t)$. | *) |
}
Arguments common to Cvodes.Adjoint.Quadrature.bquadrhsfn_no_sens
and
Cvodes.Adjoint.Quadrature.bquadrhsfn_with_sens
.
type'd
bquadrhsfn_no_sens ='d bquadrhsfn_args -> 'd -> unit
Functions defining backward quadrature variables without forward sensitivities. These functions are passed the arguments:
args
, the current values of forward and backward variables, and,qb'
, a vector for storing the computed value of
$\dot{y}_\mathit{QB} = f_\mathit{QB}(t, y, y_B)$.Within the function, raising a Sundials.RecoverableFailure
exception indicates a recoverable error. Any other exception is
treated as an unrecoverable error.
type'd
bquadrhsfn_with_sens ='d bquadrhsfn_args -> 'd array -> 'd -> unit
Functions defining backward quadrature variables with forward sensitivities. These functions are passed the arguments:
args
, the current values of forward and backward variables,s
, an array holding the values of forward sensitivity vectors,
and,qb'
, a vector for storing the computed value of
$\dot{y}_\mathit{QB} = f_\mathit{QB}(t, y, y_S, y_B)$.Within the function, raising a Sundials.RecoverableFailure
exception indicates a recoverable error. Any other exception is
treated as an unrecoverable error.
type 'd
bquadrhsfn =
| |
NoSens of |
(* | Does not depend on forward sensitivities. | *) |
| |
WithSens of |
(* | Depends on forward sensitivities. | *) |
These functions compute the quadrature equation right-hand side for the backward problem.
val init : ('d, 'k) Cvodes.Adjoint.bsession ->
'd bquadrhsfn -> ('d, 'k) Nvector.t -> unit
This function activates the integration of quadrature equations.
The arguments are the function that computes the right-hand side of
the backward quadrature equations, and a vector giving the values
of the quadrature variables at tB0
.
val reinit : ('d, 'k) Cvodes.Adjoint.bsession -> ('d, 'k) Nvector.t -> unit
This function reinitializes the integration of quadrature equations during the backward phase.
type ('d, 'k)
tolerance =
| |
NoStepSizeControl |
(* | Quadrature variables are not used for step-size control (the default). | *) |
| |
SStolerances of |
(* |
| *) |
| |
SVtolerances of |
(* |
| *) |
Tolerances for calculating backward quadrature variables.
val set_tolerances : ('d, 'k) Cvodes.Adjoint.bsession ->
('d, 'k) tolerance -> unit
Specify how to use quadrature variables in step size control.
val get : ('d, 'k) Cvodes.Adjoint.bsession -> ('d, 'k) Nvector.t -> float
Returns the backward quadrature solutions and time reached
after a successful solver step. The given vectors are filled with
values calculated during either Cvodes.Adjoint.backward_normal
or
Cvodes.Adjoint.backward_one_step
and the value of the independent variable
is returned.
val get_num_rhs_evals : ('d, 'k) Cvodes.Adjoint.bsession -> int
Returns the number of calls to the backward quadrature right-hand side function.
val get_num_err_test_fails : ('d, 'k) Cvodes.Adjoint.bsession -> int
Returns the number of local error test failures due to quadrature variables.
val get_err_weights : ('d, 'k) Cvodes.Adjoint.bsession -> ('d, 'k) Nvector.t -> unit
Returns the quadrature error weights at the current time.
val get_stats : ('d, 'k) Cvodes.Adjoint.bsession -> int * int
Returns quadrature-related statistics. These are the
number of calls to the quadrature function (nfqevals
) and the
number of error test failures due to quadrature variables
(nqetfails
).
nfqevals
, nqetfails
)