Calculation of a Input Quantity for a FMU
Frage
My FMU requires an input, which is not available in the CarMaker UAQs (User Accessible Quantities).
How can I calculate a quantity and use it as an input for a FMU?
Antwort
There are two possible ways to do this. Option 1 takes a bit more time but is more clear for others, Option 2 is faster to configure.
Here is a short example:
You have a FMU with a damper model, which requires the damper accelerations as an input. But only the damper velocity is accessible in CarMaker.
Option 1) Calculating UAQs in the maneuver dialog with Realtime Expressions
You can place the calculation of the UAQ either in the Global Setting or in a maneuver step. With the diff() function, you can differentiate the damper velocity to get the damper acceleration.
Pay attention to the different syntax!
Global Settings:
first() ? Qu::aDamp_FL = 0
aDamp_FL = diff(Car.DampFL.v)
Maneuver step:
Eval first() ? Qu::aDamp_FL = 0
Eval aDamp_FL = diff(Car.DampFL.v)
After you ran the simulation once, the new quantity is available in the CarMaker DataDictionary. You can access the quantity in the FMU dialog with the drop down on the right and selecting "DataDict Quantity".
Option 2) Realtime Expressions in the FMU dialoge
A quicker way is to type the Realtime Expression directly into the connected input of the FMU. For this, choose "RT Expression" instead of DataDict Quantity in the drop down menu.
Regarding this example, the syntax would be:
Qu::aDamp_FL = diff(Car.DampFL.v)
Now, you can use the damper accelerations as an input for your FMU.
- Datum: 03.03.2020
- Produkt: CarMaker
- Version: 8.1
- Komponente: FMI
- Sprache: Englisch
Tags
FMUFMI
Quantities
UAQ
Realtime Expressions