SysPhS vs Modelica: If you redeclare a PhSConstant (Modelica parameter) as a PhSVariable (Modelica variable) Modelica still treats it as a 'parameter'. You can end up with an unbalanced system with one equation too many!

This page identifies a possible issue, inconsistency, concern, error, or bug!
One of the ways Webel IT Australia helps promote tools, technologies, and languages is by donating a lot of time identifying, tracking, and reporting potential issues, in order to help vendors and developers improve the tools and technologies. In some cases, we also offer workarounds and advice for users. All issues tracked on our public site are offered most constructively and with sincerest gratitude to the tool vendors and technology developers.
DISCLAIMER: Vendors do not officially endorse issue analysis by Webel IT Australia.
Icon class
icon_class
far fa-sticky-note
icon_class_computed
far fa-sticky-note
Note kind
Policy level
Specification keywords
UML keywords
SysMLv1.x keywords
Modelica keywords
SysPhS Keywords
Keywords
Click on the image to view it full size
Firstly, you may be asking why on earth one would wish to do this. It's an attempt to workaround the fact that SysPhS-1.1 does not support Modelica's 'initial equation'; there are circumstances where if you have a variable instead of a parameter you can still initialise it at startup using other parameters elsewhere. Consider this base:

model Gain
  extends SISO;
  replaceable parameter Real k;
equation
  y = k * u;
end Gain;
You might at first expect the following to redeclare k as a variable (not a parameter) within the context of the extending Gain1, but it doesn't:

model Gain1
  extends Gain(redeclare Real k);
end Gain1;
The result is you can end up with an unbalanced system with one equation too many for the number of identified variables.
Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)