@@ -13,8 +13,7 @@ $(TYPEDSIGNATURES)
1313Generate `System` of nonlinear equations which initializes a problem from specified initial conditions of an `AbstractTimeDependentSystem`.
1414"""
1515function generate_initializesystem_timevarying (sys:: AbstractSystem ;
16- u0map = Dict (),
17- pmap = Dict (),
16+ op = Dict (),
1817 initialization_eqs = [],
1918 guesses = Dict (),
2019 default_dd_guess = Bool (0 ),
@@ -40,8 +39,16 @@ function generate_initializesystem_timevarying(sys::AbstractSystem;
4039 idxs_diff = isdiffeq .(eqs)
4140
4241 # PREPROCESSING
43- u0map = copy (anydict (u0map))
44- pmap = anydict (pmap)
42+ op = anydict (op)
43+ u0map = anydict ()
44+ pmap = anydict ()
45+ build_operating_point! (sys, op, u0map, pmap, defs, unknowns (sys),
46+ parameters (sys; initial_parameters = true ))
47+ for (k, v) in op
48+ if has_parameter_dependency_with_lhs (sys, k) && is_variable_floatingpoint (k)
49+ pmap[k] = v
50+ end
51+ end
4552 initsys_preprocessing! (u0map, defs)
4653
4754 # 1) Use algebraic equations of system as initialization constraints
@@ -177,8 +184,7 @@ $(TYPEDSIGNATURES)
177184Generate `System` of nonlinear equations which initializes a problem from specified initial conditions of an `AbstractTimeDependentSystem`.
178185"""
179186function generate_initializesystem_timeindependent (sys:: AbstractSystem ;
180- u0map = Dict (),
181- pmap = Dict (),
187+ op = Dict (),
182188 initialization_eqs = [],
183189 guesses = Dict (),
184190 algebraic_only = false ,
@@ -196,8 +202,16 @@ function generate_initializesystem_timeindependent(sys::AbstractSystem;
196202 guesses = merge (get_guesses (sys), additional_guesses)
197203
198204 # PREPROCESSING
199- u0map = copy (anydict (u0map))
200- pmap = anydict (pmap)
205+ op = anydict (op)
206+ u0map = anydict ()
207+ pmap = anydict ()
208+ build_operating_point! (sys, op, u0map, pmap, defs, unknowns (sys),
209+ parameters (sys; initial_parameters = true ))
210+ for (k, v) in op
211+ if has_parameter_dependency_with_lhs (sys, k) && is_variable_floatingpoint (k)
212+ pmap[k] = v
213+ end
214+ end
201215 initsys_preprocessing! (u0map, defs)
202216
203217 # Calculate valid `Initial` parameters. These are unknowns for
0 commit comments