Description | Example | Return Message | Group

CalculationTool Scalar Calculation

Define and modify Scalar Calculation components and templates.

Syntax

CalculationTool <ScenarioPath> <ParentObject> {Action} {"Scalar Calculation" | "Scalar CalculationTemplate"} <ComponentName> [{ScalarCalculationType} <TypeParams>]

Related Commands

Description

The "CalculationTool Scalar Calculation" command is used to add, modify and delete Scalar Calculation components and templates.

For a component object the <ParentObject> is a truncated object path or a Central Body path.

For a template the <ParentObject> is an STK class name, and the "Scalar CalculationTemplate" keyword must be entered.

Note: The Scalar Calculation component type is not valid for Star objects.

The following table provides a description of {Action} values and the applicable parameters:

{Action} Parameters Description
Create {ScalarCalculationType} [<TypeParams>] <TypeParams> are optional, except where noted below. If no <TypeParams> are specified, default values are used.
Modify {ScalarCalculationType} <TypeParams> The values <ComponentName> {ScalarCalculationType} must define an existing Scalar Calculation component or template. The {ScalarCalculationType} can not be modified. <TypeParams> are required.
Delete N/A Delete the component or template identified by <ComponentName>

Any or all of the <TypeParams> for an {ScalarCalculationType} can be specified on a command line, except where indicated.

The following table describes each Scalar Calculation type and it's parameters.

{ScalarCalculationType} <TypeParams>
"Angle"
  • InputAngle "<Angle>"
"Average"
  • InputScalar "<CalcScalar>"
  • AccumulationType {Static | CumulativeToCurrent | CumulativeFromCurrent | SlidingWindow}
  • StartOffset <Value>
  • StopOffset <Value>

The StartOffset <Value> and StopOffset <Value> are only used if AccumulationType is SlidingWindow. They are entered in Connect Time units. The StartOffset <Value> must be less than the StopOffset <Value>.

See below for Advanced Option parameters for this component type.

"Constant"
  • Value <Value>
  • Dimension <DimensionName>

The <Value> should be entered in the Scenario units of the specified dimension. Use the ShowUnits command with the GUI option for current Scenario units.

Note: When entering Value <Value> the user must specify a <Value> that is valid for the specified dimension (e.g. Power, etc.)

"Custom Script" {Reload | <CustomOption>}

<CustomOption> can be any or all of:

  • Filename "<FilePath>"
  • Dimension <DimensionName>

Reload is valid for the Modify command only.

Note: Filename <FilePath> option is required when Creating the "Custom Script" Scalar Calculation

"<FilePath>" can be a .m, .pl, .vbs or .dll (PC only) file. The "<FilePath>" value should include a full path. Custom Script files must be located in a hierarchy of pre-determined directories.

For more information see Plugin Script Reference

"Data Element"
  • DataElement "<DataPrvElement>"
  • UseSamples {Yes | No}

Note: The DataElement "<DataPrvElement>" parameter is required when Creating the "Data Element" Scalar Calculation

The DataElement must be from a data provider that has a time element, and does not require additional data. Also, the data provider can not be based on a VGT, Time or Calculation component.

The "<DataPrvElement>" is constructed from the data provider name and the hierarchy to a scalar element, all delimited with hyphens '-' or colons ':'. For example a valid Satellite data element would be: "Attitude YPR-Seq PRY-Pitch" or "Attitude YPR:Seq PRY:Pitch".

Note: Hyphens and colons as delimiters cannot be mixed in a command. If the DataElement contains a hyphen, then the colon must be used as the delimiter. For example "Solar Specular Point:X-Fixed".

Advanced options:

  • SaveOption {UseApplicationPrefs | SaveComputedData | None}

Parameters for Sampling are also valid for this component type. See "Parameters for Sampling" in table below.

Parameters for Interpolation:

  • InterpolationType {Lagrange | Hermite}
  • InterpolationOrder <Order>

<Order> is an integer between 0 and 10000.0

Note: The Data Element Scalar Calculation type is not valid for CentralBody objects, Templates or Comm objects (Antenna, Radar, Receiver, Transmitter).

"Derivative"
  • Scalar "<CalcScalar>"
  • DifferencingTimeStep <Value>

<Value> is entered in Connect Time, and must be between 1e-6 and 99999999999.0

"Elapsed Time"
  • ReferenceTimeInstant "<TimeInstant>"
"File"
  • Filename "<ScalarFile>"
  • Reload
  • StartTime {TimeInstant}
  • OverrideStartTime {Yes | No}

"<ScalarFile>" is a Calculation Scalar Format (*.csc) file.

Note: The Filename "<ScalarFile>" parameter is required when Creating the "File" Scalar Calculation

The Reload parameter is valid for a Modify command only, and should be the only parameter on the command.

