You are on page 1of 48

7CEM2425 Dynamic Systems and Simulation

Lab 2: Report
Wijetunge de Silva, Michael-Melhan
Department of Mechanical Engineering
King’s College London

January 21, 2008


Contents

1 Chaotic Systems 1

Element A - Preliminary Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.1 Show, when in state space form, that there are three state space equations. Is it
therefore possible for this system to exhibit chaotic behaviour? . . . . . . . . . . . . 1

1.2 Find the three singularity points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Linearize the equation about these three singular points. . . . . . . . . . . . . . . . . 3

1.4 Find, without solving, the eigenvalue equation that determines the stability of each of
these equilibrium points. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Element B - SIMULINK Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.5 Give a full description of your SIMULINK model. . . . . . . . . . . . . . . . . . . . 5

Element C - Simulations and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.6 Choose parameters σ, λ, b such that the condition in (1) are not satisfied and the
system equilibria are not all unstable. . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.7 Choose parameters σ, λ, b such that the condition in (1) are satisfied and the system
equilibria are all unstable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

1.8 Plot how the trajectories of two points which start very close to each other diverge
over time for each of the two sets of parameters you have chosen in 1.6 and 1.7. . . 15

2 Lumped Parameter System 17

Element A - Preliminary Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.1 Calculate the Biot number for the system. hence determine the appropriate number of
lumps that the system must be split into, in a multiple-lumped capacitance modelling
approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2.2 Draw an electrical circuit representing your lumped parameter system. Hence de-
rive the equation that determine the temperatures at each node in your system and
calculate the resistance and capacitance associated with each node. . . . . . . . . . . 18

2.2.1 Deriving the equation for node T0 . . . . . . . . . . . . . . . . . . . . . . . . 19

2.2.2 Deriving the equation for node Ti . . . . . . . . . . . . . . . . . . . . . . . . 19

i
2.2.3 Deriving the equation for node Tn . . . . . . . . . . . . . . . . . . . . . . . . 20

Element B - SIMULINK Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.3 Give a full description of your SIMULINK model. . . . . . . . . . . . . . . . . . . . 22

Element C - Simulations and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.4 With T0∞ and Tn∞ set at 200 ◦ C and 30 ◦ C respectively, and with the steel plate
initially at 30 ◦ C, plot the temperature at each end of the plate against time. List the
steady state values for each node in your system. Calculate the heat flow into and
out of the plate at steady state and comment on the result. . . . . . . . . . . . . . . 24

2.5 With T0∞ and Tn∞ set at 200 ◦ C and 30 ◦ C respectively, and with the steel plate
initially at 200 ◦ C, plot the temperature at each end of the plate against time. Check
that your steady state values agree with your previous results. Calculate the heat flow
into and out of the plate at steady state and comment on the result. What do you
notice about the steady state temperatures plotted against distance? . . . . . . . . . 26

2.6 Choose a method for verifying the accuracy of your results. Decide, and justify the de-
gree of accuracy which is desired in the simulations, bearing in mind the assumptions
of the model, and record the system tolerances that achieve this level of accuracy. . . 29

2.7 With the parameters set as in Question 2.4, simulate the system for 800s and put on
a single graph plots of temperature against time at each node. Plot the temperatures
at each node versus distance at 800s and comment on the result. . . . . . . . . . . . 30

3 Focused Study of the Lorenz Model 32

Element A - Preliminary Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3.1 Describe your chosen system. Show that the system has the potential for exhibiting
chaotic behaviour. Deduce the equations of motion for the system you have chosen
and write down your analysis, listing any approximations and assumptions you have
made. Rearrange your equations in state space form so that they can be implemented
in Simulink. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

3.2 Attempt to predict general characteristics of the behaviour of the system. For example,
you may want to find the system equilibrium points, linearize around these points,
and make deductions on system stability around these points. Alternatively, there
may be analytical solutions available for special classes of initial conditions. . . . . . 33

Element B - SIMULINK Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3.3 Give a full description of your SIMULINK model. . . . . . . . . . . . . . . . . . . . 36

ii
3.4 Devise some tests to determine the accuracy of your solution, and to check whether
the model is working correctly. Give an account of your tests and the results. . . . . 38

Element C - Simulations and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 39

A Appendix 40

iii
List of Tables

1 Chosen values of the initial conditions. . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Chosen values of the initial conditions. . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Chosen values of σ, ρ, and b, so that the system equilibria are not all unstable. . . . 7

4 Chosen values of the initial conditions. . . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Chosen values of σ, ρ, and b, so that the system equilibria are all unstable. . . . . . 11

6 Variables given for simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

