Commit 5b1d8e4e authored by Tjerk Vreeken's avatar Tjerk Vreeken

Fix reading symbolic nominals in ModelicaMixin

Earlier on in the affected method we cast to make sure that we always deal
with a ca.MX instance. However, the substitute call is likely to return a
ca.DM, which would then fail later on when calling ".to_DM()" on it.

Closes #1081
parent 0b4c7cf9
......@@ -354,6 +354,7 @@ class ModelicaMixin(OptimizationProblem):
# If nominal contains parameter symbols, substitute them
if not nominal.is_constant():
[nominal] = substitute_in_external([nominal], self.__mx['parameters'], parameter_values)
nominal = ca.MX(nominal)
if nominal.is_constant():
# Take absolute value (nominal sign is meaningless- a nominal is a magnitude)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment