Related content
Previous snippet
SysML parameter names are replaced in the Modelica equations according to the bindings in Figure 13: f is replaced by u, pos is replaced by y, x is replaced by position, k is replaced by springcst, v is replaced by velocity, m is replaced by
mass.
model Spring
input Real u;
output Real y;
Real position;
parameter Real springcst = 1;
Real velocity;
parameter Real mass = 10;
equations
der(velocity)=(u-springcst*position)/m;
der(position)=velocity;
y=position;
end Spring;
Next snippet
There is an error in the Figure reference:
The reference to 'Figure 13' is wrong
There are two errors in the Modelica code:
The keyword
equation
not equations
should be used
It should probably say
SpringMassSys
not Spring