Main Content

param.State

Specify tuning parameters for model states

Description

A state parameter is a numeric parameter, representing a state associated with a model, that can take any value in a specified interval. The parameter can take scalar or matrix values.

You use state parameters to estimate or specify the initial state values of a model.

Creation

Create a state parameter object in one of the following ways.

Description

s = param.State creates an unnamed scalar state with its Value property set to 0. The remaining properties of the object have default values.

s = param.State(statepath) creates a scalar state, sets the Name property to statepath, and sets the Value property to 0.

s = param.State(statepath,value) creates a state, sets the Name property to statepath, and sets the Value property to value.

To change a property value after you create the object, use dot notation. For example:

s = param.State;
s.dxFree = false;

Properties

expand all

Indication of whether parameter is tunable, specified as numeric or logical 1 (true) or 0 (false) or an array of such values.

For scalar parameters:

  • Free = 1 (true) means the parameter is tunable during optimization.

  • Free = 0 (false) means the parameter value is fixed during optimization.

For array-valued parameters, the dimensions of Free match the dimensions of the Value property. For array-valued parameters, you can:

  • Fix individual array elements. For example, p.Free = [1 0; 0 1] fixes the off-diagonal elements of a 2-by-2 matrix-valued parameter during optimization but allows the diagonal elements to be tuned. Similarly, p.Free([2 3]) = 0 fixes the second and third elements in p.

  • Use scalar expansion to fix all array elements. For example, p.Free = false fixes the values of all elements of p during optimization.

Parameter units and labels, specified as a structure array with fields Label and Unit. The array dimension must match the dimension of the Value property.

Use this property to store parameter units and labels that describe the parameter. For example, p.Info(1,1).Unit = 'N/m'; or p.Info(1,1).Label = 'spring constant'.

The default value for both the Label and Unit fields is ''.

Upper bound for the state parameter value, specified as a numeric scalar or Inf.

The dimension of this property must match the dimension of the Value property.

For matrix-valued state parameters, you can:

  • Specify upper bounds on individual matrix elements. For example, p.Maximum([1 4]) = 5.

  • Use scalar expansion to set the upper bound for all matrix elements. For example p.Maximum = 5.

Lower bound for the state parameter value, specified as a numeric scalar or –Inf.

The dimension of this property must match the dimension of the Value property.

For matrix-valued state parameters, you can:

  • Specify lower bounds on individual matrix elements. For example p.Minimum([1 4]) = -5.

  • Use scalar expansion to set the lower bound for all matrix elements. For example p.Minimum = -5.

This property is read-only.

Parameter name, specified as a character vector or string scalar and stored as a character vector. Set Name at object creation.

Scaling factor used to normalize the state parameter value, specified as a numeric scalar.

The dimension of this property must match the dimension of the Value property.

For matrix-valued state parameters, you can:

  • Specify scaling for individual matrix elements. For example p.Scale([1 4]) = 1.

  • Use scalar expansion to set the scaling for all matrix elements. For example p.Scale = 1.

State parameter value, specified as a scalar or a matrix.

The dimension of this property is set when you create the object.

State parameter derivative (with respect to time) is tunable, specified as a numeric or logical 1 (true) or 0 (false).

Set the dxFree property to true (1) for tunable state parameter derivatives and false (0) for state parameter derivatives you do not want to tune (fixed).

The dimension of this property must match the dimension of the Value property.

For matrix-valued state parameter derivatives, you can:

  • Fix individual matrix elements. For example p.dxFree = [true false; false true] or p.dxFree([2 3]) = false.

  • Use scalar expansion to fix all matrix elements. For example p.dxFree = false.

State parameter derivative (with respect to time) value, specified as a scalar.

The dimension of this property must match the dimension of the Value property.

Examples

collapse all

modelname = 'sdoAircraft';
load_system(modelname);
blockpath = {'sdoAircraft/Actuator Model', ...
 'sdoAircraft/Controller/Proportional plus integral compensator'};

s = sdo.getStateFromModel(modelname,blockpath);

Version History

Introduced in R2012b