This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: EE263 S. Lall 2009.11.11.01 edited Homework 6 Solutions Due Thursday 11/19 1. Toeplitz Matrices 0710 (a) Write a routine sys_toeplitz.m which computes the Toeplitz matrix corresponding to a discrete-time linear dynamical system. In particular, recall that, if x ( t + 1) = Ax ( t ) + Bu ( t ) y ( t ) = Cx ( t ) + Du ( t ) and the initial condition x (0) = 0, then y (0) y (1) y (2) . . . y ( N ) = T u (0) u (1) u (2) . . . u ( N ) where T is the Toeplitz matrix T = D CB D CAB CB D . . . . . . CA N- 1 B CA N- 2 B ... CB D We will use this matrix to find minimum-norm controllers for linear systems. Since we often are only concerned about the trajectory at particular times, it is useful to construct only those rows and columns of T necessary. The function should take arguments of the form T=sys_toeplitz(A,B,C,D,out_times,in_times); where out_times and in_times are row vectors. For example, if out_times=[1,2,4]; in_times=[0:10] then sys_toeplitz should return just the 3 11 block matrix T so that y (1) y (2) y (4) = T u (0) u (1) . . . u (10) (b) Suppose we have a hovercraft moving in two-dimensions, with unit mass, acted upon by input forces u 1 ( t ) and u 2 ( t ) through the center of mass in the x and y directions. Let u ( t ) = bracketleftbigg u 1 ( t ) u 2 ( t ) bracketrightbigg and let the position of the vehicle at time t be q ( t ) R 2 . Construct a linear dynamical system model in continuous time, and its discretization. Use sampling period h = 1. Choose C and D so that y ( t ) R 2 is the position of the vehicle at time t . (c) Simulate the system on time interval [0 ,N ] with N = 50, with input u ( t ) = bracketleftbigg sin( t/ 10) cos( t/ 10) bracketrightbigg To do this, its easiest to just use a for loop in Matlab instead of using lsim . Plot the output position in the plane as a function of time. 1 EE263 S. Lall 2009.11.11.01 edited (d) Now construct the vector of inputs u seq = u (0) u (1) u (2) . . . u ( N ) It may be useful to use the reshape command in Matlab. Using your sys_toeplitz routine, construct T mapping u seq to y seq given by y seq = y (0) y (1) y (2) . . . y ( N ) and hence construct y seq . Verify that y seq is equal to the output trajectory from part (c). Solution. (a) Some code is function T=sys_toeplitz(A,B,C,D,out_times,in_times); % SYS_TOEPLITZ computes toeplitz matrices for a discrete-time LDS % % T=sys_toeplitz(A,B,C,D,out_times,in_times); % % A,B,C,D specify a discrete-time state-space realization % % out_times and in_times are row vectors % % for example, if out_times is [1,2,4] and in_times is [0:10] % then T is the matrix which maps % % [u(0); u(1); ... u(10)] to [y(1); y(2); y(4)]...
View Full Document
This note was uploaded on 08/23/2010 for the course EE 263 taught by Professor Boyd,s during the Fall '08 term at Stanford.
- Fall '08