Professional Documents
Culture Documents
,',/$011/'+&2#
"#$% !& #'(#)*+&,- ./0%&%1"# 2*/,.%%3$$*/4 2/.1/#$ 345 *52.,+
+"# )--) $&0(2,&2# $3. $&6# 7)83. (2,,) ',-%.,',/9
:0#$83(; 80#$,)., 345 1#3/#). 2--2# 80#$3./6,/9
:0#$-2()#29
<#),$8)#2 =3. ),,), %, 80#$-2()#2,>9
?11/'+&2,$ ,).,9
@,-%.,',/$()&0.9
A)/BC' 5)# +"-D& 52(2#$83(2E2, 16 )C(2-,',/2, +"# F0.2#'$8 G,)-H$ ,%# 011/'+&2, 0&+"#&$
F).,&248,',/=)#>
:0#$-2()#2,$ $'/,)&0#9 I2(".,',/B72&H/9
Kungliga Tekniska hgskolan
KTH SCI, Lindstedtsvgen 25, 100 44 Stockholm. Tel: 08-790 80 50. Fax: 08-723 17 88.
E-post: elevexp@math.kth.se
Cover page for assignments
Name, personal number, program and email for all students behind this submission :
Pierre-Alexandre BEAUFORT, 920104-T093, master in mathematical engineering, beaufort@kth.se
Hadrien VAN LIERDE, 920909-T058, master in mathematical engineering, hvl@kth.se
Course code, course name and program or course set :
DN2221, Applied numerical methods - part 1, master of sciences in engineering
Teacher: Examiner:
Lennart EDSBERG Ashraful KADIR
Task name: Deadline:
Computer Lab 1 - ODE-systems of LCC-type and stability September 19th 2013
I/We have followed the Code of Honour of the Department of Numerical Analysis
when the task was performed.
Signature(s):
Teacher of the
courses signature:
Assessment/Rating:
Kungliga Tekniska hogskolan
KTH SCI, Lindstedtsvagen 25, 100 44 Stockholm. Tel: 08-790 80 50. Fax: 08-723 17 88.
e-mail : elevexp@math.kth.se
Contents
1 Solution of ODE-systems with constant coecients . . . . . . . . . . . . . . . . 1
2 Stability of ODE-systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 Stability of the solutions of an ODE-system of LCC-type . . . . . . . . . 3
2.2 Stability of critical points of a nonlinear ODE-system . . . . . . . . . . . 7
A Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
A.1 Marginal and asymptotic stability . . . . . . . . . . . . . . . . . . . . . . 8
A.2 DN2221_lab1_Part1.m . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
A.3 DN2221_lab1_Part2a1.m . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
A.4 DN2221_lab1_Part2a2.m . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
A.5 DN2221_lab1_Part2b.m . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
0
1 Solution of ODE-systems with constant coecients
In this section, we analyze a simple electric circuit with following components in series :
a voltage source of size E = 10[V ]
a resistance R = [0.1 1 10 100]
T
[]
an inductance L = 0.1[H]
a capacitance C = 0.1[F]
We are going to observe the behaviour of the circuit with dierent values of R.
First, for t < 0 the circuit is open. Then, at t = 0 it is closed and thus the current i(t) = q(t)
starts to go through the circuit according to the following dierential equation :
L q +R q +
1
C
q = E
with initial contions : u
0
_
q(t = 0) = 0
i(t = 0) = 0
We can rewrite this scalar ODE as a system of rst ODEs :
du
dt
= Au +
_
_
dq
dt
= i
di
dt
=
1
L
_
(Ri +
q
C
) +E
_
with u = [q i]
T
, A =
_
0 1
1
LC
R
L
_
and = [0
E
L
]
T
.
Therefore, we know that
u(t) = u
H
(t) +u
p
(t)
where u
H
is the solution of the corresponding homogeneous ODEs-system and u
p
is a particular
solution of the nonhomogeneous ODEs-system.
Straightaway, we write :
u
H
(t) = exp(At) d
where d will be determined in regard with the initial conditions applied to u.
A particular solution of u is :
u
p
(t) = A
1
1
Now, we have to determine d in regard with the initial conditions :
u
0
=
_
0
0
_
= I d +
_
EC
0
_
= d =
_
EC
0
_
Finally, we obtain :
u(t) = exp(At)d A
1
The MatLab function that computes and displays solution of ODE is available in appendix A.2.
Figure 1 illustrates solutions for dierent values of R.
1. A
1
=
_
RC LC
1 0
_
1
0 5 10 15 20
0
0.5
1
1.5
2
2.5
Charge for R = 0.1ohm
Time [s]
C
h
a
r
g
e
[
C
]
0 5 10 15 20
10
8
6
4
2
0
2
4
6
8
Current for R = 0.1ohm
Time [s]
C
u
r
r
e
n
t
[
A
]
0 5 10 15 20
0.8
1
1.2
1.4
1.6
1.8
2
2.2
Charge for R = 1ohm
Time [s]
C
h
a
r
g
e
[
C
]
0 5 10 15 20
6
5
4
3
2
1
0
1
Current for R = 1ohm
Time [s]
C
u
r
r
e
n
t
[
A
]
0 5 10 15 20
1
1.2
1.4
1.6
1.8
2
2.2
Charge for R = 10ohm
Time [s]
C
h
a
r
g
e
[
C
]
0 5 10 15 20
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
Current for R = 10ohm
Time [s]
C
u
r
r
e
n
t
[
A
]
0 5 10 15 20
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
Charge for R = 100ohm
Time [s]
C
h
a
r
g
e
[
C
]
0 5 10 15 20
0.1
0.09
0.08
0.07
0.06
0.05
0.04
0.03
0.02
0.01
0
Current for R = 100ohm
Time [s]
C
u
r
r
e
n
t
[
A
]
Figure 1: Plot of solutions : rst row, charge q[C] in function of time t[s] and second row,
current i[A] in function of time t[s]. Solutions are displayed in respect for R = [0.1 1 10 100]
. Here, t = linspace(0,20,500).
2
2 Stability of ODE-systems
2.1 Stability of the solutions of an ODE-system of LCC-type
Lets consider the following initial value problem:
y
+ 3y
+ 2y
+Ky = 0, y(0) = 1, y
(0) = 1, y
(0) = 1. (1)
We rewrite this equation as the following system of rst order equations:
_
_
y
1
= y
2
y
1
(0) = 1
y
2
= y
3
y
2
(0) = 1
y
3
= 3y
3
2y
2
Ky
1
y
3
(0) = 1
(2)
We can also write this system in a vector form introducing the following notation:
A =
_
_
0 1 0
0 0 1
K 2 3
_
_ (3)
We obtain the following system in a vector form:
u
of a non-
linear ODE-system
du
dt
= f (u; t) is a point such that f(u
_
x
= 5x + 4y xz
y
= x + 4y yz
z
= x
2
+y
2
89
with J
f
=
_
_
_
5 z 4 x
1 4 z y
2x 2y 0
_
_
_
where J
f
is the jacobian of f.
We compute the critical points by using Newtons method :
J
f
(u
i
) u
i
= f(u
i
)
u
i+1
= u
i
+ u
i
where J
f
(u
i
), f(u
i
) and u
i
are known.
Newtons method is an iterative method to compute a solution of a nonlinear system of equa-
tions. Here, we want to compute solutions with 5 pertinent decimals (about its coordinates). We
know there are 4 critical points and they are near (8; 5; 2), (8; 5; 2), (9; 3; 7) and (9; 3; 7).
These points are our initial points for Newtons method. Besides, we can analyze the stability
of a critical point from its jacobian. A critical point is asymptotically stable if and only if its
jacobian is negative denite
6
.
The MatLab function computes critical point is available in appendix A.5. We obtain the
following critical points :
(x; y; z) J
f
Stability
(7.94457; 5.08761; 2.43844)
_
_
_
2.56155 4 7.94457
1 1.56155 5.08761
15.88914 10.17522 0
_
_
_
10
15
13.34166i
10
15
+ 13.34166i
4.1231
Unstable
(7.94457; 5.08761; 2.43844)
_
_
_
2.56155 4 7.94457
1 1.56155 5.08761
15.88914 10.17522 0
_
_
_
10
15
13.34166i
10
15
+ 13.34166i
4.1231
Unstable
(8.78805; 3.43075; 6.56155)
_
_
_
1.56155 4 8.78805
1 2.56155 3.43075
17.57611 6.8615 0
_
_
_
0 13.34166i
0.0... 13.34166i
4.1231
Stable
(8.78805; 3.43075; 6.56155)
_
_
_
1.56155 4 8.78805
1 2.56155 3.43075
17.57611 6.8615 0
_
_
_
0 13.34166i
0.0... 13.34166i
4.1231
Stable
We note that the two last critical points have both a jacobian with 2 eigenvalues whose real
parts are near zero. But since MatLab returns 0.0..., we concluded that these two points are
asymptotically stable. Nevertheless, if we consider these eigenvalues have a zero real part, these
points are marginally stable as their associated jacobian are diagonalizable.
6. For further details see proposition 1
7
A Appendix
A.1 Marginal and asymptotic stability
In the section 1, we introduced the terms "asymptotically" and "marginally" stable. Here are
the denitions of these two concept
7
1. Marginal stability
Given R
n
an open set, f : R
n
a vector eld and t
0
R, then the point u
0
is
marginally stable (in the sense of Lyapunov) if
> 0, > 0 such that , x B(u
0
, ),
there exists a dierentiable function u : [t
0
, [R
n
such that t t
0
,
u(t) B(u
0
, )
u
(t) = f(u(t))
u(t
0
) = x
(6)
2. Asymptotic stability
Given R
n
an open set, f : R
n
a vector eld and t
0
R, then the point u
0
is
asymptotically stable if
it is marginally stable
there exists > 0 such that x B(u
0
, ),
if u is a solution of
_
_
_
u
(t) = f(u(t)) t [t
0
, [
u(t
0
) = x
(7)
then lim
t
u(t) = u
0
One can show that if a point u
0
is stable, then it has to be a critical point what means
that f(u
0
) = 0. In the case of an homogeneous system of dierential equation with constant
coecients of the type u