Skip to content

Commit 668add3

Browse files
Add time-varying parameter test
1 parent bb8d89f commit 668add3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/system_construction.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,36 @@ function test_vars_extraction(de, de2)
3131
end
3232
test_vars_extraction(de, de2)
3333

34+
# Time-varying parameters
35+
36+
@test_broken begin
37+
eqs = [D(x) ~ σ(t)*(y-x),
38+
D(y) ~ x*-z)-y,
39+
D(z) ~ x*y - β*z]
40+
de = DiffEqSystem(eqs,[t],[x,y,z],[σ,ρ,β])
41+
ModelingToolkit.generate_ode_function(de)
42+
43+
#=
44+
```julia
45+
:((du, u, p, t)->begin
46+
x = u[1]
47+
y = u[2]
48+
z = u[3]
49+
σ = p[1]
50+
ρ = p[2]
51+
β = p[3]
52+
x_t = σ(t) * (y - x)
53+
y_t = x * (ρ - z) - y
54+
z_t = x * y - β * z
55+
du[1] = x_t
56+
du[2] = y_t
57+
du[3] = z_t
58+
end
59+
end)
60+
```
61+
=#
62+
end
63+
3464
# Conversion to first-order ODEs #17
3565
@Deriv D3'''~t
3666
@Deriv D2''~t

0 commit comments

Comments
 (0)