7 List of steady state values of temperature for each node. . . . . . . . . . . . . . . . 25

8 Heat flow across each lump of the system. . . . . . . . . . . . . . . . . . . . . . . . 25

9 List of steady state values of temperature for each node. . . . . . . . . . . . . . . . 27

10 Heat flow across each lump of the system. . . . . . . . . . . . . . . . . . . . . . . . 27

11 Chosen values of the initial conditions. . . . . . . . . . . . . . . . . . . . . . . . . . 36

List of Figures

1 SIMULINK Model to Simulate System Dynamics . . . . . . . . . . . . . . . . . . . 5

2 SIMULINK: Simulation Configuration Parameters . . . . . . . . . . . . . . . . . . . 6

3 Plot of the system response on the x1 -x2 plane. . . . . . . . . . . . . . . . . . . . . 8

4 Plot of the system response on the x1 -x3 plane. . . . . . . . . . . . . . . . . . . . . 9

5 Plot of the system response on the x2 -x3 plane. . . . . . . . . . . . . . . . . . . . . 10

6 Plot of the system response on the x1 -x2 plane. . . . . . . . . . . . . . . . . . . . . 12

7 Plot of the system response on the x1 -x3 plane. . . . . . . . . . . . . . . . . . . . . 13

8 Plot of the system response on the x2 -x3 plane. . . . . . . . . . . . . . . . . . . . . 14

9 Plot of x1 -x2 and x1 -x3 for the system equilibria chosen in Q1.6. . . . . . . . . . . . 15

10 Plot of x1 -x2 and x1 -x3 for the system equilibria chosen in Q1.7. . . . . . . . . . . . 16

iv
11 Steel plate in contact with air. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

12 The electrical circuit representing the lumped parameter system. . . . . . . . . . . . 18

13 SIMULINK Model of the lumped parameter system. . . . . . . . . . . . . . . . . . . 22

14 SIMULINK: Simulation Configuration Parameters . . . . . . . . . . . . . . . . . . . 23

15 Plot of the temperature at each end of the plate against time. . . . . . . . . . . . . 24

16 Plot of the temperature at each end of the plate against time. . . . . . . . . . . . . 26

17 Plot of the temperature at each end of the plate against time. . . . . . . . . . . . . 28

18 Plot of the lot of temperature against time at each node, simulated for 800s. . . . . 30

19 Plot of temperatures at each node versus distance, simulated for 800s. . . . . . . . . 31

20 SIMULINK Model to Simulate System Dynamics . . . . . . . . . . . . . . . . . . . 36

21 SIMULINK: Simulation Configuration Parameters . . . . . . . . . . . . . . . . . . . 37

22 3D plot of the Lorenz model in the x1 -x3 , x2 -x3 , x1 -x3 and planes, respectively. . . . 38

v
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1 Chaotic Systems

Element A - Preliminary Analysis

1.1 Show, when in state space form, that there are three state space
equations. Is it therefore possible for this system to exhibit
chaotic behaviour?

The equation of motion for a simple pendulum undergoing forced harmonic excitation obeys,

 
1 cp
θ̈ = − θ̇ + g sin θ + A cos(ωt) (1)
lp mp lp

Written in state space form, as an autonomous system, yields three state space equations as follows,

x1 = θ (2)
x2 = θ̇ (3)
x3 = t (4)
ẋ1 = x2 (5)
 
1 cp
ẋ2 = − x2 + gx1 + A cos(ωx3 ) (6)
lp mp lp
ẋ3 = 1 (7)

The equation of motion for a simple pendulum undergoing forced harmonic excitation, in state
space form yields a system that has three degrees of freedom - although the explicit dependence of
time has been removed from system state equations.

This is the first condition for a system to be chaotic, since in a two dimensional system the possi-
bilities are limited to attraction to a single point, or to a limit cycle for a bounded system (<{λ}→
+ve). The second condition, is that the system must be non-linear else all solutions can be written
as sums of terms of the form x = x0 eλt or x = x0 tn eλt which do not lead to chaotic behaviour.

The Lorenz model equations are of this, autonomous, form where the time behaviour of the system
can be tracked by following the motion of a point whose coordinates are x1 (t), x2 (t), x3 (t) in a
three-dimensional x1 , x2 , x3 state space.

Is it therefore possible for this system to exhibit chaotic behaviour?

Yes.

1
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1.2 Find the three singularity points.

To prevent confusion when finding the eigenvalue equations later on, since the symbol for the
eigenvalues are also λ, let it be substituted in the Lorenz model with the correct symbol for the
Rayleigh number, ρ,

ẋ1 = σ(x2 − x1 ) (8)


