update

Purpose

Updates the internal state using the state-update equation

Syntax

system.update(u)
xn = system.update(u)
[xn, y] = system.update(u)

Description

This function evaluates the system's state-update equation and updates the internal state of the system.

By calling system.update(u) this function updates the internal state of system by evaluating the state-update equation. The updated state can then be retrieved by calling x = system.getStates().

By calling [xn, y] = system.update(u) this function also returns the updated state as the first output, and the result of the output equation as the second output. Note that the internal system's state is still updated as described above.

Input Arguments

u

Vector of system's inputs

Class: double

Output Arguments

xn

Updated state vector

Class: double

y

Vector of outputs

Class: double

Example(s)

Example 1

Define a 1D LTI system ../../../../../fig/mpt/modules/ui/@LTISystem/update1.png, ../../../../../fig/mpt/modules/ui/@LTISystem/update2.png
sys = LTISystem('A', 0.9, 'B', 1, 'C', 0.5)
LTISystem with 1 state, 1 input, 1 output
Set the system's internal state to ../../../../../fig/mpt/modules/ui/@LTISystem/update3.png.
sys.initialize(1);
Update the system's state using ../../../../../fig/mpt/modules/ui/@LTISystem/update4.png.
sys.update(0.2);
Retrieve the internal state (should be equal to ../../../../../fig/mpt/modules/ui/@LTISystem/update5.png).
sys.getStates()
ans =

                       1.1

Update the system's state using ../../../../../fig/mpt/modules/ui/@LTISystem/update6.png.
sys.update(0)
ans =

                      0.99

Retrieve the internal state (should be equal to ../../../../../fig/mpt/modules/ui/@LTISystem/update7.png).
sys.getStates()
ans =

                      0.99

Update the internal state using ../../../../../fig/mpt/modules/ui/@LTISystem/update8.png and retrieve the updated state and the associated output
[xn, y] = sys.update(-1)
xn =

                    -0.109


y =

                     0.495


© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk