@@ -26,7 +26,7 @@ sol = solve(prob, Tsit5())
2626@variables z (t)
2727forward_subs = [log (x) => z]
2828backward_subs = [x => exp (z)]
29- new_sys = changeofvariables (sys, t, forward_subs, backward_subs)
29+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs)
3030@test equations (new_sys)[1 ] == (D (z) ~ α)
3131
3232new_prob = ODEProblem (new_sys, [], tspan)
@@ -48,7 +48,7 @@ def = [x=>1., α => 1.]
4848forward_subs = [t + α/ (x+ t) => z ]
4949backward_subs = [ x => α/ (z- t) - t]
5050
51- new_sys = changeofvariables (sys, t, forward_subs, backward_subs; simplify= true , t0= 0. )
51+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs; simplify= true , t0= 0. )
5252# output should be equivalent to
5353# t^2 + α - z^2 + 2 (but this simplification is not found automatically)
5454
@@ -86,7 +86,7 @@ z = reshape(z, 3, 1)
8686forward_subs = vec (T_inv* x .=> z)
8787backward_subs = vec (x .=> T* z)
8888
89- new_sys = changeofvariables (sys, t, forward_subs, backward_subs; simplify= true )
89+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs; simplify= true )
9090
9191new_prob = ODEProblem (new_sys, [], tspan)
9292new_sol = solve (new_prob, Tsit5 ())
@@ -115,7 +115,7 @@ def = [x=>0., μ => 2., σ=>1.]
115115@mtkcompile sys = System (eqs, t; defaults= def)
116116forward_subs = [log (x) => y]
117117backward_subs = [x => exp (y)]
118- new_sys = changeofvariables (sys, t, forward_subs, backward_subs)
118+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs)
119119@test equations (new_sys)[1 ] == (D (y) ~ μ - 1 / 2 * σ^ 2 )
120120@test noise_eqs (new_sys)[1 ] === value (σ)
121121
@@ -131,7 +131,7 @@ forward_subs = [log(x) => z, y^2 => w, log(u) => v]
131131backward_subs = [x => exp (z), y => w^ .5 , u => exp (v)]
132132
133133@mtkcompile sys = System (eqs, t; defaults= def)
134- new_sys = changeofvariables (sys, t, forward_subs, backward_subs)
134+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs)
135135@test equations (new_sys)[1 ] == (D (z) ~ μ - 1 / 2 * σ^ 2 )
136136@test equations (new_sys)[2 ] == (D (w) ~ α^ 2 )
137137@test equations (new_sys)[3 ] == (D (v) ~ μ - 1 / 2 * (α^ 2 + σ^ 2 ))
@@ -144,7 +144,7 @@ new_sys = changeofvariables(sys, t, forward_subs, backward_subs)
144144
145145# Test for Brownian instead of noise
146146@named sys = System (eqs, t; defaults= def)
147- new_sys = changeofvariables (sys, t, forward_subs, backward_subs; simplify= false )
147+ new_sys = change_of_variables (sys, t, forward_subs, backward_subs; simplify= false )
148148@test simplify (equations (new_sys)[1 ]) == simplify ((D (z) ~ μ - 1 / 2 * σ^ 2 + σ* Bx))
149149@test simplify (equations (new_sys)[2 ]) == simplify ((D (w) ~ α^ 2 + 2 * α* w^ .5 * By))
150150@test simplify (equations (new_sys)[3 ]) == simplify ((D (v) ~ μ - 1 / 2 * (α^ 2 + σ^ 2 ) + σ* Bx + α* By))
0 commit comments