Importing Initial Conditions

You can import initial conditions from an external result file (.mat) or from any open execution result. This allows you to perform a new simulation from a given time point and with a computed initial state.


Before you begin:

At any time, you can open this simulation result to import the initial conditions, as described below.

Related Topics
About Virtual Execution
  1. Activate Mechanics.Multibody.Examples.Elementary.DoublePendulum from the Modelica Standard Library.

  2. Use one of the following methods:

    • Select Tools > Virtual Execution > Import Initial Conditions from the menu bar.
    • Select Parameters Initial Value from the Execution toolbar to display the Initial Conditions window, then click Import initial conditions from results .

    The Import initial conditions from result dialog box appears.

  3. Select the result containing the initial conditions you want to import:

    • Select the Result to import from field, then select a result from a displayed Variable Browser.
    • Select Open. The Open dialog box appears to let you browse and select an external .mat file.

      For the purpose of this scenario, browse and select DoublePendulum_from0to10.



  4. In the Time point to consider field, define the start time to be considered by moving the slider or editing the field.

  5. Click OK to close the dialog box.

    The Initial Conditions window appears.

  6. Click Execution Setup and open the Attributes tab.

    Note that the Start time is the imported Time point to consider.

  7. Click Virtual Execution to perform a simulation.

    The Variable Browser appears.

  8. In the same plotter, plot the same variable (Revolute1.Phi, for example)

    • From the Variable Browser of DoublePendulum
    • From the Variable Browser of DoublePendulum_from0to10

    Note that the virtual execution of DoublePendulum is the continuity of the DoublePendulum_From0to10 result.