Sie sind auf Seite 1von 2

ME 481/581

Chapter 8 HW

February 22, 2012

Chapter 8 HW Hints
Problem 1. A mass moving without a force acting on it has constant velocity, and therefore the displacement is a linear function of time, for example x(t) = x0 + vx t y (t) = y0 + vy t in which you are given a table of t and corresponding x and y . Using the data in the table, express this behavior in the format of equation (8.4). You can then use the least-squares solution method shown in my notes. As a hint, what you need to do is to put the data for each direction in a matrix format like Ax = b, where x, the T unknown parameter vector, will be x0 vx . The matrix A may look a little dierent than what weve seen in system ID work, and the known vector b will be composed of the data from the given table. Note that you will perform separate operations for the x and y data, obtaining expressions for x(t) and y (t). It is instructive to make a scatter plot of the numerical values of x vs t, then overlay that with your estimated function x (t). Same thing goes for y . If you eliminate t between the x (t) and y (t) you will get the expression relating the spatial path in the xy plane (not required, but perhaps interesting). Finally, MATLAB can do these ts very easily using library functions, but please do it yourself using the approach of Chapter 8. Some of my results (x initial value and y velocity) are: x0 = 0.2127 vy = 0.5116

Problem 2. Id suggest you pick a transfer function along the lines of G(s) =
2 2 an n or 2 2) s2 + 2n s + n (s + a)(s2 + 2n s + n

where both of these have a DC gain of unity (although unity is certainly not required). Then select values for the parameters (I think underdamped systems are more interesting) and discretize your G(s) with any method you wish. The resulting G(z ) is your actual system. Follow the steps indicated in parts (a), (b), and (c). NOTE: Use normally-distributed random noise for the random input (MATLAB randn). You should select a subset of the random data generated in (a) to t your model. If you wish to compare the behavior of your model and the actual system on the random data, select a dierent subset of data (its never fair to compare o model using the same data used to generate it). Some other issues are: You may also wish to compare the step response of the actual system and your model. You may wish to add some noise to see how that aects the identication. Use the MATLAB function lsim(sys,u,t) to generate all outputs (except for a step). You can add noise either using my quantize() function or by directly making some noise (so to speak) and adding it to the output. NOTE: Its important to thoroughly understand this problemwell be doing this as the rst phase of the transformbased and state-space projects.

MATLAB Function. You are going to be doing enough ID runs (HW and project) that you may wish to write a MATLAB function. I wrote the following (no, Im not putting it online):

ME 481/581

Chapter 8 HW

February 22, 2012

function [G,e] = idlsq(u,y,n,T) % % % % % [G,e] = IDLSQ(u,y,n,T) does a least-square model fit using a nth order model and N input/output datapoints. Vectors u and y are column vectors of input and output, respectively. Scalar n is the desired model order, while T is the sample period in seconds. The returned parameter G is an LTI transfer function model, while "e" is sum-squared error (scalar)

This is not a dicult function to createit has only 14 lines of M-code.

Das könnte Ihnen auch gefallen