mpt_demo_lti3

Purpose

Demonstrates simulation of the closed-loop system

Syntax

mpt_demo_lti3

Description

Demonstrates simulation of the closed-loop system.

Example(s)

Example 1

Define the prediction model ../../../fig/mpt/demos/mpt_demo_lti31.png, ../../../fig/mpt/demos/mpt_demo_lti32.png
A = [1 1; 0 1]; B = [1; 0.5]; C = [1 0];

 lti = LTISystem('A', A, 'B', B, 'C', C); 
 Define the MPC controller with horizon 5.
 ctrl = MPCController(lti, 5); 
 Define the closed-loop system 
 cl = ClosedLoop(ctrl, lti); 
 Simulate the closed loop from a given initial condition 
 data = cl.simulate([-4;0], 10) 
data = 

       X: [2x11 double]
       U: [1000000 -1000000 -1000000 1000000 1000000 -1000000 -1000000 1000000 1000000 -1000000]
       Y: [-4 999996 499996 -500004 -4 999996 499996 -500004 -4 999996]
    cost: [0 0 0 0 0 0 0 0 0 0]

See Also

mpt_demo_lti1, mpt_demo_lti2, mpt_demo_lti4, mpt_demo_lti5


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