Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Get Simulation Parameters (Simulation Module)

LabVIEW 8.2 Simulation Module Help
September 2006

NI Part Number:
371894A-01

»View Product Info

Returns a cluster containing the current simulation parameters. You set these parameters using the Configure Simulation Parameters dialog box and/or the Input Node of the Simulation Loop. This function does not have a configuration dialog box. Example

Block Diagram Outputs

Block Diagram Outputs

ParameterDescription
Simulation ParametersReturns the values of the following simulation parameters:
  • Method Order—Returns the order of the ordinary differential equation (ODE) solver.
  • Initial Time—Returns the time at which the ODE solver starts.
  • Final Time—Returns the time at which the ODE solver stops.
  • Step Size—Returns the interval between the times at which the ODE solver evaluates the model and updates the model output, in seconds. This option is available only if you select a fixed step-size ODE solver.
  • Absolute Tolerance—Returns the absolute tolerance that defines the acceptable error of the ODE solver a(y). The LabVIEW Simulation Module compares a(y) with the estimated error of the ODE solver e(y) and adjusts the step size of the ODE solver accordingly. This option is available only if you select a variable step-size ODE solver.

    Absolute Tolerance defines the acceptable error a(y) as follows:

    For y' = f(y), a(y) ≈ |y| * Relative Tolerance + Absolute Tolerance.

    During each iteration of the Simulation Loop, the Simulation Module estimates the error of the ODE solver as e(y). If e(y) > a(y), the variable step-size solver reduces the step size such that the step size >= Minimum Step Size. If e(y) < a(y), the variable step-size solver increases the step size such that the step size <= Maximum Step Size.

    In general, a larger Absolute Tolerance increases the step size. This increase reduces the time the simulation needs to complete. Absolute Tolerance has a larger effect on a(y) when y is small.

  • Relative Tolerance—Returns the relative tolerance that defines the acceptable error of the ODE solver a(y). The Simulation Module compares a(y) with the estimated error of the ODE solver e(y) and adjusts the step size of the ODE solver accordingly. This option is available only if you select a variable step-size solver. Relative Tolerance defines the acceptable error a(y) as follows:

    For y' = f(y), a(y) ≈ |y| * Relative Tolerance + Absolute Tolerance.

    During each iteration of the Simulation Loop, the Simulation Module estimates the error of the ODE solver as e(y). If e(y) > a(y), the variable step-size solver reduces the step size such that the step size >= Minimum Step Size. If e(y) < a(y), the variable step-size solver increases the step size such that the step size <= Maximum Step Size.

    In general, a larger Relative Tolerance increases the step size. This increase reduces the time the simulation needs to complete. Relative Tolerance has a larger effect on a(y) when y is large.

  • Continuous Solver—Returns the type of ODE solver used to evaluate the simulation diagram.
  • Discrete Step Size—Returns the base time step used for discrete functions on the simulation diagram, in seconds.
  • Minimum Step Size—Returns the smallest time step size the ODE solver can use to evaluate the simulation diagram.
  • Maximum Step Size—Returns the largest time step size the ODE solver can use to evaluate the simulation diagram.
  • Initial Step Size—Returns the time step size for the first time step of the simulation diagram evaluation.
  • Simulation Time—Returns the current time of the simulation. This value is useful if you terminate the simulation before the final time and you need to know the time at which the simulation terminated.
  • Finished Late?—Returns TRUE if the Simulation Loop iteration did not complete within the period you specified in the Configure Simulation Parameters dialog box. Finished Late? returns FALSE if the Simulation Loop iteration completed within the Period you specified.
  • Timestep Index—Returns the number of time steps the ODE solver has taken.

Example

Refer to the get simulation parameters VI in the labview\examples\simulation\Getting Started\Utilities directory for an example of using the Get Simulation Parameters VI.

 


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit