Previously known as the Simulations Module, we have improved the now-called Scripting Module by integrating both the octave and python engines. Therefore, the user can write codes based on the octave (Matlab) or python code directly within Valispace and can run their calculations which were not possible using the formula’s in the Components Module.
The users can perform computations with conditional calculations or solve linear and non-linear calculations using the Scripting Module and also write python scripts to access the Valispace API and create/edit objects within Valispace.
Currently, the scripting module is released as a beta version. Therefore the user has to enable the option in the Beta features setting as shown in the gif below.
Use cases of Scripting module
The main objective of the scripting module is to provide users with the ability to perform complex calculations that are not possible through the formulas in the components module. The users would be able to perform computations with conditional calculations or solve linear and non-linear calculations using the octave engine or python engine.
The users can also use the python engine to run some python scripts to do bulk edits or bulk creation by accessing the Valispace API. Some of the possible use-cases are
Creating a vali and adding it to multiple existing components
Make bulk edits to the identifiers of requirements
Run a simulation using python
Convert the units of all power valis to kW
Scripting Module Flow in Valispace
The general flow/steps for the scripting module are shown in the image below. The user creates the new script and adds inputs and outputs to the simulation and writes the respective code in the .m or .py file and then, run the code to get the desired output.
Creating a New Script
Once you enable the “Scripting Module” in the beta features, the scripting module icon (1) appears on the modules column. You can create a new script within the module by clicking on the “+ Script” (2). Upon clicking on this option, a new dialogue box appears where the user can input the name of the new script and select which engine they would like to use (3) i.e python or Octave (MATLAB compatible).