Skip to content

Commit

Permalink
(MAYBE) fix: handle scalarized parameters in initialization equations
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Sep 4, 2024
1 parent 0e83102 commit 4495721
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/systems/nonlinear/initializesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,20 @@ function generate_initializesystem(sys::ODESystem;
error("Invalid setup: parameter $(p) has no default value or initial guess")
end
push!(u0, varp => guesses[p])
elseif Symbolics.isarraysymbolic(p) && Symbolics.shape(p) != Symbolics.Unknown()
for _p in collect(p)
if (_val1 = get(pmap, _p, nothing)) === missing || get(defs, _p, nothing) === missing
varp = tovar(_p)
paramsubs[_p] = varp
if _val1 !== nothing && _val1 !== missing
push!(eqs_ics, varp ~ _val1)
end
if !haskey(guesses, _p)
error("Invalid setup: parameter $(_p) has no default value or initial guess")
end
push!(u0, varp => guesses[_p])
end
end
end
end
pars = vcat(
Expand Down

0 comments on commit 4495721

Please sign in to comment.