|
79 | 79 |
|
80 | 80 | # Apply in two steps, where derivatives are defined at each step: first t -> a, then a -> b
|
81 | 81 | M2 = change_independent_variable(M1, M1.a; dummies = true)
|
82 |
| - a, ȧ, Ω, Ωr, Ωm, ΩΛ, ϕ, a_t, a_tt = M2.a, M2.ȧ, M2.Ω, M2.r.Ω, M2.m.Ω, M2.Λ.Ω, M2.ϕ, M2.a_t, M2.a_tt |
| 82 | + a, ȧ, Ω, Ωr, Ωm, ΩΛ, ϕ, aˍt, aˍtt = M2.a, M2.ȧ, M2.Ω, M2.r.Ω, M2.m.Ω, M2.Λ.Ω, M2.ϕ, M2.aˍt, M2.aˍtt |
83 | 83 | Da = Differential(a)
|
84 | 84 | @test Set(equations(M2)) == Set([
|
85 |
| - a_t ~ ȧ # 1st order dummy equation |
86 |
| - a_tt ~ Da(ȧ) * a_t # 2nd order dummy equation |
| 85 | + aˍt ~ ȧ # 1st order dummy equation |
| 86 | + aˍtt ~ Da(ȧ) * aˍt # 2nd order dummy equation |
87 | 87 | Ω ~ Ωr + Ωm + ΩΛ
|
88 | 88 | ȧ ~ √(Ω) * a^2
|
89 |
| - a_tt*Da(ϕ) + a_t^2*(Da^2)(ϕ) ~ -3*a_t^2/a*Da(ϕ) |
90 |
| - a_t*Da(Ωr) ~ -4*Ωr*a_t/a |
91 |
| - a_t*Da(Ωm) ~ -3*Ωm*a_t/a |
92 |
| - a_t*Da(ΩΛ) ~ 0 |
| 89 | + aˍtt*Da(ϕ) + aˍt^2*(Da^2)(ϕ) ~ -3*aˍt^2/a*Da(ϕ) |
| 90 | + aˍt*Da(Ωr) ~ -4*Ωr*aˍt/a |
| 91 | + aˍt*Da(Ωm) ~ -3*Ωm*aˍt/a |
| 92 | + aˍt*Da(ΩΛ) ~ 0 |
93 | 93 | ])
|
94 | 94 |
|
95 | 95 | @variables b(M2.a)
|
|
105 | 105 | @variables x(t)
|
106 | 106 | Mt = ODESystem([D(x) ~ 2*x], t; name = :M) |> complete
|
107 | 107 | Mx = change_independent_variable(Mt, Mt.x; dummies = true)
|
108 |
| - @test (@variables x x_t(x) x_tt(x); Set(equations(Mx)) == Set([x_t ~ 2*x, x_tt ~ 2*x_t])) |
| 108 | + @test (@variables x xˍt(x) xˍtt(x); Set(equations(Mx)) == Set([xˍt ~ 2*x, xˍtt ~ 2*xˍt])) |
109 | 109 | end
|
110 | 110 |
|
111 | 111 | @testset "Change independent variable (free fall)" begin
|
@@ -133,11 +133,11 @@ end
|
133 | 133 | # Compare to pen-and-paper result
|
134 | 134 | @independent_variables x
|
135 | 135 | Dx = Differential(x)
|
136 |
| - @variables x_t(x) x_tt(x) y(x) t(x) |
| 136 | + @variables xˍt(x) xˍtt(x) y(x) t(x) |
137 | 137 | @test Set(equations(M2)) == Set([
|
138 |
| - x_t^2*(Dx^2)(y) + x_tt*Dx(y) ~ x_t^2 + 3*y^2*Dx(y)*x_t # from D(D(y)) |
139 |
| - x_t ~ x^4 + y^5 + t^6 # 1st order dummy equation |
140 |
| - x_tt ~ 4*x^3*x_t + 5*y^4*Dx(y)*x_t + 6*t^5 # 2nd order dummy equation |
| 138 | + xˍt^2*(Dx^2)(y) + xˍtt*Dx(y) ~ xˍt^2 + 3*y^2*Dx(y)*xˍt # from D(D(y)) |
| 139 | + xˍt ~ x^4 + y^5 + t^6 # 1st order dummy equation |
| 140 | + xˍtt ~ 4*x^3*xˍt + 5*y^4*Dx(y)*xˍt + 6*t^5 # 2nd order dummy equation |
141 | 141 | ])
|
142 | 142 | end
|
143 | 143 |
|
|
0 commit comments