ẋ2 = (1 + ρ − x3 )x1 − x2 (9)
ẋ3 = x1 x2 − bx3 (10)

Therefore,

σ(x2 − x1 ) = 0 x 1 = x2 (11)

x1 x2 − bx3 x21 = bx3 and x22 = bx3 (12)

x21 x21 p
(1 + ρ − )x1 − x1 = 0 x1 (ρ − )=0 x1 = 0 or ± bρ (13)
b b

From Eq.(65) and Eq.(66),

x22 x22 p
(1 + ρ − )x2 − x2 = 0 x2 (ρ − )=0 x2 = 0 or ± bρ (14)
b b

From Eq.(65), Eq.(66), and Eq.(67),

bρ = bx3 x3 = ρ (15)

x3 = 0 (16)

Therefore the singularities are,

 √   √ 
− bρ
 
0 + bρ
√ √
x̂1 =  0  ; x̂2 =  + bρ  ; x̂3 =  − bρ  (17)
0 ρ ρ

2
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1.3 Linearize the equation about these three singular points.

Linearizing the system yields,


∆ẋ = A∆x (18)

where,
δf1 δf1 δf1
 
 
 δx1 δx2 δx3  −σ σ 0
 
   
 δf δf2 δf2   
2
A=  =  (1 + ρ − x3 ) −1 −x1  (19)
   
 δx1 δx2 δx3   
   
 
 δf
3 δf3 δf3  x2 x1 −b
δx1 δx2 δx3

Thereby linearizing the system about the singularities,

   
−σ σ
0 −σ σ 0
   
   
A(1) = (1 + ρ − x3 ) −1 −x1  =  (1 + ρ) −1 0 (20)
   

   
 2 3
0
  

x2 x1 −b x̂=666 7 0 0 −b
4
0 7
7
5
0

   
−σ σ
0 −σ σ 0
   
   √ 
A(2) = (1 + ρ − x3 ) −1 −x1  = 1 −1 − bρ  (21)
   
 2 √
   
3
+ bρ √ √
  
x1 −b x̂=666 √

x2 7 bρ bρ −b
4
+ bρ 7
7
5
ρ

   
−σ σ
0 −σ σ 0
   
   √ 
A(3) = (1 + ρ − x3 ) −1 −x1  = 1 −1 bρ  (22)
   
 2 √
   
− bρ
3
√ √
  
x1 −b x̂=666 √

x2 7 − bρ − bρ −b
4
− bρ 7
7
5
ρ

3
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1.4 Find, without solving, the eigenvalue equation that determines


the stability of each of these equilibrium points.

The eigenvalue equation is,


Ax = λx (23)

   
−σ σ 0 −σ − λ
σ 0

 



 1 0 0

 

|(A(1) − λI)| =  (1 + ρ) −1 0  − λ 0 1 0  =  (1 + ρ) −1 − λ 0 (24)
    

   
  0 0 1  

0 0 −b 0 0 −b − λ

 
−σ − λ σ

= (−b − λ)   = (−b − λ) {(−σ − λ)(−1 − λ) − σ(1 + ρ)}
(25)
(1 + ρ) −1 − λ

= −λ3 − λ2 (1 + b + σ) − λ(b + σb − σρ) + σρb = 0 (26)

Likewise,
|(A(2) − λI)| = −λ3 − λ2 (1 + b + σ) − λb(1 + σ − ρ) − 2σρb = 0 (27)

|(A(3) − λI)| = −λ3 − λ2 (1 + b + σ) − λb(1 + σ − ρ) − 2σρb = 0 (28)

4
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Element B - SIMULINK Model

1.5 Give a full description of your SIMULINK model.

The following SIMULINK model directly represents the following three state space equations,

ẋ1 = σ(x2 − x1 ) (29)


ẋ2 = (1 + λ − x3 )x1 − x2 (30)
ẋ3 = x1 x2 − bx3 (31)

which model the system.

Since the equations in the handout refer to ρ as λ, this notation was used in the model and .m-file
used to define and simulate the system.

Therefore the parameters controlling the system, apart from the initial conditions of the three
integrator blocks which represent x1 (0), x2 (0), and x3 (0) respectively, are σ, λ, and b.

Figure 1: SIMULINK Model to Simulate System Dynamics

The initial conditions have been chosen close to the origin for the following simulations of the
system,

Variables Values
x1 (0) 0.3
x2 (0) 0.4
x3 (0) 0.6

Table 1: Chosen values of the initial conditions.

5
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

To counter the occurrence of clipping in the plots generated in MATLAB, the Relative and Absolute
tolerances were changed as shown in Figure 21, below.

Figure 2: SIMULINK: Simulation Configuration Parameters

The simulation was executed directly from the controlling *.m-file using the following MATLAB
command,

EDU>> sim(‘lab2q1 mdl’,50);

where the simulation was run for 50 seconds, which seemed to produce optimal plots.

6
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Element C - Simulations and Analysis

1.6 Choose parameters σ, λ, b such that the condition in (1) are not
satisfied and the system equilibria are not all unstable.

The initial conditions have been chosen close to the origin,

Variables Values
x1 (0) 0.3
x2 (0) 0.4
x3 (0) 0.6

Table 2: Chosen values of the initial conditions.


8
Let b = , and therefore σ causes instability if,
3

σ > 3.6666̇ (32)

Choosing σ = 8, ρ causes instability if,


ρ > 19.69 (33)

Therefore the values of σ, ρ, and b, have been chosen so that the system equilibria are not all
unstable.

Variables Values
b 8/3
σ 8
ρ 19

Table 3: Chosen values of σ, ρ, and b, so that the system equilibria are not all unstable.

7
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 3: Plot of the system response on the x1 -x2 plane.

It can be seen that the system starts off from a singularity point (an unstable focus) and spirals out
wards. After a certain period has passed it continues to spiral outward around another singularity,
in a completely unpredictable manner.

We can see the formation of both attractors are just about taking place, therefore this could be
called a partial attractor.

8
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 4: Plot of the system response on the x1 -x3 plane.

It can be seen that the system starts off from a singularity point (an unstable focus) and spirals out
wards. After a certain period has passed it continues to spiral outward around another singularity,
in a completely unpredictable manner.

We can see the formation of both attractors are just about taking place, therefore this could be
called a partial attractor.

9
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 5: Plot of the system response on the x2 -x3 plane.

It can be seen that the system starts off from a singularity point (an unstable focus) and spirals out
wards. After a certain period has passed it continues to spiral outward around another singularity,
in a completely unpredictable manner.

We can see the formation of both attractors are just about taking place, therefore this could be
called a partial attractor.

10
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1.7 Choose parameters σ, λ, b such that the condition in (1) are satis-
fied and the system equilibria are all unstable.

The initial conditions have been chosen close to the origin,

Variables Values
x1 (0) 0.3
x2 (0) 0.4
x3 (0) 0.6

Table 4: Chosen values of the initial conditions.


8
Let b = , and therefore σ causes instability if,
3

σ > 3.6666̇ (34)

Choosing σ = 10, ρ causes instability if,

ρ > 23.74 (35)

Therefore the values of σ, ρ, and b, have been chosen so that the system equilibria are all unstable.

Variables Values
b 8/3
σ 10
ρ 25

Table 5: Chosen values of σ, ρ, and b, so that the system equilibria are all unstable.

11
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 6: Plot of the system response on the x1 -x2 plane.

The formation of a ‘strange attractor’ is now visible since the system is completely unstable. This is
a purely an imaginary plot that is complex and positive, hence an unstable focus exhibiting chaotic
behaviour.

12
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 7: Plot of the system response on the x1 -x3 plane.

The same attractor from a different plane view, and this depicts the well known ’butterfly’ form.
This is a purely an imaginary plot that is complex and positive, hence an unstable focus exhibiting
chaotic behaviour.

13
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 8: Plot of the system response on the x2 -x3 plane.

View of the Lorenz attractor from the x2 -x3 plane. This is a purely an imaginary plot that is
complex and positive, hence an unstable focus exhibiting chaotic behaviour.

14
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

1.8 Plot how the trajectories of two points which start very close to
each other diverge over time for each of the two sets of parame-
ters you have chosen in 1.6 and 1.7.

Figure 9: Plot of x1 -x2 and x1 -x3 for the system equilibria chosen in Q1.6.

It can been seen that the both trajectories started from the same location and have ended up in
two completely different locations, and have diverged away from each other by a significant amount
and therefore it is clear that this system is exhibiting chaotic behaviour.

15
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Figure 10: Plot of x1 -x2 and x1 -x3 for the system equilibria chosen in Q1.7.

It can been seen that the both trajectories started from the same location and have ended up in
two completely different locations, and have diverged away from each other by a significant amount
and therefore it is clear that this system is exhibiting chaotic behaviour..

16
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2 Lumped Parameter System

Element A - Preliminary Analysis

2.1 Calculate the Biot number for the system. hence determine the
appropriate number of lumps that the system must be split into,
in a multiple-lumped capacitance modelling approach.

The Biot number of a system is defined as,

L
 
RThermal Conduction  hLc
Nb = =  kA  = (36)

RThermal Convection 1 k
hA

where Lc is the characteristic length of the solid and is defined as the thickness for a plate, i.e.
Lc = L, h is the convection coefficient, and k is the thermal conductivity.

Therefore, calculating the Biot number using the convection coefficient for free and forced convec-
tion,
10 · 0.23
NbFree Convection = = 0.0307 (37)
75

200 · 0.23
NbForced Convection = = 0.6133 (38)
75

Since the forced convection has a greater impact on the system, dominating the overall response,
the system is therefore split into lumps of 0.1.

0.6133
= 6.133 ≈= 7 (39)
0.1

The system is therefore split into seven lumps of 0.1 and therefore the dominating temperature
difference will be at the surfaces of each lump.

17
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.2 Draw an electrical circuit representing your lumped parameter


system. Hence derive the equation that determine the tempera-
tures at each node in your system and calculate the resistance
and capacitance associated with each node.

Figure 11: Steel plate in contact with air.

The electrical circuit representing the lumped parameter system defined in Q2.1 is shown below,

Figure 12: The electrical circuit representing the lumped parameter system.

18
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.2.1 Deriving the equation for node T0

d
For a capacitor, q = Cv, and since current is given by q̇, i = CDδv, where D = is used for the
dt
sake of clarity.

2.2.2 Deriving the equation for node Ti

19
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.2.3 Deriving the equation for node Tn

The mass, M, of the steel plate is calculated by applying,

Mass
Density = (40)
Volume

Therefore,
Mass = 7850 · 1 · 0.23 = 1, 805.5 kg (41)

The resistance and capacitance associated with each node are calculated as follows,

1 1
Rhn = = Ω
hn A 200

Cp M 450 · (7850 · 0.23) 812475


Cn = = = F
n 7 7

Cn Cp M 450 · (7850 · 0.23) 812475


= = = F
2 2n 14 14 (42)

L 0.23 23 1
Rn = = = · Ω
nkA 7 · 75 100 523
1 1
Rho = = Ω
ho A 10

20
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Therefore, the general form of the three differential equations describing the system are as follows,

   
2 1 1 T1 T0∞
Ṫ0 = − + T0 + + (43)
Cn Rn Rh0 Rn Rh0

 
−2Ti + Ti+1 + Ti−1
Ṫi = (44)
Cn Rn

   
2 1 1 Tn∞ Tn−1
Ṫn = − + Tn + + (45)
Cn Rhn Rn Rhn Rn

The fully expanded form of the differential equations describing this system,

   
2 1 1 T1 T0∞
Ṫ0 = − + T0 + + (46)
Cn Rn Rh0 Rn Rh0

 
−2T1 + T2 + T0
Ṫ1 = (47)
Cn Rn

 
−2T2 + T3 + T1
Ṫ2 = (48)
Cn Rn

 
−2T3 + T4 + T2
Ṫ3 = (49)
Cn Rn

 
−2T4 + T5 + T3
Ṫ4 = (50)
Cn Rn

 
−2T5 + T6 + T4
Ṫ5 = (51)
Cn Rn

 
−2T6 + T7 + T5
Ṫ6 = (52)
Cn Rn

   
2 1 1 T7∞ T6
Ṫ7 = − + T7 + + (53)
Cn Rhn Rn Rhn Rn

21
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Element B - SIMULINK Model

2.3 Give a full description of your SIMULINK model.

The following SIMULINK model was based directly on the equations derived in Q2.2, which defined
Ṫ0 to Ṫ7 ,

Figure 13: SIMULINK Model of the lumped parameter system.

22
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

The variables given for simulation of the SIMULINK model have been tabulated below,

Variables Values (w/ units)


Thermal Conductivity (k) 75 W/m/K
Specific heat Capacity (Cp ) 45 J/kg/K
Density of steel 7850 kg/m3
Area of plate (A) 1 m2
Thickness of plate (L) 0.23 m
Coefficient of free convection (h0 ) 10 W/m2 /K
Coefficient of forced convection (hn ) 200 W/m2 /K

Table 6: Variables given for simulation

The initial condition of each integrator for T0 to T7 has its initial condition set to the variable Tint,
which allows for the initial temperature of the plate, in Kelvin, to be defined within the *.m-file
before simulation.

The simulation was executed directly from the controlling *.m-file using the following MATLAB
command,

EDU>> sim(‘lab2q2 mdl’,100000);

where the simulation was run for 100,000 seconds. For Q2.7, the simulation time was reduced to
800s via this command.

To counter the occurrence of clipping in the plots generated in MATLAB, the Relative and Absolute
tolerances were changed as shown in Figure 14, below.

Figure 14: SIMULINK: Simulation Configuration Parameters

23
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Element C - Simulations and Analysis

2.4 With T0∞ and Tn∞ set at 200 ◦ C and 30 ◦ C respectively, and with
the steel plate initially at 30 ◦ C, plot the temperature at each end
of the plate against time. List the steady state values for each
node in your system. Calculate the heat flow into and out of the
plate at steady state and comment on the result.

Figure 15: Plot of the temperature at each end of the plate against time.

24
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

The steady state values for each node are listed below with the steel plate temperature at 30 ◦ C=303
K,

Node Temperature (K)


T0 315.6897 K
T1 315.0005 K
T2 314.3114 K
T3 313.6222 K
T4 312.9330 K
T5 312.2439 K
T6 311.5547 K
T7 310.8655 K

Table 7: List of steady state values of temperature for each node.

The heat flow was calculated by applying,

 
kA∆T
Q= (54)
L

where ∆T is the temperature difference across each lump.

The heat flow across each lump is tabulated in the table below,

Lump Heat flow, Q, (W)


Lump 1 224.73 W
Lump 2 224.73 W
Lump 3 224.73 W
Lump 4 224.73 W
Lump 5 224.73 W
Lump 6 224.73 W
Lump 7 224.73 W

Table 8: Heat flow across each lump of the system.

Since the system is at steady state, the total heat flow entering the plate (224.73W) flows from
lump to lump until it flows out of the plate.

This is analogous to a purely resistive circuit of seven resistors in series, representing the Rn of each
lump, since the capacitance at each node tends to zero at steady state and therefore it reduces to
a simple electrical circuit of i = (V1 − V2 )/Z, which is identical to Eq.(54) where Q represents the
current, ∆T represents the potential difference and L/kA represents the total impedance Z.

Since ic = 0, i2 = i1 and thus the current flowing through all the resistors is the same.

25
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.5 With T0∞ and Tn∞ set at 200 ◦ C and 30 ◦ C respectively, and with
the steel plate initially at 200 ◦ C, plot the temperature at each end
of the plate against time. Check that your steady state values
agree with your previous results. Calculate the heat flow into and
out of the plate at steady state and comment on the result. What
do you notice about the steady state temperatures plotted against
distance?

Figure 16: Plot of the temperature at each end of the plate against time.

26
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

The steady state values for each node are listed below with the steel plate temperature at 200 ◦ C=473
K,

Node Temperature (K)


T0 315.6897 K
T1 315.0005 K
T2 314.3114 K
T3 313.6222 K
T4 312.9330 K
T5 312.2439 K
T6 311.5547 K
T7 310.8655 K

Table 9: List of steady state values of temperature for each node.

The heat flow was calculated by applying,

 
kA∆T
Q= (55)
L

where ∆T is the temperature difference across each lump.

The heat flow across each lump is tabulated in the table below,

Lump Heat flow, Q, (W)


Lump 1 224.73 W
Lump 2 224.73 W
Lump 3 224.73 W
Lump 4 224.73 W
Lump 5 224.73 W
Lump 6 224.73 W
Lump 7 224.73 W

Table 10: Heat flow across each lump of the system.

Since the system is at steady state, the total heat flow entering the plate (224.73W) flows from
lump to lump until it flows out of the plate and agrees with the previous results obtained in Q2.4.

27
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

The plot, shown below, of the steady state temperatures at each node against distance clearly
indicates that the temperature at each node is linearly reducing with the distance T0 , in steps of
1/L, and that a line of best fit would be able to connect all the points plotted.

However, since the system has been split into lumps of 0.1, the dominating temperature is at the
surfaces of these lumps and internally they exhibit a constant temperature gradient at steady state,
where the gradient is determined by the surface temperature at either ends of each lump (at both
nodes).

Figure 17: Plot of the temperature at each end of the plate against time.

28
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.6 Choose a method for verifying the accuracy of your results. De-
cide, and justify the degree of accuracy which is desired in the
simulations, bearing in mind the assumptions of the model, and
record the system tolerances that achieve this level of accuracy.

From the Taylor Series expansion, by neglecting terms of O(h2 ) and above, the Euler’s Method
maybe derived,
x(t + h) = x(t) + ẋ(t) · h + O(h2 ) (56)

This can be rewritten as,


Xn+1 = Xn + hf (Xn , tn ) + O(h2 ) (57)

Where the step by step error is of O(h2 ) and the total error is of O(h).

