Tags and keywords
SysPhS-1.1: 'In a SysML block with constraint properties, the constraints correspond to the same equations in Modelica ... except the SysML parameters in those equations correspond in Modelica to the properties they are bound to in SysML (and flow properties in SysML property paths leading to PhSVariables on conserved quantity kinds are omitted in Modelica, see Subclause 10.7.8).'
SysPhS-1.1: 'The following Modelica code corresponds to Figure 26. It has five equations from the SysML constraint block. SysML parameter names are replaced in the Modelica equations according the bindings in Figure 14 [ERROR]: f1 is replaced by p1.f, v1 is replaced by p1.lV, x is replaced by lengthchg, k is replaced by springcst, v is replaced by velocitydiff, f is replaced by forcethru, v2 is replaced by p2.v, and f2 is replaced by p2.f.'
SysPhS-1.1: p.41: 10.9.8 Modelica modeling, physical interaction: Reference to 'the bindings in Figure 14' should probably be 'the bindings in Figure 26'.
model Spring Flange p1; Flange p2; Real lengthchg; parameter Real springcst = “10”; Real velocitydiff Real forcethru equation p1.f+p2.f=0 forcethru=p1.f; velocitydiff=p1.lV-p2.lV; velocitydiff=der(lengthchg); forcediff=springcst*lengthchg; end Spring;
The spec code contains a typo:
SysPhS-1.1: p.42: 10.9.8 Modelica modeling, physical interaction: Modelica code has 'forcediff=springcst*lengthchg;' should be 'forcethru=springcst*lengthchg;'Export of block
Springto Modelica from the MagicDraw SysML Plugin or Magic Cyber-Systems Engineer ® (Cameo Systems Modeler®) gives:
model Spring Spring _Spring; model Spring Flange p1; Flange p2; Length lengthchg; parameter Stiffness springcst(start=10.0,fixed=true); Velocity velocitydiff; Force forcethru; equation p1.f+p2.f=0; forcethru=p1.f; velocitydiff=p2.lV-p1.lV; velocitydiff=der(lengthchg); forcethru=springcst*lengthchg; end Spring; connector Flange flow Force f; Velocity lV; end Flange; type Length=Real(unit="m"); type Stiffness=Real(unit="N/m"); type Velocity=Real(unit="m/s"); type Force=Real(unit="N"); end Spring;
Note the use of the explicit
start attribute along with the explicit attribute
Unfortunately, theNote how in the trail model version the custom ValueTypes
Springmodel as shown is not quite well formed. Wolfram SystemModeler reports:
Validation of model WebelSysMLvsSysPhS.Spring Warning: Parameter _Spring.springcst has no value, and is fixed during initialization (fixed = true), using available start value (start = 10.0) as default value. Error: The following equations are redundant: 0.0 = 0.0 Corresponding variables with arbitrary value: _Spring.p1.lV Validation of model Spring completed with 1 error.
GOTCHA: MagicDraw SysML/Cameo 19SP3: Export to Modelica: The name of a redefining Property must be exactly the same as the Property it redefines or it will not export properly!And on a very minor modelling matter: