Clock
SourcesOutputs the current simulation elapsed time in physical seconds. Acts as an authoritative time source for synthesizing time-dependent waveforms, driving dynamic setpoint trajectories, indexing Look-Up Tables, triggering sequential state events, and providing reference timestamps for logging and telemetry.
Mathematical Model
In continuous-time integration, the clock reflects the current integration timestamp:
For discrete-time simulations operating at a fixed sample step , the output evolves synchronously with the sample index:
The output begins strictly at (or the simulation start time ) and increases monotonically throughout execution.
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| ← Out | out |
Time | number | Output |
Usage Examples
Example 1: Synthesizing Dynamic Chirp Waveforms
To analyze mechanical resonances across a continuous frequency band, connect the Clock output to a Gain block () and a Product block multiplying time by a ramp rate. Passing this instantaneous phase angle into a Trigonometric (Sine) block synthesizes an excitation chirp signal that sweeps smoothly from low to high frequency.
Example 2: Scheduled Setpoint Trajectory Generation
For industrial batch processes with scheduled heating, soak, and cooling intervals, connect the Clock signal to a 1D LookupTable. The table interpolates temperature setpoints as a function of elapsed process time, feeding an automated multi-stage profile directly into a feedback temperature controller.
Remarks & Best Practices
- Master Solver Synchronization: Tracks the exact internal integration timestamp of the solver, reflecting non-uniform step progressions during adaptive variable-step solvers (e.g. RK45, TR-BDF2).
- Zero Input Requirement: Operates purely as a source block requiring no upstream signal connections.
- High Numerical Precision: Evaluated using IEEE-754 64-bit floating-point arithmetic (
f64), preventing timestamp drift or quantization errors even over long-duration simulations. - Complement to Signal Generators: Ideal for building custom analytic drive functions (such as decaying sinusoids or polynomial trajectories) by combining with Math and Gain blocks.
Related Components
- Ramp: Generates a linear signal with configurable start time, initial value, and slope.
- Step: Generates an abrupt step transition at a designated threshold timestamp.
- SignalGenerator: Dedicated source block for periodic waveforms (sine, square, triangle).
- LookupTable: 1D and 2D table interpolation driven by time or arbitrary state inputs.