Considering the initial condition of X(0) = 473, and applying the differential equations derived
for the multiple-lumped parameter system would yield the temperature at Xn+1 . Since we are
interested in the steady state response of the system, when the system reaches steady state one can
d
consider that = 0.
dt
Therefore, it would be possible to solve the seven equations in this manner,

   
2 1 1 T1 T0∞
Ṫ0 = − + T0 + + =0 (58)
Cn Rn Rh0 Rn Rh0

 
−2Ti + Ti+1 + Ti−1
Ṫi = =0 (59)
Cn Rn

   
2 1 1 Tn∞ Tn−1
Ṫn = − + Tn + + =0 (60)
Cn Rhn Rn Rhn Rn

Therefore, the system of equations maybe evaluated to compute values for T0 with each iteration
and thereby being able to plot them against the step size h.

Since the step by step error (truncation error) is of O(h2 ), if the step size is halved, the error will
be quartered. This is related to the SIMULINK simulation since it is also based on an ODE solver
method belonging to the Runge-Kutta family of ODE solvers, and the tolerances that control the
accuracy of the ode45 (Dormand-Prince) solver are the relative and absolute tolerances.

By ensuring that these tolerances are reasonably small, even after considering the assumptions of
the model, the resulting simulation would be as accurate as reasonably possible.

29
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

2.7 With the parameters set as in Question 2.4, simulate the system
for 800s and put on a single graph plots of temperature against
time at each node. Plot the temperatures at each node versus
distance at 800s and comment on the result.

The system was simulated for 800s using the same parameters seen in Q2.4, and the plot of tem-
perature against time at each node is shown below,

Figure 18: Plot of the lot of temperature against time at each node, simulated for 800s.

Comparing this simulation with that of Figure (15), yields that the temperature rise to steady-state
does not appear to be as linear as first conceived. It can be seen that the thermal response to the
thermal conductivity of the plate is rather sluggish or slow starting.

However, the plot for T2 appears to be rather linear, compared to the response of the rest of the
nodes in this multiple-lumped parameter system.

30
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Since the simulation time is limited to 800s, steady state has not yet been reached and as such the
plot of the temperatures at each node versus distance, is no longer linear and therefore exhibits
curving from and including lump 3 to lump 7. Lump 1 and 2 seem to still exhibit a linear temperature
gradient, possibly since they are closest to the hotter surface.

Figure 19: Plot of temperatures at each node versus distance, simulated for 800s.

31
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

3 Focused Study of the Lorenz Model

Element A - Preliminary Analysis

3.1 Describe your chosen system. Show that the system has the po-
tential for exhibiting chaotic behaviour. Deduce the equations of
motion for the system you have chosen and write down your anal-
ysis, listing any approximations and assumptions you have made.
Rearrange your equations in state space form so that they can be
implemented in Simulink.

The state space equations describing the Lorenz model are shown below,

ẋ1 = σ(x2 − x1 ) (61)


ẋ2 = (1 + ρ − x3 )x1 − x2 (62)
ẋ3 = x1 x2 − βx3 (63)

Since the system has three state space equations, i.e. has three degrees of freedom, the first require-
ment for potentially exhibiting chaotic behaviour is satisfied.

The parameters σ and ρ are related to the Prandtl number and Rayleigh number, respectively, and
the third parameter β is a geometric factor. The only non-linear terms are x1 ρ and x1 x3 , in the
second and third equations.

This non-linearity satisfies the second requirement for a system to exhibit chaotic behaviour.

32
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

3.2 Attempt to predict general characteristics of the behaviour of the


system. For example, you may want to find the system equilib-
rium points, linearize around these points, and make deductions
on system stability around these points. Alternatively, there may
be analytical solutions available for special classes of initial con-
ditions.

The system equilibrium points are determined below,

σ(x2 − x1 ) = 0 x1 = x2 (64)

x1 x2 − βx3 x21 = βx3 and x22 = βx3 (65)

x21 x21 p
(1 + ρ − )x1 − x1 = 0 x1 (ρ − )=0 x1 = 0 or ± βρ (66)
β β

From Eq.(65) and Eq.(66),

x22 x22 p
(1 + ρ − )x2 − x2 = 0 x2 (ρ − )=0 x2 = 0 or ± βρ (67)
β β

From Eq.(65), Eq.(66), and Eq.(67),

βρ = βx3 x3 = ρ (68)

x3 = 0 (69)

Therefore the singularities are,

 √  √
− βρ
   
0 + βρ
√ √
x̂1 =  0  ; x̂2 =  + βρ  ; x̂3 =  − βρ  (70)
0 ρ ρ

33
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Linearizing the system yabout these three singular points yields,

∆ẋ = A∆x (71)

