Main Content

simscape.op.Target

Variable initialization target object

Description

Target objects contain data necessary for model initialization. Each Target object consists of a variable value, unit, and initialization priority. Target objects are part of the data tree hierarchy of an OperatingPoint object. Use Target objects to add or manipulate initialization data saved in the OperatingPoint object. You can then use the data to initialize another model, or the same model before another simulation run.

Creation

Description

example

t = simscape.op.Target() creates a Target object with default properties.

example

t = simscape.op.Target(simscapeValue) uses a simscape.Value object to set the Value property of the Target object. It creates a Target object with the Value property set to the numeric value and unit of the simscape.Value object.

example

t = simscape.op.Target(simscapeValue,priority) creates a Target object with the Value property set to the numeric value and unit of the simscape.Value object and the Priority property set to the provided variable initialization priority.

example

t = simscape.op.Target(value), where value is a numeric array, creates a Target object with the Value property set to provided numeric value with the unit of '1'.

example

t = simscape.op.Target(value,unit) creates a Target object with the Value property set to a simscape.Value object with the provided numeric value and with unit set to the specified unit expression.

example

t = simscape.op.Target(value,unit,priority) creates a Target object with the Value property set to a simscape.Value object with the provided numeric value and with unit set to the specified unit expression, and the Priority property set to the provided variable initialization priority.

Input Arguments

expand all

Value with unit, specified as a simscape.Value object. A simscape.Value object consists of an array of numeric values, specified as a scalar, vector, or matrix, and an associated unit of measure. For more information, see simscape.Value.

Array of numeric values, specified as a scalar, vector, or matrix. The array cannot contain complex values and cannot be sparse.

Example: 1.5

Data Types: double

Physical unit expression, specified as a character vector or a nonmissing string scalar. The string or character vector expression can consist of valid physical unit names, numbers, math operators, such as +, -, *, /, and ^, and parentheses to specify the order of operations. Physical unit of 1 indicates a unitless simscape.Value object.

Example: 'm/s^2'

Variable initialization priority, specified as 'High', 'Low', or 'None'.

Data Types: char | string

Properties

expand all

Variable initialization target numeric value and unit, specified as a simscape.Value object. A simscape.Value object consists of an array of numeric values, specified as a scalar, vector, or matrix, and an associated unit of measure. For more information, see simscape.Value.

Example: 1.5 : 'V'

Variable initialization priority, specified as 'High', 'Low', or 'None'.

Data Types: char | string

Descriptive name of target variable, specified as a character vector or string scalar. If you create an operating point by extracting data from log or model, the extraction algorithms populate this target property with the user-friendly description of the variable. However, you do not have to set this property to be able to use the target for model initialization.

Data Types: char | string

Examples

collapse all

Create an empty OperatingPoint object named op:

op = simscape.op.OperatingPoint
op = 

  OperatingPoint with no children.

Create a Target object named t, consisting of a variable value, unit, and initialization priority:

 t = simscape.op.Target(1.5,'V','High')
t = 

  Target with fields:

        Value: 1.5000 : V
     Priority: High
   Attributes: containers.Map
  Description: 

Add the target t to the operating point op by assigning this target to the variable named v0:

op = set(op,'v0',t)
op = 
  OperatingPoint with children:

  Targets:

   ChildId   Value  Unit  Priority
   _______  ______  ____  ________

   'v0'     1.5000  'V'     'High'

You can create other Target objects or OperatingPoint objects and add them as children to the operating point op.

Using simscape.Value objects for programmatic model construction and manipulation provides the convenience of specifying both the numeric value and the unit at the same time.

Create a simscape.Value object to represent a value with unit:

V1 = simscape.Value(1.5,'V')
V1 = 

    1.5000 : V

Create an empty OperatingPoint object named op:

op = simscape.op.OperatingPoint
op = 

  OperatingPoint with no children.

Use the simscape.Value object V1 to create a Target object named t, with high initialization priority:

 t = simscape.op.Target(V1,'High')
t = 

  Target with fields:

        Value: 1.5000 : V
     Priority: High
   Attributes: containers.Map
  Description:

Add the target t to the operating point op by assigning this target to the variable named v0:

op = set(op, 'v0', t)
op = 
  OperatingPoint with children:

  Targets:

   ChildId   Value  Unit  Priority
   _______  ______  ____  ________

   'v0'     1.5000  'V'     'High'

Version History

Introduced in R2017b