While a ValueProperty in SysMLv1.x can by typed by a ValueType that carries a unit specification, Systems Modeling Language v1 (SysML®) (v1.x) can't perform units-aware Quantity algebra the way Mathematica can. In particular, the custom type Quantity
ValueType in the Webel SysML4Mathematica modelling recipe can be directly executed, but it is not truly units-aware.
In Webel SysML4Mathematica the custom Quantity
ValueType (not to be confused with the SysML QuantityKind
or Unit
) extends a special ValueType _
(a Blank) that represents any Mathematica expression.
In the test shown, that custom Quantity
ValueType has been extended by a Quantity$m
ValueType (which carries 'm' metre units) and a Quantity$mm
ValueType, which carries 'mm' millimetre units. The driving Block TestPlusQ2
has a constraint property of type PlusQ2
, which (much like a Mathematica Plus operating on 2 Quantity expressions) accepts Quantity inputs and has a Quantity output.
A driving Block TestPlusQ2
has two input value properties, with mixed types Quantity$m
and Quantity$mm
, and an output carrier value property of type Quantity$m
.
When run in Magic Model Analyst® (Cameo Simulation Toolkit®) with input values representing 1.1 m and 2.2 mm, the naive result is 3.3 m; the mismatch in units between 'm' and 'mm' in the inputs has not been reconciled.
When working purely in SysML this is easily handled by using explicit unit conversion ConstraintBlocks, which strategy requires prior knowledge of the units used. However, for purposes of modelling Mathematica code logic and equations in SysML, that strategy does not scale well, as in most cases it is desirable to NOT have to specify units in advance.
Visit also: