matlab problems

4
EE250 MATLAB PROBLEMS Based on Lecture Note 1 1. Solve the following ordinary differential equation using MATLAB. (a) ¨ y(t) - y(t)+4y (t) = 0; y (0) = 1, ˙ y(0) = 2 (b) ¨ y(t)+3y (t)= sin(t); y (0) = 1, ˙ y(0) = 2 (c) ¨ y(t)+ y (t)= t; y (0) = 1, ˙ y (0) = -1 2. Consider the system ˙ x = 0 1 -2 -3 x + 0 1 u; x(0) = 1 1 y = 1 0 x Find the output response of the system to unit-step function. 3. Consider the following nonlinear system: ˙ x = -x + x 2 Find the solution of the above state equation using Matlab command (ode45) for following intial conditions x 0 = 0.5, -0.5 and 1.5. 4. We found out the dynamics of a servo-motor in the class as dx 1 dt = - B J x 1 + K T J x 2 dx 2 dt = - K b L a x 1 - R a L a x 2 + 1 L a u where x 1 = speed (ω) of the motor x 2 = Armature current I a u = Armature voltage e a Parameters are: B = 0.25 N-m/(rad/sec) R a =5Ω L = 0.1 H J = 2 N-M/(rad/sec) K b = 1 volt/(rad/sec) Given output y = x 1 , find y (t) for u(t) = 100 volt (sudden) using Matlab. 1

Upload: priyanka-tiwari

Post on 20-Jan-2016

25 views

Category:

Documents


6 download

DESCRIPTION

This is a good text for problems on MATLAB involving Control Systems.

TRANSCRIPT

EE250

MATLAB PROBLEMS

Based on Lecture Note 1

1. Solve the following ordinary differential equation using MATLAB.

(a) y(t)− 2y(t) + 4y(t) = 0; y(0) = 1, y(0) = 2

(b) y(t) + 3y(t) = sin(t); y(0) = 1, y(0) = 2

(c) y(t) + y(t) = t; y(0) = 1, y(0) = −1

2. Consider the system

x =

[

0 1−2 −3

]

x+

[

01

]

u; x(0) =

[

11

]

y =[

1 0]

x

Find the output response of the system to unit-step function.

3. Consider the following nonlinear system:

x = −x + x2

Find the solution of the above state equation using Matlab command (ode45) forfollowing intial conditions x0 = 0.5, -0.5 and 1.5.

4. We found out the dynamics of a servo-motor in the class as

dx1

dt= −

B

Jx1 +

KT

Jx2

dx2

dt= −

Kb

La

x1 −Ra

La

x2 +1

La

u

where

x1 = speed (ω) of the motorx2 = Armature current Iau = Armature voltage ea

Parameters are:

B = 0.25 N-m/(rad/sec)Ra = 5 ΩL = 0.1 HJ = 2 N-M/(rad/sec)Kb = 1 volt/(rad/sec)

Given output y = x1, find y(t) for u(t) = 100 volt (sudden) using Matlab.

1

Based on Lecture Note 3

1. Find the step, ramp and impulse response of the following systems:

(a) H(s) = 1s+9

(b) H(s) = 1s−3

(c) H(s) = 1s(s+4)

(d) H(s) = 1s2(s+5)

(e) H(s) = 1s2+4s−3

(f) H(s) = s+1s2+4s−3

2. Consider the second-order plant

G(s) =1

(s+ 1)(5s+ 1)

(a) Determine the system type and error constant with respect to tracking poly-nomial reference inputs of the system for P, PD, and PID controllers ( asconfigured in Fig. 1). Let kp = 19, kI = 0.5, kD = 4

19.

(b) Determine the system type and error constant of the system with respect todisturbance inputs for each of the three regulators in part (a) with respect torejecting polynomial disturbances ω(t) at the input to the plant.

(c) Is this system better at tracking references or rejecting disturbances? Explainyour response briefly.

(d) Verify your results for parts (a) and (b) using MATLAB by plotting unit stepand ramp responses for both tracking and disturbance rejection.

