Figure 25: Constraint block for signal flow in SysML

Gallery
Tutorial
Click on the image to view it full size
There are some errors in the spec's sample Modelica code:

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;
And the referenced flow properties in the spec version of the figure should be rSig not rsig: Also, the model as given in the spec not very useful, if you run it you just get a flat line for the position, it would be better to at least kick start the spring with something like:

  Real position(start=5);
Note also this suggestion (which corresponds with how the MagicDraw SysML Plugin and Magic Cyber-Systems Engineer® (Cameo Systems Modeler®) export it): Note that the Parametric diagram named 'SpringMassSys' is owned by a context block SpringMassSys. Export of block SpringMassSys to Modelica from the MagicDraw SysML Plugin or Magic Cyber-Systems Engineer ® (Cameo Systems Modeler®) gives:

model SpringMassSys
  Modelica.Blocks.Interfaces.RealInput u;
  Modelica.Blocks.Interfaces.RealOutput y;
  Real position;
  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;

Note the use of the explicit start attribute along with the explicit attribute fixed=true.

And on a minor modelling matter:

In the MagicDraw SysML Plugin and Magic Cyber-Systems Engineer® (Cameo Systems Modeler®) implementation of the SysPhS library the FlowProperty rSig has AggregationKind 'none':

The spec version of Figure 25 shows rSig as AggregationKind 'composite'.
Up next
Notes
Snippets (quotes/extracts)
Visit also
Visit also (backlinks)
Related slides (includes other tutorials)
Related slides (backlinks, includes other tutorials)