where,
δf1 δf1 δf1
 
 
 δx1 δx2 δx3  −σ σ 0
 
   
 δf δf2 δf2   
2
A=  =  (1 + ρ − x3 ) −1 −x1  (72)
   
 δx1 δx2 δx3   
   
 
 δf
3 δf3 δf3  x2 x1 −β
δx1 δx2 δx3

Thereby linearizing the system about the singularities,

   
−σ σ
0 −σ σ 0
   
   
A(1) = (1 + ρ − x3 ) −1 −x1  =  (1 + ρ) −1 0 (73)
   

   
 2 3
0
  

x2 x1 −β x̂=666 7 0 0 −β
4
0 7
7
5
0

   
−σ σ
0 −σ σ 0
   
   √ 
A(2) = (1 + ρ − x3 ) −1 −x1  = 1 −1 − βρ  (74)
   
 2 √
   
3
+ βρ √ √
  
x1 −β x̂=666 √

x2 7 βρ βρ −β
4
+ βρ 7
7
5
ρ

   
−σ σ 0
−σ σ 0
   
   √ 
A(3) = (1 + ρ − x3 ) −1 −x1  = 1 −1 βρ  (75)
   
 2 √
   
− βρ
3
√ √
  
x1 −β x̂=666 √

x2 7 − βρ − βρ −β
4
− βρ 7
7
5
ρ

34
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

The eigenvalue equations that determines the stability of each of these equilibrium points are
calculated as follows:

The eigenvalue equation is,


Ax = λx (76)

   
−σ σ 0 −σ − λ
σ 0

 



 1 0 0

 

|(A(1) − λI)| =  (1 + ρ) −1 0  − λ 0 1 0  =  (1 + ρ) −1 − λ 0  (77)
    
   
  0 0 1  

0 0 −β 0 0 −β − λ

 
−σ − λ σ

= (−β − λ)   = (−β − λ) {(−σ − λ)(−1 − λ) − σ(1 + ρ)}
(78)
(1 + ρ) −1 − λ

= −λ3 − λ2 (1 + β + σ) − λ(β + σβ − σρ) + σρβ = 0 (79)

Likewise,
|(A(2) − λI)| = −λ3 − λ2 (1 + β + σ) − λβ(1 + σ − ρ) − 2σρβ = 0 (80)

|(A(3) − λI)| = −λ3 − λ2 (1 + β + σ) − λβ(1 + σ − ρ) − 2σρβ = 0 (81)

It is clear that the stable singularity is A(0) , while A(1) and A(2) are complex and imaginary thereby
forming unstable focuses.

35
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

Element B - SIMULINK Model

3.3 Give a full description of your SIMULINK model.

The following SIMULINK model directly represents the following three state space equations,

ẋ1 = σ(x2 − x1 ) (82)


ẋ2 = (1 + ρ − x3 )x1 − x2 (83)
ẋ3 = x1 x2 − βx3 (84)

Therefore the parameters controlling the system, apart from the initial conditions of the three
integrator blocks which represent x1 (0), x2 (0), and x3 (0) respectively, are σ, ρ, and β.

Figure 20: SIMULINK Model to Simulate System Dynamics

The initial conditions and parameters have been chosen as follows,

Variables Values
x1 (0) 5
x2 (0) 5
x3 (0) 25
σ 10
β 8/3

Table 11: Chosen values of the initial conditions.

36
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

To counter the occurrence of clipping in the plots generated in MATLAB, the Relative and Absolute
tolerances were changed as shown in Figure 21, below.

Figure 21: SIMULINK: Simulation Configuration Parameters

The simulation was executed directly from the controlling *.m-file using the following MATLAB
command,

EDU>> sim(‘lab2q3 mdl’,50);

where the simulation was run for 50 seconds, which seemed to produce optimal plots.

37
7CEM2425 - DSS Lab 2: Report Wijetunge de Silva, Michael-Melhan
MSc Mechatronics 2007/8 ID: 0737855 / michael.desilva@kcl.ac.uk

3.4 Devise some tests to determine the accuracy of your solution,


and to check whether the model is working correctly. Give an
account of your tests and the results.

The system was simulated with ρ = 25, which was calculated to cause all the system equilibria to
be unstable.

The resulting plots were generated in 3-dimensions and are shown below,

Figure 22: 3D plot of the Lorenz model in the x1 -x3 , x2 -x3 , x1 -x3 and planes, respectively.

These plots verified that the SIMULINK model was worked correctly.

38
A Appendix
MATLAB Files for Q1

MATLAB Files for Q1


MATLAB Files for Q2

MATLAB Files for Q2


MATLAB Files for Q3

MATLAB Files for Q3

You might also like