Webel: SysML4Mathematica: Cameo Systems Modeler: Can perform calculations with a custom Quantity ValueType (for Mathematica) directly, but DOES NOT perform units-aware algebra (no automatic conversions)

This page identifies a possible issue, inconsistency, concern, error, or bug!
One of the ways Webel IT Australia helps promote tools, technologies, and languages is by donating a lot of time identifying, tracking, and reporting potential issues, in order to help vendors and developers improve the tools and technologies. In some cases, we also offer workarounds and advice for users. All issues tracked on our public site are offered most constructively and with sincerest gratitude to the tool vendors and technology developers.
DISCLAIMER: Vendors do not officially endorse issue analysis by Webel IT Australia.
Webel IT Australia promotes the amazing Mathematica tool and the powerful Wolfram Language and offers professional Mathematica services for computational computing and data analysis. Our Mathematica tips, issue tracking, and wishlist is offered here most constructively to help improve the tool and language and support the Mathematica user community.
DISCLAIMER: Wolfram Research does not officially endorse analysis by Webel IT Australia.
Icon class
far fa-sticky-note
far fa-sticky-note
Note kind
Policy level
Specification keywords
UML keywords
SysMLv1.x keywords
Click on the image to view it full size

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:

Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)