pub trait PdeProblem<const N: usize>: ControlProblem<N> {
// Required methods
fn dimension_kind(&self, dim: usize) -> DimensionKind;
fn transport(
&self,
t: f64,
state: &[f64; N],
control: &Self::Control,
derivs: &StateDerivatives<N>,
) -> Transport<N>;
// Provided method
fn jump_kernel(
&self,
_t: f64,
_state: &[f64; N],
_control: &Self::Control,
_derivs: &StateDerivatives<N>,
transport: &Transport<N>,
) -> JumpKernel<N> { ... }
}Expand description
Finite-difference view of a time-dependent stochastic optimal control problem.
A model that must be solved accurately on a diffusive grid implements this
contract in addition to crate::models::control::ControlProblem. The
two contracts are kept separate so the generic contract remains
solver-agnostic and usable by the BSDE solver.
Required Methods§
Sourcefn dimension_kind(&self, dim: usize) -> DimensionKind
fn dimension_kind(&self, dim: usize) -> DimensionKind
Sourcefn transport(
&self,
t: f64,
state: &[f64; N],
control: &Self::Control,
derivs: &StateDerivatives<N>,
) -> Transport<N>
fn transport( &self, t: f64, state: &[f64; N], control: &Self::Control, derivs: &StateDerivatives<N>, ) -> Transport<N>
Transport and local source for the given control and derivatives.
The solver calls this after crate::models::control::ControlProblem::optimize
at each backward step and assembles the implicit operator from the
returned coefficients.
Provided Methods§
Sourcefn jump_kernel(
&self,
_t: f64,
_state: &[f64; N],
_control: &Self::Control,
_derivs: &StateDerivatives<N>,
transport: &Transport<N>,
) -> JumpKernel<N>
fn jump_kernel( &self, _t: f64, _state: &[f64; N], _control: &Self::Control, _derivs: &StateDerivatives<N>, transport: &Transport<N>, ) -> JumpKernel<N>
Jump kernel for arbitrary-amplitude jump dimensions.
The default folds Transport::plus/Transport::minus into the unit
+1/-1 transitions of the DiscreteJump convention, so models that
do not use general jumps are unchanged. Override this only for a
DimensionKind::Jump dimension whose amplitudes differ from one.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".