Simulation and Run Functions
Simulation values
| Name | Value |
|---|---|
TIME | Current simulation time. |
DT | Model timestep. |
STARTTIME | Model start time. Alias: INITIALTIME. |
STOPTIME | Model end time. Alias: ENDTIME. |
RUNCOUNT | Current run number; the native single-run engine initializes it to 1. |
SENSIRUNCOUNT | Current sensitivity run number; initialized to 1. |
SENSIRUNTOTAL | Total 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:
RUNCUM(variable [, fromtime [, totime [, run]]])RUNSUM(variable [, fromtime [, totime [, run]]])RUNMAX(variable [, fromtime [, totime [, run]]])RUNMEAN(variable [, fromtime [, totime [, run]]])RUNMIN(variable [, fromtime [, totime [, run]]])
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.
RUNCUMtrapezoidally integrates sampled values over time.RUNSUMsums sampled values.RUNMAXandRUNMINreturn sampled extrema.RUNMEANreturns the arithmetic mean of sampled values.
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