Attitude Simulator Plugin Points

Attitude Simulator is a tool that is available for a satellite object. It enables you to incorporate your own torque models (e.g., gravity gradient, aerodynamic, etc.) and momentum biases and to implement customized control laws (including static and dynamic feedback, dynamic compensators, etc.) when generating attitude trajectories.

The tool numerically integrates an attitude state (represented by a quaternion) and its body angular velocity components as well as other optional variables. You can use Attitude Simulator plugin scripts to supply these variables and customize computations during numerical integration.

Script source file location

The script source files must be located in one of the following directories:

  • <STK install folder>/STKData/Scripting/Attitude
  • <STK user area>/Config/Scripting/Attitude
  • <STK all users area>/STKData/Scripting/Attitude
  • <scenario folder>/Scripting/Attitude

where <STK install folder> refers to the STK installation directory, <STK user area> refers to the STK user's directory, <STK all users area> refers to the directory that contains STK application data for all users, and <scenario folder> refers to the scenario directory.

Do not place your scripts directly in the scenario folder. Doing so may cause errors with your script.

Outputs

The Attitude Simulator plugin point has the following outputs:

Torque descriptors

Keyword
Value
ArgumentType Output
Type Parameter
Name Torque
BasicType Vector

Torque is a three-element vector of double precision and has units of Newton-meters. The Torque output is used during the attitude simulation when integrating attitude dynamics. You can use multiple scripts within the same simulation. All the Torque outputs from all scripts are added together when integrating the attitude dynamics. STK expects torque to be in the vehicle's body frame.

Parameter descriptors

Keyword
Value
ArgumentType Output
Type Parameter
Name Name of the parameter when accessed by this or other scripts
BasicType Double, Int, String, Vector, Quat or Matrix
Size String containing numberOfRows numberOfColumns

The Parameter output is used to share information in the current script with other plugin scripts. Other scripts can request this script's output as an input. The parameter can be a decimal (Double), integer (Int), String, Vector (three-element Double), Quat (four-element Double), or Matrix. If the BasicType is Matrix, then a 3x3 matrix is assumed , but you can specify other sizes with the Size keyword. The value of Size is a String containing two integers separated by a space; this represents the number of rows and the number of columns in the matrix.

Integrated parameter descriptors

Keyword
Value
ArgumentType Output
Type Parameter
Name Name of the parameter when accessed by this or other scripts
BasicType Double, Vector, or Quat
IntegralName Name given to the integral of this parameter
InitialCondition String containing initial values of the integrated parameter separated by spaces

An integrated parameter is a parameter that the Attitude Simulator will add to its integrator state to be integrated along with the attitude and attitude rate. The descriptor actually creates two parameters that you can access as inputs: itself (accessed by Name) and its integral (accessed by IntegralName). The InitialCondition keyword is optional; if not given, zeros are used. MomentumBias is a special value for IntegralName that enables you to integrate internal angular momentum due to momentum bias devices.

Several parameters, each with different names, can all affect the same integrated state by specifying the same IntegralName. In such cases, the values of all parameters with the same IntegralName are added together to create the derivative information.

Inputs

The Attitude Simulator plugin point has the following inputs:

Attitude state descriptors

Keyword
Value
ArgumentType Input
Type Attitude
Derivative Yes or No
RefName Name of axes: the attitude state will be transformed into these Axes
RefSource STK path of the object that owns the RefName axes

The attitude state refers to the attitude being integrated within the simulator. The Derivative keyword is optional; the default is No, which means that the input is a four-element quaternion of double precision. If the value of Derivative is Yes, the input is seven elements with double precision. The first four elements are the quaternion, and the last three are the angular velocity in units of radians per second. The angular velocity is always provided in body axes components, but measures the rate of orientation change between the body axes and the reference axes specified by RefName. The RefName keyword is optional. If not specified, the vehicle's central body inertial axes are used. The RefSource keyword is optional. If not specified, it refers to the attitude simulator vehicle.

Parameter descriptors

Keyword
Value
ArgumentType Input
Type Parameter
Name Name of the parameter when accessed by this or other scripts
Source The filename of the script (e.g., "VB_AttSimInit.vbs") where the Parameter Name has been declared to be an Output

The Parameter input is used to access information in the current script from another script's Output Parameter.

Integral parameter descriptors

Keyword
Value
ArgumentType Input
Type Integral
Name IntegralName of an Integrated Parameter Output

The Integral Parameter input is used to access the integrated parameter from the attitude simulator state. Note that the name of the input must be the same as the IntegralName of some script's integrated parameter output.

Inertia descriptors

Keyword
Value
ArgumentType Input
Type Inertia
Source STK path for the object associated with the requested inertia

Inertia is a 3x3 matrix of double precision in units of kg-m2.

Mass descriptors

Keyword
Value
ArgumentType Input
Type Mass
Source STK path for the object associated with the requested mass value

Mass is a double precision number in units of kg.

Density descriptors

Keyword
Value
ArgumentType Input
Type Density

The density is a double precision number in units of kg/m3. The attitude simulator enables you to configure the density modeling.

Inputs available from the Vector Geometry Tool

All Vector Geometry Tool inputs are also available for the Attitude Simulator. In addition, those descriptors in the Vector Geometry Tool that use the keywords RefName and RefSource to refer to an Axes object can optionally use the keyword RefType. Rather than specifying the RefName and RefSource to choose the references axes that the input will be transformed into, the script can specify to use RefType with the value Attitude. This designation means that the transformation will use the Attitude Simulator's state as the reference.

In addition, if you are using a visibility argument such that:

  1. the source of the visibility argument is a sensor, and
  2. the sensor is attached to the satellite for which the Attitude Simulator is computing the attitude,

then, if you specify the keyword RefType with the value Attitude, the sensor's attitude will be computed relative to the attitude state information that is being integrated by the Attitude Simulator.

For information on requesting an input from the Vector Geometry Tool, see Vector Geometry Tool Plugin Points.