EE 5322 Intelligent Control Systems

Homework for Spring 2007

Updated: Wednesday, April 18, 2007

·  Some homework assignments refer to Lewis, Optimal Estimation, 1986, Wiley.

·  For full credit, show all work.

·  Some problems require hand calculations. In those cases, do not use MATLAB except to check your answers.


EE 5322 Homework 1

Recursive Estimation

1. Sample Mean and Variance

a. Write a MATLAB program to recursively compute the sample mean and the sample variance.

b. About 200 points of data for a NASDAQ stock are given in the hwk data. Use your program to recursively compute the sample mean and variance of this data set. Plot the stock points given and the sample mean on the same graph. Also, plot the sample variance on a separate graph.

2. Recursive Maximum Likelihood Estimation

a. Write a MATLAB program to recursively compute the ML estimate using eqs (1.4-7),

(1.4-9). You can use MATLAB function lqe if you like.

b. Use your program to solve the following problem.

A polynomial-fit measurement system is given by

where the state contains the unknown coefficients. Use your program to estimate the approximating coefficients for the CSCO stock data. Take the measurement noise as .

Plot the estimates versus k.

Plot the stock data and the polynomial estimate for it on the same graph.


EE 5322 Homework 2

Discrete Time Simulation, Observers, Kalman Filter

1. Discrete-Time System.

A discrete time system is given by

,

Write a MATLAB m file to simulate the system, i.e. to compute for a given input , initial condition , and range of the time index k= 1,2,…,N.

a. Simulate the system

for equal to the unit step and =0. Plot vs. k for 300 time samples.

Find the period and percent overshoot. Find the poles.

b. Simulate the same system but now add process noise so that

.

Take the noise as uniformly distributed between 0 and 0.2. Use MATLAB function rand. Plot vs. k for 300 time samples.

2. DT Observer

Write a MATLAB m file to simulate a DT system plus a DT observer running at the same time.

a.  Design an observer for the system

, =0

In eqs (2.1-6), (2.1-7) in the book use . Find the observer gain L and write down the observer equation.

b. Simulate the system with observer for the system using equal to the unit step and =0. Use initial estimates of . Plot the states and their estimates on the same graphs. i.e. on one graph, and on another graph. Use 300 samples.

3. DT Kalman Filter

Write a MATLAB m file to simulate a DT system

plus DT Kalman Filter.

Simulate the optimal time-varying DT Kalman Filter for the system

,

.

Take the process noise as a normal 2-vector (MATLAB function randn) with each component having zero mean and variance 0.1. Take measurement noise as normal (0,0.1). Use equal to the unit step and =0.

Plot the states and their estimates on the same graphs. i.e. on one graph, and on another graph.


EE 5322 Homework 3

Mobile Robot Control & Potential Fields

1.  Potential Field. Use MATLAB to make a 3-D plot of the potential fields described below. You will need to use plot commands and maybe the mesh function. The work area is a square from (0,0) to (10,10) in the (x,y) plane. The goal is at (10,10). There are obstacles at (3,3) and (6,5). Use a repulsive force of for each obstacle, with r the vector to the obstacle. For the target use an attractive force of in the direction r, with r the vector to the target. Adjust the gains to get a decent plot. Plot the sum of the three force fields in 3-D.

2.  Potential Field Navigation. For the same scenario as in Problem 1, a mobile robot starts at (0,0). The front wheel steered mobile robot has dynamics

with (x,y) the position, q the heading angle, V the wheel speed, L the wheel base, and f the steering angle. Set L= 2.

Design a feedback control system for force-field control. Sketch your control system.

Use MATLAB to simulate the nonlinear dynamics assuming a constant velocity V and a steerable front wheel. The wheel should be steered so that the vehicle always goes downhill in the force field plot. Plot the resulting trajectory in the (x,y) plane.

EE 5322 Homework 4

Stock Market Time Series Analysis and DFT

The closing price for the NASDAQ tracking stock NVDA is given as an Excel file.

Note there are 254 trading days in the year. There are about 22 trading days in a month. Therefore, for trading on a monthly time scale, one considers a 20-day time window. This allows one to capture many motions of the stock while not spending too much in broker’s fees by churning the stock. On-line trades now run about $15 per transaction.

1. a. Compute the 20 day MA. Plot on the same figure as the stock closing price.

b. Plot the stock minus the 20 day MA.

c. Compute and plot the 20 day moving sample variance.

d. On the same figure, plot the stock closing price, the 20 day MA, and

the MA plus the 20 day standard deviation

the MA minus the 20 day standard deviation.

The last two lines are known as the Bollinger Bands, after John Bollinger.

2. a. Compute and plot the 20 day moving skew.

b. Compute and plot the 20 day moving kurtosis.

c. Can you use these statistics to find a leading indicator for movements in the stock?

i.e. how can we predict using statistics when the stock is about to break its trend (change its pattern)?

3. a. Compute and plot the autocorrelation.

b. Compute and plot the autocovariance.

4. a. Compute and plot the DFT of the entire signal.

b. Compute and plot the DFT of the entire signal minus the 20 day MA.

c. Compute and plot the time-varying DFT using a moving window of 20 days.

