• No results found

Linearization of Nonlinear Models

In document Linear Feedback With Matlab (Page 144-152)

Simulation Analysis of Nonlinear Systems

4.4 Linearization of Nonlinear Models

Linear systems are far easier to analyze and design than nonlinear ones. Unfortunately, system models which must be dealt with in practice are rarely linear. In this case a linear approximation of the system is often required to simplify the analysis and design procedures.

One procedure for doing this is the linearization process.

System linearization extracts an approximate linear model, i.e., a linear model in a neighborhood of the operating point.

Consider the nonlinear dynamic system model

˙xi(t )= fi(x1, x2, . . . , xn, u, t ), i= 1, 2, . . . , n. (4.1) An operating point is defined as the values of the state and input variables when the derivatives of the state variables approach zero. It can be obtained by solving the nonlinear equations defined in (4.1) such that

fi(x1, x2, . . . , xn, u, t )= 0, i = 1, 2, . . . , n, (4.2) which can be solved numerically. Denote by x0the operating point with an input signal u0. The nonlinear system can be approximated by

˙xi =

n j=1

∂fi(x, u)

∂xj



x0,u0

xj+

p j=1

∂fi(x, u)

∂uj



x0,u0

uj. (4.3)

Using the new state variables z(t)= x(t) for the system model, the linearized model can be obtained as follows:

˙z(t) = Al|x0,u0z(t)+ Bl|x0,u0v(t), (4.4) where v(t )= u(t), and

Al =



∂f1/∂x1 · · · ∂f1/∂xn ... . .. ...

∂fn/∂x1 · · · ∂fn/∂xn

 , Bl=



∂f1/∂u1 · · · ∂f1/∂up ... . .. ...

∂fn/∂u1 · · · ∂fn/∂up

 . (4.5)

Useful functions for performing the linearization of nonlinear systems are provided in Simulink. The user can use thetrim()function to find the operating point. The syntax of thetrim()function is

[x,u,y,z]=trim(model_name,x0,u0)

wheremodel_nameis the Simulink model name. The variables x0, u0are the initial guess for the states and input at the operating point. A constrained optimization technique is used

to obtain the operating point. For systems without nonlinear elements, the initial guess of x0, u0can be omitted. The actual operating point is returned in x, u, y, and the values of the derivatives of the state variables are returned in z. Theoretically speaking, the derivatives of the state variables at the operating point should be equal to 0.

Example 4.10. Assume that the Simulink model of the nonlinear system is as given in Figure 4.10 and the name of the Simulink model file isc4mnl.mdl. Using the MATLAB statements

>> [x0,u0,y,dx]=trim(’c4mnl’,[],1)

the operating point of the system can be obtained as x0 = [0.1281, 0, 0.0905]T, u0 = 1.

Having obtained the operating point, we can obtain the linearized state space model of the nonlinear system by the corresponding MATLAB function provided in Simulink. The syntaxes of these function are

[A,B,C,D]=linmod2(model_name,x0,u0)

[A,B,C,D]=linmod(model_name,x0,u0), % delayed systems [A,B,C,D]=dlinmod(model_name,x0,u0), % discrete-time systems

where x0, u0denote the operating point. The linearized state space expression is returned in (A,B,C,D). If one omits the x0, u0variables (operating point), the default linearized model can be obtained. It should be noted that different types of systems can be linearized with the different functions listed above.

Consider again the nonlinear system model analyzed above. Under the above operat-ing point and, with the MATLAB statements

>> [x0,u0,y,dx]=trim(’c4mnl’,[],1);

[A,B,C,D]=linmod2(’c4mnl’,x0,u0); G1=ss(A,B,C,D),

the state space expression of the linearized model of the original nonlinear system can be obtained as

˙x(t) =

−0.707 1 1

−2 −4 −3

0 1 0

 x(t) +

0 1 0

 u(t), y(t) = [1, 0, 0]x(t).

Example 4.11. Consider again the linear DC (direct current) motor problem given in Example 2.11. The Simulink description is shown in Figure 4.39, and by using the MATLAB commands

>> [a,b,c,d]=linmod2(’c4dcmot’);

G=ss(a,b,c,d); minreal(zpk(G))

the pole-zero-gain model can easily be obtained as

G(s)= 1118525021.9491(s+ 5.882)(s + 6.667)

(s+ 179.6)(s + 98.9)(s + 8.3)(s2+ 0.89s + 5.8)(s2+ 68.26s + 2248) which is the same as the one obtained earlier in Example 2.11.

1

Figure 4.39. Simulink model for the DC motor system (file: c4dcmot.mdl).

1

Figure 4.40. MIMO Simulink model (file: c4mmdly1.mdl).

Example 4.12. Consider the multivariable system in Example 4.3. If a linearized model is expected, the Padé approximation should be used in linearizing the delay terms. One may set the edit box ofPade order (for linearization) to 2 in the delay blocks, where second-order Padé approximation can be used. The Simulink model for the multivariable system can then be constructed as shown in Figure 4.40.

When the Simulink model is established, the following statements can be used in the linearization process, and one can obtain the linear state space model. The exact simulation results are obtained, together with the linearized model, as shown in Figure 4.41. It can be seen that the simulation results of the linearized model are very accurate.

>> Kp=[0.1134,0.924; 0.3378,-0.318];

[A,B,C,D]=linmod(’c4mmdly1’), step(ss(A,B,C,D)) The state space model can be extracted from the Simulink system

A=

−0.2 0 0.2

From: In(1)

To: Out(1)

0 5 10 15

0 0.1 0.2 0.3 0.4

To: Out(2)

From: In(2)

0 5 10 15

Step Response

Time (sec)

Amplitude

Figure 4.41. Comparisons of exact and approximate results.

1 Out1 a

s(s+a)

Zero−Pole Zero−Order Hold2 Zero−Order

Hold1 Zero−Order

Hold Step

K(z−z1) (z−p1) Discrete Zero−Pole 1

In1

Figure 4.42. Another Simulink model (file: c4mcomp2.mdl).

BT=

 0 0 0.3378 0 0 0 0 0.1134 0 0.1134 0 0.3378

0 0 −0.318 0 0 0 0 0.924 0 0.924 0 −0.318

, C=

 −16.667 0 0.44638 0 0 0 0 0 0.063708 0 0 0 0 0 0 −40 0 −9.3023 0 0 0 0 0.93573 −0.10853

.

It should be noted that thelinmod2()function cannot be used in the linearization process, since the delay term cannot be handled correctly.

Example 4.13. Consider the computer controlled system studied in Example 4.4. For sim-ulation analysis and linearization, the Simulink model can be constructed with theinport andoutportused in the system model. The final Simulink model is shown in Figure 4.42.

The following statements can be used in the linearization problem, where the discrete-time transfer function can finally be obtained:

>> T=0.2; a=0.1; z1=exp(-0.1*T); p1=exp(-T); K=(1-p1)/(1-z1);

[A,B,C,D]=dlinmod(’c4mcomp2’); zpk(ss(A,B,C,D,’Ts’,0.2)) The linearized model can be written as

G(z)=0.018187(z+0.9934)(z−0.9802) (z−0.9802)(z2−1.801z+0.8368).

It can be seen that the results are exactly the same as those of Example 4.4. It should be noted thatdlinmod()should be used rather thanlinmod2().

Problems

1. Become familiar with the Simulink library groups and observe the use of the commonly used blocks so that you can easily use them in solving simulation problems. A handy new group which contains the frequently used blocks can be set up for later use.

2. Consider the linear differential equation

y(4)+ 5y(3)+ 63 ¨y + 4 ˙y + 2y = e−3t+ e−5tsin(4t+ π/3).

If the initial conditions are given by y(0) = 1, ˙y(0) = ¨y(0) = 1/2, y(3)(0) = 0.2, establish the Simulink model and plot the simulation results. The analytical solutions to linear differential equations can be evaluated with thedsolve()function. Try to find the analytical results with this function.

3. For the time varying differential equation

y(4)+ 5ty(3)+ 6t2¨y + 4 ˙y + 2e−2ty= e−3t+ e−5tsin(4t+ π/3),

assume that y(0)= 1, ˙y(0) = ¨y(0) = 1/2, y(3)(0)= 0.2. Draw the Simulink model to study the time varying system.

4. The Apollo trajectory (x, y) can be described by the equations

¨x = 2 ˙y + x −µ(x+ µ)

r13µ(x− µ)

r23 , ¨y = −2 ˙x + y − µy r13µy

r23, where µ= 1/82.45, µ = 1 − µ, r1="

(x+ µ)2+ y2, r2="

(x− µ)2+ y2. Assume that x(0) = 1.2, ˙x(0) = 0, y(0) = 0, ˙y(0) = −1.04935751. Try to establish a Simulink model and draw the trajectory of Apollo.

5. For the well-known Van der Pol nonlinear differential equation described by¨y+µ(y21)˙y + y = 0, draw the phase plane trajectory and study its limit cycles for different initial conditions.

6. For the famous chaotic Lorenz system



˙x1(t )= −βx1(t )+ x2(t )x3(t ),

˙x2(t )= −ρx2(t )+ ρx3(t ),

˙x3(t )= −x1(t )x2(t )+ σ x2(t )− x3(t )

with β= 18/3, σ = ρ = 10 and x1(0)= x2(0)= 0, x3(0)= 10−10, try to establish a Simulink model and draw the three-dimensional phase space trajectory of the results.

7. Consider the two input–two output system described by

˙x =



2.25 −5 −1.25 −0.5 2.25 −4.25 −1.25 −0.25 0.25 −0.5 −1.25 −1 1.25 −1.75 −0.25 −0.75



 x +



 4 6 2 4 2 2 0 2



 u, y =

0 0 0 1

0 2 0 2

x.

If the inputs are given by sin t and cos t , construct the Simulink model and draw the simulation results.

8. For a 4× 4 multivariable system given by

G(s)=





1/(1+ 4s) 0.7/(1+ 5s) 0.3/(1 + 5s) 0.2/(1 + 5s) 0.6/(1+ 5s) 1/(1+ 4s) 0.4/(1+ 5s) 0.35/(1 + 5s) 0.35/(1+ 5s) 0.4/(1 + 5s) 1/(1+ 4s) 0.6/(1+ 5s)

0.2/(1+ 5s) 0.3/(1 + 5s) 0.7/(1 + 5s) 1/(1+ 4s)



,

construct its Simulink model and draw the simulation results when a unit step input signal is applied to each input channel individually. Compare the results with the one obtained with thestep()function.

9. For a given implicit differential equation



sin x1˙x1+ cos x2˙x2+ x1= 1,

− cos x2˙x1+ sin x1˙x2+ x2= 0,

if x1(0) = x2(0) = 0, numerically solve the differential equation using simulation method.

10. Establish a Simulink model for the block diagram of a nonlinear system shown in Figure 4.43. Observe the output signal for the unit step input.

6

-−0.5

−2.5 0.5 2.5

e−0.4s 30

0.8s+ 1

1 s

30 s2+ 6.5s + 1

- - -

--

-6



Figure 4.43. Block diagram in Problem 10.

11. Construct a Simulink model for the nonlinear block diagram shown in Figure 4.44. If the amplitude of the input step signal is 1.1, observe the output signal.

10 s(s+ 1)2

- - - -

-6

 6

-6

-6

-0 1 2

1 2

1 1

r(t ) y(t )

Figure 4.44. Nonlinear system block diagram in Problem 11.

12. If the Simulink model of a nonlinear system is given in Figure 4.45, write down the mathematical expression of the system from the Simulink model.

x1 x2

Figure 4.45. Simulink model for Problem 12.

13. Find the overall system model using MATLAB for the feedback systems shown in Figure 4.46. Try to use Simulink to get the closed-loop system model. Is there any problem in using Simulink, and if so, why? Obtain the overall system model by hand calculation or by direct call of MATLAB functions such asseries()and feedback().

Figure 4.46. The block diagrams for Problem 13.

14. For a delayed differential equation

dy(t )/dt= 0.2y(t− 30)

1+ y10(t− 30)− 0.1y(t),

if y(0)= 0.1, model the equations with Simulink, and simulate the system to draw the y(t ) curve.

15. For the neutral-type delayed differential equation

˙x(t) = A1x(t− τ1)+ A2˙x(t − τ2)+ Bu(t),

try to establish a Simulink model to find the solutions of the system.

16. Represent the block diagram shown in Figure 4.47 in Simulink and then perform a linearization to find the closed-loop transfer function and a state space model.

s+ 0.5

Figure 4.47. The block diagram for Problem 16.

17. Consider the well-known benchmark problem for testing a computer aided design en-vironment (the F-14 airplane problem [54]). The linear model is shown in Figure 4.48.

The parameters in the diagram are given by

τa= 0.05, σwG= 3.0, a = 2.5348, b = 64.13,

Try to show the state space expression and find all the poles and zeros of the system.

- 1

Figure 4.48. The F-14 benchmark problem.

Chapter 5

In document Linear Feedback With Matlab (Page 144-152)