Creating State Objects

www.kxcad.net Home > CAE Software Index > MATLAB Index >


Your Ad Here

What is a State Object

The @State object is similar to the @Parameter object. One @State object corresponds to each Simulink block with states in the model.

Constructor

The syntax to create a state object is

h = ParameterEstimator.State('block');
h = ParameterEstimator.State('block', Value);
h = ParameterEstimator.State('block', Value, Minimum, 
    Maximum);

In the first case, the state vector is initialized from the model containing the block. In the other cases, block does not need to exist in the workspace at the time of object creation. However, it is required at estimation time.

Properties of State Objects

Descriptions of some important properties of state objects are given in the following table.

State Object Properties

Property

Description

Block

Name of the Simulink block whose states are defined by this object.

Dimensions

Scalar value to store the number of states of the relevant block.

Value

Column vector to store the value of the state for the block specified by this object. The length of this vector should be consistent with the Dimensions property.

Estimated

A Boolean array of the same size as that of Value. Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of Value is as follows:

  • The elements of Value are estimated if the corresponding elements in Estimate are set to true. The result is stored in the Value property.

  • The elements of Value are not estimated if the corresponding elements in Estimated are set to false. However, these elements are used to reset the corresponding states during estimations.

    This property is set to false by default, meaning that the state value is not estimated.

InitialGuess

Separate properties are required to hold the initial and current values of the states. So, when the InitialGuess property is initialized with a value, both it and the Value property are assigned the same value.

Depending on the value of the elements of the Estimated property, the behavior of the corresponding elements of InitialGuess is as follows:

  • If any element in Estimated is set to true, then the corresponding element of InitialGuess is used to initialize the state during estimations.

  • If any element in Estimated is set to false, then the corresponding element of InitialGuess is not used in any way.

Minimum, Maximum

State vector range.

TypicalValue

The typical values of the states. This property is used in estimations for scaling purposes. The default value is 1.

Ts

Sampling time of discrete blocks. Set to zero for continuous blocks. This property is read-only and is currently used for information only.

Domain

String to hold the physical domain of the block. Used for SimMechanics or SimPowerSystems blocks with states.

Example: F14 Model

To create a state object for the f14/Actuator Model block in the f14 model, use

st1 = ParameterEstimator.State(gcb)

MATLAB returns

(1) State data for f14/Actuator Model block:

    The block has 1 continuous state(s).

           State value : 0
         Initial guess : 0
             Estimated : false

Modifying Properties

After a state object is created, you can modify its properties using this syntax:

ic1.Estimated = true; % Estimate this state

Most of the properties, for example, Estimated and TypicalValue, support scalar expansion with respect to the size of Value.

Using Class Methods

Description of two important methods are given next:

  


© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments

Your Ad Here