Automatically Calculating the Discrete Step Size of a Simulation (Control Design and Simulation Module)
- Updated2023-03-14
- 2 minute(s) read
Instead of manually entering a discrete step size for the simulation, you can use the LabVIEW Control Design and Simulation Module to automatically calculate the discrete step size of the simulation based on the sample period (s) parameter and sample skew (s) parameter of each Discrete Linear Systems function on the simulation diagram. The step size of a fixed step-size ordinary differential equation (ODE) solver also affects the discrete step size of the simulation. The step sizes of variable step-size ODE solvers do not affect this discrete step size.
The Control Design and Simulation Module calculates the floating-point greatest common divisor (GCD) of two numbers, x1 and x2, by finding the largest value of z such that the following equation is true:
abs((xi/z) – round(xi/z)) > ε
where i = 1, 2, ... n
In this equation, n is the total number of discrete Simulation functions on the simulation diagram.x1 is the sample period (s) parameter and the sample skew (s) parameter of a single discrete function on the simulation diagram. x2 represents these parameters for a second discrete function on the simulation diagram. z is the discrete time step of the simulation, and ε is a small number. The Control Design and Simulation Module uses an extension of this equation to calculate the floating-point GCD of a set of discrete functions on the simulation diagram with sample periods x1, x2, ... xn, where xn > 0.
Complete the following steps to automatically configure the discrete time step of a simulation.
- Display the Configure Simulation Parameters dialog box.
- Place a checkmark in the Auto Discrete Time checkbox.
- Click the OK button to save changes and return to the simulation diagram.