R+

D(s)∑u

+

+

G(s)Y

W

V++

Figure 1:

3. Consider a system with the plant transfer function G(s) = 1/s(s + 1). You wishto add a dynamic controller so that ωn = 2 rad/s and ζ ≥ 0.5. Several dynamiccontrollers have been proposed:

(a) D(s) = (s+ 2)/2

(b) D(s) = 2 s+2s+4

(c) D(s) = 5 s+2s+10

(d) D(s) = 5 (s+2)(s+0.1)(s+10)(s+0.01)

2

(i) Using MATLAB, compare the resulting transient and steady-state responsesto reference step inputs for each controller choice. Which controller is best forthe smallest rise time and smallest overshoot?

(ii) Which system would have the smallest steady-state error to a ramp referenceinput?

(iii) Compare each system for peak control effort, that is, measure the peak mag-nitude of the plant input u(t) for a unit reference step input.

(iv) Based on your results from parts (i) to (iii), recommend a dynamic controllerfor the system from the four candidate designs.

4. A position control system has the closed loop transfer function (meter/meter) givenby

Y (s)

R(s)=

b0s+ b1s2 + a1s + a2

(a) Choose the parameters (a1, a2, b0, b1) so that the following specifications aresatisfied simultaneously:

i. The rise time tr < 0.1 sec.

ii. The overshoot Mp < 20

iii. The settling time ts < 0.5 sec.

iv. The steady-state error to a step reference is zero.

v. The steady-state error to a ramp reference input of 0.1 m/sec is not morethan 1 mm.

(b) Verify your answer via MATLAB simulation.

Based on Lecture Note 4

1. Plot the root locus in Matlab when:

(a) L(s) = s+2s(s+1)(s+5)(s+10)

(b) L(s) = (s+2)(s+6)s(s+1)(s+5)(s+10)

(c) L(s) = (s+2)(s+4)s(s+1)(s+5)(s+10)

(d) L(s) = s2+1s(s2+4)

(e) L(s) = s2+4s(s2+1)

(f) L(s) = 1s2(s+8)

2. A simplified model ofthe longitudinal motion of a certain helicopter near hover hasthe transfer function

G(s) =9.8(s2 − 0.5s+ 6.3)

(s+ 0.66)(s2 − 0.24s+ 0.15)

and the characteristic equation is 1 +D(s)G(s) = 0. Let D(s) = kp at first.

(a) Compute the departure and arrival angles at the complex poles and zeros.

(b) Sketch the root locus for this system for parameter K = 9.8kp. Use axes−4 ≤ x ≤ 4, −3 ≤ y ≤ 3;

(c) Verify your answer using MATLABTM

. Use the command axes ([ -4 4 -3 3]) toget right scales.

3

(d) Suggest a practical (at least as many poles or zeros) alternative compensationD(s) which will at least result in a stable system.

3. For the feedback configuration of Fig.2, use asymptotes, center of asymptotes, anglesof departure and arrival, and the Routh array to sketch root loci for the characteristicequations of the following feedback control systems versus the parameter K. Use

MATLABTM

to verify your results.

(a) G(s) = 1s(s+1+3j)(s+1−3j)

, H(s) = s+2s+8

(b) G(s) = 1s2, H(s) = s+1

s+3

(c) G(s) = s+5s+1

, H(s) = s+7s+7

(d) G(s) = (s+3+4j)(s+3−4j)s(s+1+2j)(s+1−2j)

, H(s) = 1 + 3s

R∑

+

G(s)Y

H(s)

Figure 2: Problem 3

4. For the system in Fig. 3

R∑

+

K(

s+1s+13

)

s2+81s2(s2+100)

Y

Figure 3: Problem 4

(a) Find the locus of closed-loop roots with respect to K.

(b) Is there a value of K that will cause all roots to have a damping ratio greaterthan 0.5.

(c) Find the values of K that yield closed-loop poles with the damping ratio ζ =0.707.

(d) use MATLABTM

to plot the response of the resulting design to a referencestep.

4