Hopsan
|
When you have finished a component and/or model and you are satisfied with the simulation results you can save you model and some of the simulation results as a test model. You can later run this model again and automatically compare the simulation results. This is very important if you want to make sure that your component and models do not change their behaviour when new versions of Hopsan are released. Remember that if you want to make new changes (that affect simulation results) in the modeled component, your validation data must be recreated.
The HopsanCLI can automatically create a validation data set based on all scopes in your model. If no scopes are available, no data set will be created.
This is an example HVC File. Note that you can have multiple <validation> and <variable> tags to perform multiple tests from the same configuration file.
<?xml version="1.0" encoding="UTF-8"?> <hopsanvalidationconfiguration hvcversion="0.2"> <validation hopsancliversion="0.6.x_r6964" time="141140" date="20140430" hopsancoreversion="0.6.x_r6964"> <!--Optional path to model file, if not specified the same name (excluding suffix) and path as this file will be used--> <modelfile>../Example Models/Position Servo.hmf</modelfile> <!--<parameterset>Not yet supported!</parameterset>--> <!--Optional path to Hopsan validation data file, if not specified the same name (excluding suffix) and path as this file will be used--> <hvdfile>Position Servo.hvd</hvdfile> <!-- The name attribute contains the full name including subsystem hierarchy. Ex: System$Subsystem$Component#Port#Variable --> <variable name="Position_Servo$Position_Sensor#out#Value"> <!--The time column in the hvd file for this variable. Column indexing begins at 0--> <timecolumn>0</timecolumn> <!--The data column in the hvd file for this variable. Column indexing begins at 0--> <column>1</column> <!--Tolerance, allowed deviation 0.01==1%--> <tolerance>0.01</tolerance> </variable> <variable name="Position_Servo$Step#out#Value"> <timecolumn>0</timecolumn> <column>2</column> <tolerance>0.01</tolerance> </variable> <variable name="Position_Servo$4_3_Servo_Valve#xv#Value"> <timecolumn>0</timecolumn> <column>3</column> <tolerance>0.01</tolerance> </variable> <variable name="Position_Servo$Pressure_Relief_Valve#xv#Value"> <timecolumn>0</timecolumn> <column>4</column> <tolerance>0.01</tolerance> </variable> </validation> </hopsanvalidationconfiguration>