@@ -4,9 +4,38 @@ $(TYPEDSIGNATURES)
44Generates the Liouville transformed set of ODEs, which is the original
55ODE system with a new variable `trJ` appended, corresponding to the
66-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 .
88
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)``.
913
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.
1039
1140Sources:
1241
@@ -15,8 +44,6 @@ Optimal Transport Approach
1544
1645Abhishek Halder, Kooktae Lee, and Raktim Bhattacharya
1746https://abhishekhalder.bitbucket.io/F16ACC2013Final.pdf
18-
19-
2047"""
2148function liouville_transform (sys)
2249 t = independent_variable (sys)
0 commit comments