Main Content

param.State class

Package: param
Superclasses: param.Continuous

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.

Construction

You obtain a state parameter using the sdo.getStateFromModel function.

For example, use

s = sdo.getStateFromModel('sdoMassSpringDamper','Position');

to obtain the state parameter of the Position block of the sdoMassSpringDamper Simulink® model.

Properties

Free

Flag specifying whether the state parameter is tunable or not.

Set the Free property to true (1) for tunable state parameters and false (0) for state parameters you do not want to tune, to designate them as fixed.

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

For matrix-valued state parameters, you can:

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

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

Default: true (1)

Info

Structure array specifying state parameter units and labels.

The structure has Label and Unit fields.

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

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

Default: '' for both Label and Unit fields

Maximum

Upper bound for the state parameter value.

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.

Default: Inf

Minimum

Lower bound for the state parameter value.

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.

Default: –Inf

Name

State parameter name.

This read-only property is set at object construction.

Default: ''

Scale

Scaling factor used to normalize the state parameter value.

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.

Default: 1

Value

State parameter value.

You can specify the value as either a scalar or a matrix.

The dimension of this property is set at object construction.

Default: 0

dxFree

Flag specifying whether the state parameter derivative (with respect to time) is tunable or not.

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.

Default: true (1)

dxValue

State parameter derivative (with respect to time) value.

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

Default: 0

Methods

Inherited Methods

isrealDetermine if parameter value, minimum, and maximum are real

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects.

Examples

collapse all

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

s = sdo.getStateFromModel(modelname,blockpath);