Contents

Incorporating Workspace Data into a Six Degrees of Freedom Model

This example shows a Simulink model that characterizes six degree of freedom motion using Euler Angles and Quaternions for the equations of motion.

The Simulink model makes use of 3 variables from the MATLAB base workspace to determine the roll, pitch, and yaw inputs for the model. The timing values for these inputs are stored in base workspace matrices called 'pitchtimearray', 'rolltimearray', and 'yawtimearray'.

In order to run this model, timing information must be mapped from the base workspace matrices and provided to the Simulink model.

Mapping Base Workspace Data to Simulink Inputs

A Simulink element is used to execute the following model for every main test iteration:

systemtest6dof

In order to map timing data from the base workspace to Simulink model inputs, a combination of Test Vectors and Test Variables are used to index into the base workspace matrices every main test iteration.

Three Test Vectors are defined as a vector of indices for the roll, pitch, and yaw matrices. These Test Vectors are then used by Test Variables to map the timing values used by the model for each main test iteration.

As each main test iteration is executed, the body rates from the simulation are mapped to a Test Variable.

Opening the Test

Use the systemtest function to open the test.

systemtest('SixDOF.test')

Open the example in the SystemTest desktop.Open the example in the SystemTest desktop.

Was this topic helpful?