Setting Arguments and Expressions

You can use STK's Analysis Workbench capability by creating a Custom Inline Script component for the following components: vector, axes, point, and scalar calculation.

The following table provides information for setting inline script values for available Custom Inline Script components. See the notes below the table for additional information.

Component Type Inline Script Values
Vector Supply the X, Y, and Z value functions and derivative functions to be evaluated, the arguments to be used by the functions, and the dimension of the calculated value. When computed, STK creates a function with the inputs listed under Arguments, returning the values computed by the value and derivative functions.
Axes Supply the EulerA, EulerB, and EulerC value functions to be evaluated and the arguments to be used by the functions. When computed, STK creates a function with the inputs listed under Arguments, returning the values computed by the value and derivative functions.
Point Supply the X, Y, and Z value functions and derivative functions to be evaluated and the arguments to be used by the functions. When computed, STK creates a function with the inputs listed under Arguments, returning the values computed by the value and derivative functions.
Scalar Calculation

Supply a value function and derivative function to be evaluated, the arguments to be used by the functions, and the dimension of the calculated value. When computed, STK creates a function with the inputs listed under Arguments, returning the values computed by the value function and derivative function.

Notes on using custom inline scripts

  • For inline scripts, you must use internal units for the arguments of each function; Analysis Workbench does not allow you to specify units for its computations. You can set the dimension (distance, time, etc.) for arguments as applicable. For example, if you select the dimension Distance for argument X, then Analysis Workbench assumes X has units of meters, and a Value Function of 2*X would produce a result in units of meters. A Derivative Function for X would produce results in m/s, as seconds is the internal units for time. Refer to this list of dimensions and internal units.

  • When using inline scripts, you may see error messages from the scripts when there are errors in the functions that you defined. Most issues will be caught when you create a Custom Inline Script component using the UI or Connect, enabling you to fix any issues.

  • You must define all value functions and at least one argument when using the Custom Inline Script component.

  • There must be at least as many arguments defined as are specified in the functions.

  • For example, if the function is defined as

    x1+(T*x2), where T represents Time in the functions,

    then there must be at least two arguments defined, x1 and x2.

  • For an axes, vector, or point custom inline script component, you must define all or none (not some) derivative functions.
  • The multiline textbox is only for continuing one line expressions on another line. It is not for executing multiple statements with semicolons and multiple expressions. If you write multiple statements with semicolons at the end, they will not execute as expected.