For valid {TimeInstant} values see Time Options.

Sending StartTime {TimeInstant} will turn on the OverrideStartTime option.

"Fixed at Time Instant"
  • InputScalar "<CalcScalar>"
  • ReferenceTimeInstant "<TimeInstant>"
"Function(x)"
  • Function {FunctionName}
  • ArgumentXScalar "<CalcScalar>"
  • ArgumentXTimeInstant "<TimeInstant>"
  • ArgumentXUnit <UnitAbbreviation>
  • a <Value>
  • b <Value>
  • c <Value>
  • d <Value>
  • OutputInheritDimension {Yes | No}
  • OutputDimension <DimensionName>
  • OutputUnit <UnitAbbreviation>

All <Value> entries are unitless.

Either ArgumentXScalar "<CalcScalar>" or ArgumentXTimeInstant "<TimeInstant>" should be entered, not both.

Note: The ArgumentXUnit and OutputUnit parameters should be entered only on Modify commands.

Valid values for {FunctionName} and their definitions are:

Abs a*|bx+c|+d
Cos a*Cos(bx+c)+d
Sin a*Sin(bx+c)+d
Exp a*Exp(bx+c)+d
Power10 a*10^(bx+c)+d
Power2 a*2^(bx+c)+d
Power (bx+c)^a+d
Ln a*Ln(bx+c)+d
Log10 a*Log10(bx+c)+d
Log2 a*Log2(bx+c)+d
Erfc a*Erfc(bx+c)+d
Q a*Q(bx+c)+d
Polynomial a+b*x+c*x^2+d*x^3
Inverse a/(bx+c)+d
SquareRoot a*Sqrt(bx+c)+d

The following options are available via Connect only, they are not on the UI.

  • OverflowLimit <Value>

OverflowLimit <Value> must be greater or equal to 1000. This value defines the upper limit for functions that may otherwise continue to infinity.

Parameters for Sampling are also valid for this component type. See "Parameters for Sampling" in table below.

Parameters for Convergence:

  • TimeTolerance <TimeTol>

<TimeTol> is entered in Connect time units, and must be between 1e-13 and 99999999999.0.

"Function(x,y)"
  • Function {Plus | Minus | Multiply | Divide | Linear}
  • ArgumentX "<CalcScalar>"
  • ArgumentXUnit <UnitAbbreviation>
  • ArgumentY "<CalcScalar>"
  • ArgumentYUnit <UnitAbbreviation>
  • CoefficientA <Value>
  • CoefficientB <Value>
  • CoefficientC <Value>
  • OutputInheritDimension {FromX | FromY | No}
  • OutputDimension <DimensionName>
  • OutputUnit <UnitAbbreviation>

All <Value> entries are unitless.

Note: The ArgumentXUnit, ArgumentYUnit and OutputUnit parameters should be entered only on Modify commands.

The function definitions are below, note that not all coefficients (a, b, c) are used in every function:

Plus a*x+b*y
Minus a*x-b*y
Multiply a*x*y
Divide a*x/y
Linear a*x^2+b*x*y+c*y^2
"Integral"
  • InputScalar "<CalcScalar>"
  • ComputeAsAverage {Yes | No}
  • AccumulationType {Static | CumulativeToCurrent | CumulativeFromCurrent | SlidingWindow}
  • StartOffset <Value>
  • StopOffset <Value>

The StartOffset <Value> and StopOffset <Value> are only used if AccumulationType is SlidingWindow. They are entered in Connect Time units. The StartOffset <Value> must be less than the StopOffset <Value>.

See below for Advanced Option parameters for this component type.

"Plugin"
  • PluginName "<PluginName>"
  • Reset

The Reset parameter is valid for a Modify command only.

Note: The PluginName "<PluginName>" parameter is required when Creating the "Plugin" Scalar Calculation

Note: The "Plugin" Scalar Calculation type is not valid for Templates.

"Standard Deviation"
  • InputScalar "<CalcScalar>"
  • AccumulationType {Static | CumulativeToCurrent | CumulativeFromCurrent | SlidingWindow}
  • StartOffset <Value>
  • StopOffset <Value>

The StartOffset <Value> and StopOffset <Value> are only used if AccumulationType is SlidingWindow. They are entered in Connect Time units. The StartOffset <Value> must be less than the StopOffset <Value>.

See below for Advanced Option parameters for this component type.

"Vector Magnitude"
  • InputVector "<Vector>"

For details on the format of a reference component (e.g. "<CalcScalar>", "<TimeInstant>", etc) see Component Specification.

The following table describes Advanced Option parameters for "Average", "Integral", and "Standard Deviation" component types.

