Simulation and Run Functions

Simulation values

NameValue
TIMECurrent simulation time.
DTModel timestep.
STARTTIMEModel start time. Alias: INITIALTIME.
STOPTIMEModel end time. Alias: ENDTIME.
RUNCOUNTCurrent run number; the native single-run engine initializes it to 1.
SENSIRUNCOUNTCurrent sensitivity run number; initialized to 1.
SENSIRUNTOTALTotal sensitivity runs; initialized to 1.

Time-pattern functions

STEP(height, start_time)

Returns 0 before start_time and height at and after it.

Example: STEP(100, 12)

PULSE(start_time [, width])

Returns 1 during the pulse and 0 otherwise. Omitted or zero width uses one DT. Pulse inclusion is evaluated at the midpoint of each timestep.

Example: PULSE(10, 2)

PULSETRAIN(start, width, repeat, end)

Repeats unit pulses from start until end. Alias: PULSE_TRAIN.

Zero width uses one DT. If end <= start, the result is always 0. If repeat <= 0, only the first pulse is used. If repeat < width, the active interval is continuously 1.

Example: PULSETRAIN(2, 1, 5, 20)

RAMP(slope, start [, end])

Returns 0 through start, then increases by slope per time unit. With end, it stops increasing at slope * MAX(end - start, 0).

Example: RAMP(5, 10, 20)

History

HISTORY(variable_or_expression, time [, run])

Evaluates the expression using values at time. run may be a saved-run name string.

Example: HISTORY(Sales, TIME - 1) Example: HISTORY(Sales, 10, "Baseline")

For the current run, a future time returns 0. Missing history also returns 0. HISTORY is non-instantaneous for cycle detection.

Run statistics

Signatures:

variable must be a direct model variable reference. run may be a saved-run name. A run string may also appear immediately after the variable when no time bounds are supplied.

Bounds are clipped to available samples. Invalid ranges, unavailable saved runs, or a requested future endpoint for the current run return NaN; downstream simulation output may sanitize that value.

Example: RUNMEAN(Sales, STARTTIME, TIME) Example: RUNMAX(Inventory, "Baseline")


Yano Simulator Help — Version 0.1.0, Build 20260704