HOWTO access custom (user-defined) Mathematica functions using Mathematica v13.2 as an external maths engine for SysML Parametrics (ConstraintBlocks) in Magic Model Analyst (Cameo Simulation Toolkit) versions 2021x, 2021xR1, 2022xR1

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
UML keywords
SysMLv1.x keywords
Click on the image to view it full size

With the correct setup one call invoke built-in functions of Mathematica acting as an external maths engine from ConstraintBlock usages in Magic Model Analyst® (Cameo Simulation Toolkit®).

However, by default, you can only invoke Mathematica functions that are registered with your Mathematica install. If you have custom Mathematica functions in a .wl Package library (or a full Paclet), you'll have to register them with Mathematica. For a simple Package, just follow the steps here:

On (re)starting your Cameo Simulation Toolkit host app (MagicDraw or Cameo Systems Modeler) it should catch the user-defined, auto-loaded functions.
It is worth checking first that the functions indeed auto-load using a Mathematica notebook, but your don't need the Mathematica desktop app running for this to work.
If you change (edit) your user-defined functions .m or .wl library file, you'll need to restart MagicDraw or Cameo Systems Modeler to catch the changes, as they will only autoload when the host app makes a connection to the Mathematic engine, which it only does once on startup.

Historical note

The ParaMagic Plugin v18 used a special Custom Mathematica connection (a.k.a. 'cMathematica'). From their PDF Docs:

8.1 ParaMagic - Custom Mathematica Connection

The ParaMagic - Custom Mathematica connection (a.k.a cMathematica) exposes full power of Mathematica to ParaMagic users through the cMathematica function. This allows “wrapping” of both pre-defined and user-written Mathematica functions — saved as .m files in the Mathematica Autoload folder — as constraint blocks
It would seem this is all handled automatically in the latest Magic Model Analyst® (Cameo Simulation Toolkit®), as long as the Mathematica autoloading is setup properly.
Relates to
Related notes
Related notes (backlinks)
Related snippets (extracts)
Visit also
Visit also (backlinks)
External links