Skip to content
Stephen Berry edited this page Jun 30, 2016 · 6 revisions

Sampling

See Discrete Sampling example.

Events

The event method is used similarly to the sample() method. However, it is for single events rather than sampling.
Example: The event time will be exactly stepped to, even if it is not in sync with the sampling rate.

if (event(1.2))
{
   // Do stuff...
}

Time Step (dt vs dt_base)

The time step can be dynamically changed in Ascent on two levels. The variable dt represents the length of time for the current time step. The dt variable will often change from step to step if there are multiple sampling rates and events triggered in the simulation.

The variable dt_base is the base time step for the simulation and usually remains a constant unless adaptive time stepping is implemented or the program explicitly changes the base time step. The base time step is not affected by sampling rates and events.

Clone this wiki locally