You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# y is a derivative expression expanded; add it to the initialization equations
51
+
push!(eqs_ics, y ~ x)
60
52
else
61
53
error("Initialization expression $y is currently not supported. If its a higher order derivative expression, then only the dummy derivative expressions are supported.")
62
54
end
63
55
end
64
-
filtered_u0 =todict(filtered_u0)
65
56
end
66
-
else
67
-
dd_guess =Dict()
68
-
filtered_u0 =todict(u0map)
69
57
end
70
58
71
-
defs =merge(defaults(sys), filtered_u0)
72
-
73
-
for st in full_states
74
-
if st ∈keys(defs)
75
-
def = defs[st]
76
-
59
+
# 2) process other variables
60
+
for var in vars
61
+
if var ∈keys(defs)
62
+
def = defs[var]
77
63
if def isa Equation
78
-
st ∉keys(guesses) && check_defguess &&
79
-
error("Invalid setup: unknown $(st) has an initial condition equation with no guess.")
64
+
#TODO: this behavior is not tested!
65
+
var ∉keys(guesses) && check_defguess &&
66
+
error("Invalid setup: variable $(var) has an initial condition equation with no guess.")
80
67
push!(eqs_ics, def)
81
-
push!(u0, st=> guesses[st])
68
+
push!(defs, var=> guesses[var])
82
69
else
83
-
push!(eqs_ics, st ~ def)
84
-
push!(u0, st => def)
70
+
push!(eqs_ics, var ~ def)
85
71
end
86
-
elseifst∈keys(guesses)
87
-
push!(u0, st=> guesses[st])
72
+
elseifvar∈keys(guesses)
73
+
push!(defs, var=> guesses[var])
88
74
elseif check_defguess
89
-
error("Invalid setup: unknown$(st) has no default value or initial guess")
75
+
error("Invalid setup: variable$(var) has no default value or initial guess")
90
76
end
91
77
end
92
78
79
+
# 3) process explicitly provided initialization equations
93
80
if!algebraic_only
94
-
for eq in [get_initialization_eqs(sys); initialization_eqs]
0 commit comments