@@ -4,9 +4,38 @@ $(TYPEDSIGNATURES)
4
4
Generates the Liouville transformed set of ODEs, which is the original
5
5
ODE system with a new variable `trJ` appended, corresponding to the
6
6
-tr(Jacobian). This variable is used for properties like uncertainty
7
- propagation and should be used with a zero initial condition .
7
+ propagation from a given initial distribution density .
8
8
9
+ For example, if ``u'=p*u`` and `p` follows a probability distribution
10
+ ``f(p)``, then the probability density of a future value with a given
11
+ choice of ``p`` is computed by setting the inital `trJ = f(p)`, and
12
+ the final value of `trJ` is the probability of ``u(t)``.
9
13
14
+ Example:
15
+
16
+ ```julia
17
+ using ModelingToolkit, OrdinaryDiffEq, Test
18
+
19
+ @parameters t α β γ δ
20
+ @variables x(t) y(t)
21
+ @derivatives D'~t
22
+
23
+ eqs = [D(x) ~ α*x - β*x*y,
24
+ D(y) ~ -δ*y + γ*x*y]
25
+
26
+ sys = ODESystem(eqs)
27
+ sys2 = liouville_transform(sys)
28
+ @variables trJ
29
+
30
+ u0 = [x => 1.0,
31
+ y => 1.0,
32
+ trJ => 1.0]
33
+
34
+ prob = ODEProblem(sys2,u0,tspan,p)
35
+ sol = solve(prob,Tsit5())
36
+ ```
37
+
38
+ Where `sol[3,:]` is the evolution of `trJ` over time.
10
39
11
40
Sources:
12
41
@@ -15,8 +44,6 @@ Optimal Transport Approach
15
44
16
45
Abhishek Halder, Kooktae Lee, and Raktim Bhattacharya
17
46
https://abhishekhalder.bitbucket.io/F16ACC2013Final.pdf
18
-
19
-
20
47
"""
21
48
function liouville_transform (sys)
22
49
t = independent_variable (sys)
0 commit comments