@@ -5,6 +5,7 @@ module MTKBifurcationKitExt
5
5
# Imports
6
6
using ModelingToolkit, Setfield
7
7
import BifurcationKit
8
+ using SymbolicIndexingInterface: is_time_dependent
8
9
9
10
# ## Observable Plotting Handling ###
10
11
@@ -94,6 +95,14 @@ function BifurcationKit.BifurcationProblem(nsys::System,
94
95
if ! ModelingToolkit. iscomplete (nsys)
95
96
error (" A completed `System` is required. Call `complete` or `structural_simplify` on the system before creating a `BifurcationProblem`" )
96
97
end
98
+ if is_time_dependent (nsys)
99
+ nsys = System ([0 ~ eq. rhs for eq in full_equations (nsys)],
100
+ unknowns (nsys),
101
+ parameters (nsys);
102
+ observed = observed (nsys),
103
+ name = nameof (nsys))
104
+ nsys = complete (nsys)
105
+ end
97
106
@set! nsys. index_cache = nothing # force usage of a parameter vector instead of `MTKParameters`
98
107
# Creates F and J functions.
99
108
ofun = NonlinearFunction (nsys; jac = jac)
@@ -143,17 +152,4 @@ function BifurcationKit.BifurcationProblem(nsys::System,
143
152
kwargs... )
144
153
end
145
154
146
- # When input is a ODESystem.
147
- function BifurcationKit. BifurcationProblem (osys:: System , args... ; kwargs... )
148
- if ! ModelingToolkit. iscomplete (osys)
149
- error (" A completed `ODESystem` is required. Call `complete` or `structural_simplify` on the system before creating a `BifurcationProblem`" )
150
- end
151
- nsys = System ([0 ~ eq. rhs for eq in full_equations (osys)],
152
- unknowns (osys),
153
- parameters (osys);
154
- observed = observed (osys),
155
- name = nameof (osys))
156
- return BifurcationKit. BifurcationProblem (complete (nsys), args... ; kwargs... )
157
- end
158
-
159
155
end # module
0 commit comments