1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Defines system of stochastic differential equations for numerical solvers.
//! The NumericalMethods use this trait to take a input system from the user and solve
//! Includes a stochastic differential equation and optional event function to interupt solver
//! given a condition or event.
use crate;
/// SDE Trait for Stochastic Differential Equations
///
/// SDE trait defines the stochastic differential equation dY = a(t,Y)dt + b(t,Y)dW for the solver.
/// The stochastic differential equation is used to solve systems with both deterministic and random components.
/// The trait also includes a solout function to interupt the solver when a condition
/// is met or event occurs.
///
/// # Impl
/// * `drift` - Deterministic part a(t,Y) of the SDE in form drift(t, &y, &mut dydt).
/// * `diffusion` - Stochastic part b(t,Y) of the SDE in form diffusion(t, &y, &mut dydw).
/// * `noise` - Generates the random noise increments for the SDE.
/// * `event` - Event function to interupt solver when condition is met or event occurs.
///
/// Note that the event function is optional and can be left out when implementing.
///