d. Compute and plot the time-varying DFT using fixed bins of 20 days in length.

Any news about predicting movements in this stock?

5. Is it time to buy this stock now?


EE 5322 EXAM 1- TAKE HOME

Due Tuesday 7 March

TURN IN THIS COVER PAGE, WITH YOUR SIGNATURE BELOW.

1. RLS System Identification

The input and output of a discrete time system are given in the data file. The system is of second order with a delay of d=2.

a. Write a RLS program to identify the system transfer function.

b. Plot the output and the output of your identified system given the input . They should be the same.

2. Digital Speech Processing

(The frequencies here are about 1/10 the actual values for ease of processing using MATLAB.)

In speech, the vowels are characterized by three main frequencies known as formants. The first two formants for each vowel in English are as follows:

vowel / Formant 1 (Hz) / Formant 2 (Hz)
A / 70 / 110
E / 50 / 180
I / 40 / 200
O / 60 / 80
U / 30 / 80

The data for this homework contains an 8 sec speech signal that contains some vowels. The sampling period is 1 msec= 0.001 sec. Chop the signal into eight bins of length 1 sec. In each bin, do the FFT (using N= a power of two).

Determine which vowels occur and when. Finally, plot the DFT vs. time as a 3-D plot.

3. Machinery Monitoring

An induction motor drive has a base rotation frequency of = 50 Hz, a frequency of 3 due to a three-bladed fan, and a component at 4 due to a 4:1 gearbox. When a certain pinion gear wears badly enough, a prominent frequency component of 277 Hz appears. Soon after that, the amplitude of the frequency component at 4 significantly increases due to the failure of a gear tooth.

In the 6 sec data file, the sampling period is 1 msec. Find out when the two anomaly failure events occur. Plot the DFT vs. time as a 3-D plot. Use moving average window for the DFT of length ½ sec. Use N= a power of two.

Pledge of Honor

I have neither given nor received any aid on this exam. It is all my own work.

______signature and date


EE 5322 Homework 5

Dempster Shafer Decision-Making

Three witnesses give information about a parking lot containing 100 cars of types A,B,C,D. The evidence follows:

Witness #1 says there:

30 cars of type A

20 cars of type C

the rest he did not look at

Witness #2 says there:

20 cars of type A

20 cars of type either A or C. i.e. 20 of (A,C)

the rest he did not look at

Witness #3 says there:

20 cars of type B

10 cars of type either B or C. i.e. 10 of (B,C)

the rest he did not look at

Write an Excel file to combine this evidence in two ways and show that the result is the same. Compute the combined bpa’s m(.), and the belief and plausibility of each combined evidence set.

1.  Combine witness 1 and 2 first to get m12(.). Then add witness 3 to get m123(.)

2.  Combine witness 1 and 3 first to get m13(.). Then add witness 2 to get m123(.)


EE 5322 Exam 2

Due Tuesday 24 April.

TURN IN THIS COVER PAGE, WITH YOUR SIGNATURE BELOW.

Pledge of Honor

I have neither given nor received any aid on this exam.

______signature and date

1  1. NN Data Classification

It is desired to design a one-layer neural network that classifies the following 11 points into the four groups shown.

Group 1: (1, 1), (1, 2), (2, 2)

Group 2: (2, 0), (2,-1), (1,-1)

Group 3: (-0.3, 0.5), (-1, 0.2), (-2,2)

Group 4: (-0.5, -1.5), (-1.5, -1.3)

Design a Perceptron rule to train the network (hardlimit activation function). Plot points and decision boundaries.

2  Pattern Recognition

Design a NN to perform pattern recognition of the following letters A, C, I. Use any net structure you like.

Then, check if the network can retrieve the correct pattern from the following distorted patterns:

Test1 Test2 Test3

3  Function Approximation

Design a multilayer network with backpropagation training to approximate the function

Plot the function and the network approximation. You should show at least two full periods of the function in the plot. Your code should use only one hidden layer of neurons with tansig as activation functions. The output layer uses single purelin function.

4  Dempster Shafer Decision-Making

In the class notes on Dempster-Shafer theory, three examples were worked out using Dempster’s rule of combination. Example 3 revealed an anomaly with this rule. In the paper by Kari Sentz in the on-line course notes, several other rules of combination are given.

Write an excel file to work out examples 1 and 3 in the course notes using Yager’s rule.

5  Fuzzy Logic

This problem refers to a FL controller with two inputs, tracking error e(t) and its derivative, and one output, namely the system control input u(t). The MF for e(t) are uniformly spaced triangles with spread s=1.2. The MF for are uniformly spaced triangles with spread s=0.4. The MF for u(t) are uniformly spaced singletons with spread s=0.2. The rulebase is as follows

e-dot \ e / NM / NS / Z / PS / PM
NM / Z / PS / PM / PL / PVL
NS / NS / Z / PS / PM / PL
Z / NM / NS / Z / PS / PM
PS / NL / NM / NS / Z / PS
PM / NVL / NL / NM / NS / Z

(PVL= positive very large)

Product inferencing and centroid defuzzification are used.

a. Sketch the MFs.

b. Find the system input u(t) if e(t)= 1.5, = -0.3.