Setting up the simulation range

1.    Choose System > System Properties.

2.    Click the Range tab.

3.    Choose the options you want, then click OK, or press ENTER.

Auto Restart: For real-time control or training neural networks, where multiple data sets must be fed into Embed repeatedly, you can activate Auto Restart. This parameter restarts and runs the simulation until one of the following conditions is met: the signal in the error or stop block goes to 1, or you manually stop the simulation.

You can keep track of the number of the run by wiring a $runCount variable block into your diagram.

To retain the states of blocks each time Embed automatically restarts a simulation, activate Retain States, as described below. Blocks that are time based (for example, Signal Producer blocks) are reset to their restart time. For a smooth transition between auto-restart simulation runs, you need to remove the Signal Producer blocks from your diagram. For instance, if your diagram contains a sinusoid block, replace it with an integrator block with its derivative set to the sinusoidal frequency and feed it to a sin block.

Retain States: For a smooth transition between simulation iterations, activate Retain State. When activated, Embed retains the states of the integrator, transferFunction, and unitDelay blocks each time it restarts a simulation.

Retain State can only be activated when Auto Restart is already activated.

RT Scale: Lets you run a simulation at a multiple or fraction of real time, which means you can run a simulation at a comfortable speed for user interaction.

Run in Real Time: With Run in Real Time, Embed simulates in real-time mode, which has the effect of retarding a simulation so that one simulation sec equals one clocked sec. This mode comes in handy when a system is exhibiting rapidly varying behavior. In real-time mode, the behavior can be slowed down and more easily analyzed.

Typically, you use real-time mode for hardware-in-the-loop control situations. For this, however, you also need a PC D/A-A/D card. The Embed real-time driver lets you configure different analog and digital channels and insert them into a diagram for reading and writing.

Start/End: The Start and End parameters control when Embed starts and stops a simulation.

You can also Setting simulation defaults for the start and end.

Time Step: The time step is the time increment Embed uses to evaluate the diagram. It is also the fundamental unit of integration by which the integration algorithm computes the integral of the input functions, as well as the time interval between data points in the Signal Consumer blocks wired into the diagram. The default is 0.05 sec.

For adaptive integration methods (adaptive Runge Kutta 5th order and adaptive Bulirsh-Stoer), you can also specify a minimum step size.

You can also set (A) a default step size for the non-adaptive integration methods, or (B) a local time step for multi-rate simulation.

You can switch to frequency as the fundamental unit of integration, by selecting either Hertz, Kilohertz, or Megahertz from the drop-down list box to the right of the Step Size box. When you do so, the Step Size box becomes a Frequency box. Enter the frequency in the box.