Häufig gestellte Fragen

Brauchen Sie technischen Support?

How can I get the maximum value of a User Accessible Quantity (UAQ) for the whole simulation?

Frage

How can I get the maximum value of a User Accessible Quantity (UAQ) for the whole simulation?

Antwort

In the maneuver commands, you can use the RealTimeExpressions function max().

The max-function returns the maximum value of the given arguments.
The best way to get a maximum value of one quantity for the whole simulation is the following approach. Add the following commands in the Global Maneuver commands:

first() ? Qu::max_speed = 0
max_speed = max(Car.v,max_speed)

The variable "max_speed" is there to save the maximum value.
Then each simulation cycle we compare the current speed "Car.v" with the maximum value.
Which of both is bigger is saved as the new maximum speed.

You can check this screenshot to see how the values change:

Brauchen Sie technischen Support?
  • Datum: 01.08.2023
  • Produkt: CarMaker
  • Version: 12.0
  • Komponente: RT Expressions
  • Sprache: Englisch

Tags

RealTime Expressions
Maneuver Commands
User Accessible Quantities