Advanced options:
  • SaveOption {UseApplicationPrefs | SaveComputedData | None}
  • SetTimeLimits {UseApplicationPrefs | Local}
  • TimeLimits "<IntervalOrIntervalList>"

If SetTimeLimits is set to Local then the time interval or interval list specified by the TimeLimits parameter will be used. The "<IntervalOrIntervalList>" should include the time component type, e.g. "Satellite/Sat1 EphemerisTimeSpan Interval"

Parameters for Sampling:
  • SamplingType {FixedStep | RelativeTolerance | CurvatureTolerance}

Parameters for SamplingType FixedStep:

  • TimeStep <TimeStep>

Parameters for SamplingType RelativeTolerance:

  • MinimumTimeStep <MinStep>
  • MaximumTimeStep <MaxStep>
  • StepAtBoundaries <StepBound>
  • SamplingRelativeTolerance <RelTol>
  • SamplingAbsoluteTolerance <AbsTol>

Parameters for SamplingType CurvatureTolerance:

  • MinimumTimeStep <MinStep>
  • MaximumTimeStep <MaxStep>
  • StepAtBoundaries <StepBound>
  • SamplingRelativeTolerance <RelTol>
  • SamplingAbsoluteTolerance <AbsTol>
  • CurvatureTolerance <CurveTol>

<TimeStep>, <StepBound>, <MinStep> and <MaxStep> are entered in Connect time units and must be between 1e-13 and 99999999999.0.

<RelTol>, and <CurveTol> must be between 1e-13 and 1.0

<AbsTol> must be greater or equal to 1e-13

Parameters for Interpolation:

Parameters for Interpolation:

  • InterpolationType {Lagrange | Hermite}
  • InterpolationOrder <Order>

<Order> is an integer between 0 and 10000.0

Parameters for Integral:

Parameters for Integral:

  • IntegralType {AdaptiveLobatto | Simpson | Trapezoidal}
  • MaxIterations <MaxIter>
  • IntegralTolerance <Tolerance>

<MaxIter> is an integer between 1 and 10000

<Tolerance> must be greater or equal to 1e-13

  • KeepConstantOutsideTimeLimits {Yes | No}

Example

To create and modify a "Function(x,y)" Scalar Calculation component:

CalculationTool * Satellite/ScenTestSat Create "Scalar Calculation" SatScalar11 "Function(x,y)"

CalculationTool * Satellite/ScenTestSat Modify "Scalar Calculation" SatScalar11 "Function(x,y)" ArgumentY "Satellite/ScenTestSat ElapsedTimeFromStop Scalar Calculation" CoefficientA 123.0 Function Divide

CalculationTool * Satellite/ScenTestSat Modify "Scalar Calculation" SatScalar11 "Function(x,y)" OutputInheritDimension FromY OutputUnit min

To create a "Data Element" Scalar Calculation component:

CalculationTool * Satellite/ScenTestSat Create "Scalar Calculation" SatScalar4 "Data Element" DataElement "Attitude YPR-Seq PRY-Pitch"

To create and modify a "Vector Magnitude" Scalar Calculation Template:

CalculationTool * Satellite Create "Scalar CalculationTemplate" SatScalarT1 "Vector Magnitude"

CalculationTool * Satellite Modify "Scalar CalculationTemplate" SatScalarT1 "Vector Magnitude" InputVector "Satellite Velocity Vector"

To create "Constant" Scalar Calculation component that specifies a constant Date value:

CalculationTool * Satellite/ScenTestSat Modify "Scalar Calculation" SatScalar3 "Constant" Value "17 Oct 2012 16:43:00.00" Dimension Date

To create and modify an "Integral" Scalar Calculation:

CalculationTool * Satellite/ScenTestSat Create "Scalar Calculation" SatScalar11 "Integral"

CalculationTool * Satellite/ScenTestSat Modify "Scalar Calculation" SatScalar11 "Integral" SetTimeLimits Local TimeLimits "Satellite/ScenTestSat LightingIntervals.Sunlight Interval List"

CalculationTool * Satellite/ScenTestSat Modify "Scalar Calculation" SatScalar11 "Integral" AccumulationType SlidingWindow

To create "File" Scalar Calculation component, specifying a time to override the start time in the file:

CalculationTool * Satellite/ScenTestSat Create "Scalar Calculation" SatFile38 "File" FileName "C:\stk\User\stkData\ScalarTest72.csc" StartTime "17 Oct 2012 16:43:00.00"

ReturnMessage

If activated, Connect returns an acknowledgement message.

Group Membership

This command belongs to the following group(s):

Area Targets

Comm

Facilities, Places & Targets

Line Targets

Radar

Scenarios

Sensors

Stars & Planets

Object Tools

Vehicles

VO

VO Objects

Version

11

STK Programming Interface 11.0.1