Skip to content

Commit 36837e2

Browse files
committed
add precompile workload
1 parent 8a577e9 commit 36837e2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/ModelingToolkit.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,25 @@ PrecompileTools.@compile_workload begin
224224
@variables x(ModelingToolkit.t_nounits)
225225
@named sys = ODESystem([ModelingToolkit.D_nounits(x) ~ -x], ModelingToolkit.t_nounits)
226226
prob = ODEProblem(structural_simplify(sys), [x => 30.0], (0, 100), [], jac = true)
227+
@mtkmodel __testmod__ begin
228+
@structural_parameters begin
229+
structp = false
230+
end
231+
@variables begin
232+
x(t) = 0.0, [description="foo", guess=1.0]
233+
end
234+
@parameters begin
235+
a = 1.0, [description="bar"]
236+
if structp
237+
b=2*a, [description="if"]
238+
else
239+
c
240+
end
241+
end
242+
@equations begin
243+
x ~ a + b
244+
end
245+
end;
227246
end
228247

229248
export AbstractTimeDependentSystem,

0 commit comments

Comments
 (0)