-
Key: SYSPHS12-13
-
Status: open
-
Source: Webel IT Australia ( Dr. Darren Kelly)
-
Summary:
p.38/39 show Modelica code corresponding to Figure 25: Constraint block for signal flow in SysML (and other model aspects not explicitly shown).
The Modelica code has some initial values for some parameters, but not for variables position or velocity, so if you execute it you just get a flat line. The reporter suggests including a default value such as position=5.0 in the SysML model to kickstart it.
The improved Modelica code, including some fixes identified under (https://issues.omg.org/browse/SYSPHS12-9) and with consistent name SpringMassSys might look like:
model SpringMassSys input Real u; output Real y; Real position(start=5.0,fixed=true); Real velocity; parameter Real springcst(start=1.0,fixed=true); parameter Real mass(start=10.0,fixed=true); equation der(velocity)=(u-springcst*position)/mass; der(position)=velocity; y=position; end SpringMassSys;
Or if the suggestion under (https://issues.omg.org/browse/SYSPHS12-2) to use connectable u and y is adopted:
model SpringMassSys Modelica.Blocks.Interfaces.RealInput u; Modelica.Blocks.Interfaces.RealOutput y; Real position(start=5.0,fixed=true); Real velocity; parameter Real springcst(start=1.0,fixed=true); parameter Real mass(start=10.0,fixed=true); equation der(velocity)=(u-springcst*position)/mass; der(position)=velocity; y=position; end SpringMassSys;
-
Reported: SysPhS 1.1 — Fri, 12 Feb 2021 01:03 GMT
-
Updated: Fri, 12 Feb 2021 18:01 GMT
SYSPHS12 — Suggest kickstart SpringMassSys with a non-zero position (otherwise get flat line when run).
- Key: SYSPHS12-13
- OMG Task Force: SysPhS 1.2 RTF