Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Lecture O01
Ordinary Differential Equations (ODEs):!
Introduction & Taylor series!
(Pages 1-4 of the Printed Lecture Notes)!
(c)
(c)
OpenFoam
Supercomputer
x
(e)
(e)
Tues-afternoon
Wed-Workshop
Thu
Mar 3
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on
Linux/C++/ODEs
Lecture on ODEs
Prof Andrew Ooi
Mar 10
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 17
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Mar 24
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 31
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Apr 7
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Consultation for
A/Prof Malcolm Davidson Assignment 1
Lecture on PDEs
A/Prof Malcolm Davidson
Apr 14
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on OpenFOAM
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
Break
Break
Break
Apr 21
Break
Apr 28
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
May 5
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
10
May 12
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on OpenFOAM
Dr Stephen Moore
11
May 19
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
12
May 26
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Assignment 1 due!
18th April
Assignment 2 due!
30th May
Tues-afternoon
Wed-Workshop
Thu
Mar 3
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on
Linux/C++/ODEs
Lecture on ODEs
Prof Andrew Ooi
Mar 10
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 17
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Mar 24
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 31
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Apr 7
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Consultation for
A/Prof Malcolm Davidson Assignment 1
Lecture on PDEs
A/Prof Malcolm Davidson
Apr 14
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on OpenFOAM
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
Break
Break
Break
Apr 21
Break
Apr 28
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
May 5
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
10
May 12
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on OpenFOAM
Dr Stephen Moore
11
May 19
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
12
May 26
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Assignment 1 due!
18th April
Assignment 2 due!
30th May
Tues-afternoon
Wed-Workshop
Thu
Mar 3
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on
Linux/C++/ODEs
Lecture on ODEs
Prof Andrew Ooi
Mar 10
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 17
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Mar 24
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 31
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Apr 7
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Consultation for
A/Prof Malcolm Davidson Assignment 1
Lecture on PDEs
A/Prof Malcolm Davidson
Apr 14
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on OpenFOAM
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
Break
Break
Break
Apr 21
Break
Apr 28
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
May 5
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
10
May 12
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on OpenFOAM
Dr Stephen Moore
11
May 19
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
12
May 26
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Assignment 1 due!
18th April
Assignment 2 due!
30th May
Tues-afternoon
Wed-Workshop
Thu
Mar 3
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on
Linux/C++/ODEs
Lecture on ODEs
Prof Andrew Ooi
Mar 10
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 17
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Mar 24
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 31
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Apr 7
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Consultation for
A/Prof Malcolm Davidson Assignment 1
Lecture on PDEs
A/Prof Malcolm Davidson
Apr 14
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on OpenFOAM
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
Break
Break
Break
Apr 21
Break
Apr 28
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
May 5
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
10
May 12
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on OpenFOAM
Dr Stephen Moore
11
May 19
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
12
May 26
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Assignment 1 due!
18th April
Assignment 2 due!
30th May
Tues-afternoon
Wed-Workshop
Thu
Mar 3
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on
Linux/C++/ODEs
Lecture on ODEs
Prof Andrew Ooi
Mar 10
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 17
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Mar 24
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on ODEs
Lecture on OpenFOAM
Dr Stephen Moore
Mar 31
Lecture on ODEs
Prof Andrew Ooi
Lecture on ODEs
Prof Andrew Ooi
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Apr 7
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Consultation for
A/Prof Malcolm Davidson Assignment 1
Lecture on PDEs
A/Prof Malcolm Davidson
Apr 14
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on OpenFOAM
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
Break
Break
Break
Apr 21
Break
Apr 28
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
May 5
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
A/Prof Malcolm Davidson
10
May 12
Lecture on PDEs
A/Prof Malcolm Davidson
Lecture on PDEs
Workshop on PDEs
A/Prof Malcolm Davidson
Lecture on OpenFOAM
Dr Stephen Moore
11
May 19
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
12
May 26
Lecture on OpenFOAM
Dr Stephen Moore
Lecture on OpenFOAM
Dr Stephen Moore
Workshop on OpenFOAM
Lecture on OpenFOAM
Dr Stephen Moore
Assignment 1 due!
18th April
Assignment 2 due!
30th May
Assessment
10% Workshops
(weekly)
- 1%
- 11
10% Assignment
- ODE
& OpenFOAM
20% Assignment
- PDE
60%
& OpenFOAM
- ODE, PDE
- Exam
& OpenFOAM
Student comments
Open foam should be introduced in the workshops much earlier than they were
Last year, OpenFOAM workshops were not introduced until week 4
We will be introducing OpenFOAM workshop in week 3. There could also be
!
OpenFOAM material in workshops in weeks 1 and 2.
d
d
d
d
,
,
,
,
, ,t
N
3
2
dt
dt dt dt
=0
(O01.1)
(O01.2)
Example O01.1: For the ODEs shown below, state the order of
the ODE and if the ODE is linear/nonlinear. a, b and c are constants.!
2
d
d
2
(a) t
+ at
+b =c
2
dt
dt
2
d
(b) 2
dt
a 1
d
+
dt
=0
Linear
Linear
Linear Linear
d2
dt2
Linear
d
+
dt
a 1
d
a
+
dt
2d
Linear
dt
=0
=0
Linear
Nonlinear
d2
dt2
Linear
d
+
dt
a 1
d
a
+
dt
2d
Linear
dt
=0
=0
Linear
Nonlinear
d
= f (t, )
dt
(O01.3)
tmin t tmax
with the initial condition
(tmin ) =
Initial Value Problem
min
d
= f (t, )
dt
tmin t tmax
(tmin ) =
min
a
em
h
t
a
tica
th
l Me
ods
Compare
Nu
me
rica
l/C
om
put
er M
eth
ods
Approximate solution
d
= f (t, )
dt
tmin t tmax
(tmin ) =
min
Example O01.2:
a
em
h
t
a
tica
th
l Me
ods
Compare
Nu
me
rica
l/C
om
put
er M
eth
ods
Approximate solution
!
Solve the following ordinary differential equation (ODE)!
!
!
d
(O01.4)
!
=1
dt
!
with (t=0)=0. Use MATLAB to plot the solution for 0 < t < 8.
d
=1
dt
d
+
dt
=1
td
dt
+e
d t
e
dt
Integrating gives
=e1
=e
=e +K
e 0=e +K
10=1+K
K= 1
=1
function MPO01p2()
!
!
t=0:0.1:8;
phi=1-exp(-t);
!
plot(t,phi);
!
xlabel('t');
ylabel('\phi(t)');
1-e-8.0
1-e-0.2
1-e-0.0
1-e-0.1
1-e-0.3
1
0.9
0.8
0.7
(t)
0.6
0.5
0.4
0.3
0.2
0.1
0
4
t
=1
1
0.9
0.8
0.7
Exact solution
d
= f (t, )
dt
tmin t tmax
(tmin ) =
min
al M
Ma
the
tic
ma
0.6
(t)
ods
eth
0.5
0.4
0.3
0.2
0.1
Compare
Nu
me
rica
l/C
om
put
er M
eth
ods
Approximate solution
4
t
d
= f (t, )
dt
tmin t tmax
(tmin ) =
min
Nu
me
rica
l/C
om
put
er M
eth
ods
Approximate solution
Taylor series
The Taylor series expansion of a function (t) about the point
tl can be written as
1
l+1
l n n
X
(t
t
) d
l+1
(t ) =
n
n!
dt
n=0
(O01.5)
tl
tl+1=tl+t.
l+1
td
) = (t ) +
1! dt
l
tl
t2 d 2
+
2! dt2
tl
t3 d 3
+
3! dt3
+ ...
tl
(O01.6)
Example O01.3:
!
!
!
(t) = sin(t)
Plot the first few terms of this function and show that you can get closer to the
original function if you use the more terms in the series.
tl
t2 d 2
+
2! dt2
tl
t3 d 3
+
3! dt3
t2 d 2
+
2! dt2
0
t3 d 3
+
3! dt3
0
(0)=sin(0)=0!
d/dt(0)=cos(0)=1.0!
d2/dt2(0)=-sin(0)=0.0!
d3/dt3(0)=-cos(0)=-1.0!
d4/dt4(0)=sin(0)=0.0!
d5/dt5(0)=cos(0)=1.0
+ ...
0
+ ...
tl
tl
t2 d 2
+
2! dt2
tl
t3 d 3
+
3! dt3
t2 d 2
+
2! dt2
0
t3 d 3
+
3! dt3
0
(0)=sin(0)=0!
d/dt(0)=cos(0)=1.0!
d2/dt2(0)=-sin(0)=0.0!
d3/dt3(0)=-cos(0)=-1.0!
d4/dt4(0)=sin(0)=0.0!
d5/dt5(0)=cos(0)=1.0
+ ...
0
+ ...
tl
(t) =
sin(t) =
(1/6)t
+(1/120)t
(1/5040)t
+...
(t) = t
t
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
4
0
t
(t) = t (1/6)t3
t(1/6) t3
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
4
0
t
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
4
0
t
1
0.8
0.6
0.4
0.2
0
0.2
0.4
0.6
0.8
1
4
0
t
can be written as
2 2
t
d
t
d
l+1
l
l
(t ) = (t ) +
(t ) +
(1 )
2
1! dt
2! dt
(O01.7)
or
(t
l+1
td
) = (t ) +
(2 )
1! dt
l
(O01.8)
2 2
3 3
4 4
t
d
t
d
t
d
t
d
l+1
l
l
l
l
l
(t ) = (t ) +
(t ) +
(t
)
+
(t
)
+
(t
) + ...
2
3
4
1! dt
2! dt
3! dt
4! dt
2 2
t
d
t
d
l+1
l
l
(t ) = (t ) +
(t )+
()
1! dt
2! dt2
2 2
3 3
4 4
t
d
t
d
t
d
t
d
l+1
l
l
l
l
l
(t ) = (t ) +
(t ) +
(t
)
+
(t
)
+
(t
) + ...
2
3
4
1! dt
2! dt
3! dt
4! dt
2 2
t
d
t
d
l+1
l
l
(t ) = (t ) +
(t )+
()
1! dt
2! dt2
Exercise O01.4:
!
!
(t) = sin(t)
!
!
! show the validity of Eqs. (O01.7) & (O01.8) by finding !
(t
l+1
) = (t ) +
l+1
t
=t + t
l
l+1
t 2 t
d
t (2 )
dt
(t
l+1
) = (t ) +
l+1
d
t (2 )
dt
t
=t + t
tl 2 tl+1
t
= 0 + /2 = /2
(tl ) = sin(tl ) = sin(0) = 0
(t
l+1
) = sin(t
l+1
d
(2 ) = cos (2 )
dt
) = sin(/2) = 1
1 = 0
+ /2 cos (2 )
1 = 0 + /2 cos (2 )
0 2 /2
Illustrate graphically
d
t (2 = 0)
dt
1.8
sin(0) +
1.6
1.4
d
(2 = 0)
dt
1.2
1
0.8
sin(/2)
0.6
= sin(t)
0.4
0.2
0
sin(0)
0.2
0.4
sin(0) +
0.6
0.8
1
t
1.2
1.4
1.6
/2
1.8
d
t (2 = 0) > sin(/2)
dt
2
1.8
1.6
1.4
1.2
sin(/2)
1
0.8
0.6
0.4
0.2
0
0.2
d
(2 = /2)
dt
t
0.4
sin(0)
sin(0) +
0.6
0.8
1
t
1.2
= sin(t)
1.4
1.6
sin(0) +
1.8
d 2
t (2 = /2)
dt
d
t (2 = /2) < sin(/2)
dt
2
1.8
sin(0) +
1.6
d
t (2 = 1.2)
dt
1.4
1.2
sin(/2)
1
0.8
d
(2 = 1.2)
dt
t
0.6
0.4
0.2
0
sin(0)
0.2
0.4
0.6
0.8
1
t
1.2
= sin(t)
1.4
1.6
1.8
2
1.8
sin(0) +
1.6
d
t (2 = 1.2)
dt
1.4
1.2
sin(/2)
1
0.8
d
(2 = 1.2)
dt
t
0.6
0.4
0.2
0
sin(0)
0.2
0.4
sin(0) +
0.6
0.8
1
t
1.2
= sin(t)
1.4
1.6
1.8
d
t (2 = 1.2) 6= sin(/2)
dt
sin(0) +
1.6
d
t (2 = 0)
dt
1.8
1.4
1.2
sin(/2)
0.6
2 = 0
0.2
0
0.2
0.4
0.6
0.8
1
t
1.2
1.4
1.6
1.8
sin(0) +
1.8
1.4
1.2
d
(2 )
dt
d
(2 )
dt
1.6
sin(0) +
0.8
2 = /2
0.6
0.4
sin(0) +
0.2
0
0.8
0.4
sin(0) +
0.2
0.4
0.6
0<2<p/2.
d
(2 = /2)
dt
0.8
1
t
1.2
1.4
1.6
1.8
d
t (2 ) = sin(/2)
dt
2 = 0.8807
2 = 0.0
2 = 0.7
2 = 0.5
2 = 0.8807