Introduction

Simulations Module is an octave engine(opensource MatLab tool) that allows you to perform complex calculations within valispace that are quite complicated to perform within the components module. You can reference the valis which are needed for the calculations as input valis and the result as output valis.

Simulation methodology in Valispace

The typical workflow of using a simulation module within valispace is shown below. Each step is explained in each sub-sections.

Creating a New Simulation

To create a new simulation in your project (1), hover over to the simulations module and select “ + simulation” (2). Upon clicking, a popup window opens, Enter the name and click “Create” (3).

Inputs and Outputs

The user has the possibility to add the input and output valis. When the user references the Vali within the inputs or output, the user can provide a short name to the vali which will be used in your octave calculation code.

Example:

If you are using a vali hydrazine.specificHeatRatio from your components, you can simply assign an easy name(“g” in the example shown in the image below). Once the vali is referenced in the inputs, valispace automatically adds the values along with the units.

The user also has the ability to change the simulation unit. Eg. the hydrazine combustion temperature is in Kelvin but you can add the simulation unit(in this case degC). Valispace uses the degC for the calculations.

You can use any vali defined on the Components Module to generate but it is not possible to add the same vali both as an input and output on the same Simulation. The visual representation of the inputs and outputs makes your code easily readable and understandable by anyone on your team.

Calculation/Octave code

As mentioned earlier, Valispace’s simulation module uses an octave engine that allows you to use Octave syntax, which is a high-level language especially developed for numerical computations, to develop your Simulations. It is extremely similar and has incredible compatibility with Matlab which means you won’t have to familiarize yourself with a new framework to be able to develop useful Simulations inside Valispace.

Here is an example of a small simulation example that can be found in the Satellite_valisat Project which can be found in your Training workspace:

If you need further information you can read the GNU Octave Documentation Page.

Run Simulations/Results

Once you script your simulation code, Click on “Run Simulations” which can be found on the top right corner or bottom left corner as shown in the image below.

Once the simulation is completed, valispace automatically updates the output values. As a result, the output valis in the component modules get automatically updated by the valispace. If the output valis are being used as constants in the formulas for computing other valis, valispace does automatic recalculation of every valis associated with the output valis.

Things to Know

In case any of the input values are being changed in the components module, the user has to rerun the simulation to calculate the output values.

The valis which are referenced in the simulation module have a small tag such as “SIM_IN” or “SIM_OUT” attached next to the name in the components module as shown in the image below.