Anda di halaman 1dari 17

BEE 31602

Sem II 14/15

CHAPTER 4 ORDINARY AND PARTIAL DIFFERENTIAL EQUATION

ORDINARY DIFFERENTIAL EQUATION (ODE)

4.1

INITIAL-VALUE PROBLEM (IVP)

Q1

Consider the following initial-value problem (IVP)

dy
3x 2 y, y(0) 1.
dx
Solve the IVP for 0 x 0.6 and h 0.2 by using Eulers method and RK4 method.

Q2

Consider the following initial-value problem (IVP)

(1 x 2 )

dy
xy 0, y(2) 5.
dx

Solve the IVP for 2 x 2.3 and h 0.1 by using Eulers method and RK4 method.

Q3

Solve the following ordinary differential equation


dy
y 2 x ,
dx

y(0) 1

with uniform step size h 0.1 over interval [0, 0.3] by using Eulers method and RK4
method.

Q4

Given an initial-value problem (IVP) as follows

dy
1.2 y 7e 0.3 x, y(0) 3.
dx
Solve the IVP by using Eulers method at x 0 (0.5) 2.

BEE 31602
Q5

Sem II 14/15

The concentration of a chemical in a batch reactor can be modeled by the following


differential equation
k1C
dC

, C (0) 0.8.
dt 1 k2C

Find a numerical solution for this problem at t 1 s with k1 1, k2 0.3 and step length,
h 0.5 by using Eulers method and classical fourth-order Runge-kutta method.

Q6

Velocity of a falling object can be modeled as the following initial-value problem (IVP)

dv cd 2
v g , v(0) 20
dt m
where v velocity of the falling object (m/s), t time (s), g acceleration due to
gravity (9.81 m/s2), m mass (kg) and cd drag coefficient (kg/m). Initially, the object
was at v 20 m/s with cd 0.225 . Calculate the velocity for a falling 5-kg object at
t 0 (0.1) 0.5 s by using Eulers method.

Q7

A voltage source, E (t ) is supplied to an electrical circuit with inductance L and a


resistance R . If the switch is closed at t 0 s, the current I (t ) will satisfy the following
initial-value problem (IVP)

d
I (t ) RI (t ) E (t ), I (0) 0.
dt

Parameter values are given as L 50 H, R 20 and E (t ) 10 V. Estimate the value


of the current at t 0 (1) 5 s by using Eulers method.

BEE 31602

Sem II 14/15

4.2

BOUNDARY-VALUE PROBLEM (BVP)

Q8

Given the boundary-value problem (BVP)

x 4 x sin t , 0 t 1
with conditions x(0) 0 and x(1) 0 . Solve the BVP by using finite difference method
by taking t h 0.25 .

Q9

Given the boundary-value problem (BVP)

d2y
dy
4 x 0,
2
dx
dx

0 x2

with conditions y(0) 0 and y (2) 1. Solve the BVP by using finite-difference method
by taking x 0.5.

Q10

Q11

Solve the boundary-value problem (BVP), y xy 3 y 11x with conditions y (0) 1


and y (1) 2 where h 0.25 by using finite-difference method.

The boundary-value problem (BVP) for the steady-state temperature in a rod of length 2
m is represented as follows
d 2T
0.1T 0,
dx 2

T (0) 2000 C , T (2) 1000 C .

Approximate the temperature, T throughout the rod for x h 0.5 by using finitedifference method.

BEE 31602
Q12

Sem II 14/15

A heated rod with a uniform heat source can be modeled with the Poisson equation,

d 2T
f ( x).
dx 2
Given the heat source, f ( x) 25 and the boundary conditions, T ( x 0) 40 and
T ( x 10) 200. Solve for the temperature distribution with h x 2.5 by using finitedifference method.

Q13

The position of a falling object is governed by the following boundary-value problem


(BVP)
d 2 x c dx

g 0 , for 0 t 12,
dt 2 m dt

where boundary conditions are x (0) 0 and x (12) 500. Given that the parameter
values are c a first-order drag coefficient ( 12.5 kg/s ), m mass of the falling object
(50 kg ) and g gravitational acceleration ( 9.81 m/s 2 ) . Approximate the position of
the falling object, x (m) for h 3 by using finite-difference method.

Q14

A thin rod of length, l is moving in the xy-plane. The rod is fixed with a pin on one end
and a mass at the other end. This system is represented in the form of boundary-value
problem (BVP) as follows

g
l

(t ) (t ) 0 , for 0 t 0.4 ,
where boundary conditions are (0) 0 and (0.4) 1 . The parameter values
are given as g gravitational force (9.81 m/s 2 ) and l 0.9 m. Approximate the angle
(in radian) for h 0.1 by using finite-difference method.

BEE 31602

Sem II 14/15

PARTIAL DIFFERENTIAL EQUATION (PDE)

4.3

Heat equation (explicit finite-difference method)

Q15

Given the heat equation

u
2u
0.9 2 , 0 x 1, t 0
t
x
with the boundary conditions, u(0, t ) u(1, t ) 1 for t 0 , and the initial condition,
u ( x, 0) e x (1 x ) for 0 x 1 . Find u( x,0.01) and u ( x, 0.02) by using explicit finitedifference method with x h 0.2.

Q16

Given the heat equation

u( x, t )
2 u ( x, t )
2
, 0 x 2, t 0,
t
x 2
with the boundary conditions

and the initial condition

u(0, t ) u (2, t ) 0,
u ( x,0) sin(x).

Find u ( x, 0.3) by using explicit finite-difference method with x 0.5 and t 0.3.

BEE 31602
Q17

Sem II 14/15

Consider the heat conduction equation

2
T ( x, t ) 2 T ( x, t ),
t
x

0 x 10, t 0 ,

where is thermal diffusity 10, since c 2 .


Given the boundary conditions,
T (0, t ) 0, T (10, t ) 100

and initial condition,


T ( x, 0) x 2 .

By using explicit finite-difference method, find T ( x, 0.055) and T ( x, 0.11) with 5 grid
intervals on the x coordinate.

Q18

The temperature distribution u( x, t ) of one dimensional silver rod is governed by the heat
equation
u
2u
2 2
t
x
with 2 is thermal diffusity =1.71.
Given the initial condition,
0 x 2,
x,
u ( x,0)
4 x, 2 x 4.

and boundary conditions,


u (0 , t ) t , u (4, t ) t 2 .

Find the temperature distribution of the rod with x h 1 and t k 0.2 for
0 t 0.4 by using explicit finite-difference method.

BEE 31602

Sem II 14/15

4.4

Wave equation (finite-difference method)

Q19

Let u( x, t ) be the displacement of uniform wire which is fixed at both ends along x -axis
at time t . The distribution of u( x, t ) is given by the wave equation

2u
2u
4 2 , 0 x 1 , 0 t 0.5
t 2
x
with the boundary conditions u(0, t ) u(1, t ) 0 and the initial conditions
u
u( x, 0) sin x ,
( x, 0) 0 for 0 x 1 . Solve the wave equation up to level t 0.2
t
by using finite-difference method with x h 0.25 and t k 0.1

Q20

Let y ( x, t ) denotes displacement of a vibrating string. If T is the tension of the string,


is the weight per unit length and g is acceleration due to gravity, then y satisfies the
equation
2 y Tg 2 y

t 2 x 2

, 0 x 2 , t 0.

Suppose a particular string with 2 m long is fixed at both ends. By taking T 1.5 N,
0.01 kg/m and g 10 m/s2 , use finite-difference method to solve for y up to
second level.
The initial conditions are
, 0 x 1
0.5 x
y ( x,0)
1 0.5 x , 1 x 2

and

y
( x , 0 ) x2 2 x .
t

Perform all calculations with h x 0.5 m and k t 0.01 s.

BEE 31602
Q21

Sem II 14/15

The air pressure u ( x, t ) in an organ pipe is governed by the wave equation


2u 1 2u

,
t 2 2 x 2

0 x l , t 0,

where l is the length of the pipe and is a physical constant. If the pipe is closed at the
end where x l , the boundary conditions are
u (0, t ) 0.9 and u(l , t ) 0.9

for 0 t 0.2.

Assume that 1, l 0.5 and the initial conditions are


u ( x, 0) 0.9 cos (2 x) and

u
( x, 0) 0
t

for 0 x 0.5.

Approximate the pressure for the closed-pipe by using finite-difference method with
h x 0.1 and k t 0.1.

Q22

The longitudinal vibration of a bar with the length of l m is governed by

c2
with c

2 2

x 2 t 2

, where ( x, t ) is the axial displacement, E is Youngs modulus and

is the mass density of the bar. The boundary conditions and the initial conditions are
given as follows,

(0, t ) (l , t ) 0 for 0 t 0.04


( x,0) 0 and

( x,0)
x for 0 x 20.
t

Determine the variation of the axial displacement of the bar by using finite-difference
method with the following data:
E 30 106 , 0.264 , l 20 m, x h 5 and t k 0.02.

BEE 31602

PARTIAL DIFFERENTIAL EQUATION (PDE)

4.3

Heat equation (explicit finite-difference method)

Q15

Refer to class note

Q16

Sem II 14/15

BEE 31602

Sem II 14/15

Q17
t
0.11

0.055

T0,2

T1,2

T2,2

T3,2

T4,2

T5,2

T0,1

T1,1

T2,1

T3,1

T4,1

T5,1

T2,0

T3,0

T4,0

T5,0

T0,0
T1,0
0

x
4

2
T ( x, t ) 2 T ( x, t ),
t
x

10

0 x 10, t 0

T
2T
10 2
t
x
Ti , j 1 Ti , j
T 2Ti , j Ti 1, j
10 i 1, j
k
h2
Ti , j 1 Ti , j
T 2Ti , j Ti 1, j
10 i 1, j
0.055
22
Ti , j 1 Ti , j 0.138 Ti 1, j 2Ti , j Ti 1, j

0.138Ti 1, j 0.276Ti , j 0.138Ti 1, j


Ti , j 1 0.138Ti 1, j 0.276Ti , j 0.138Ti 1, j Ti , j
Ti , j 1 0.138Ti 1, j 0.724Ti , j 0.138Ti 1, j
0.138 A 0.724 B 0.138C

1
= Ti,j+1

0.138
(A) Ti-1,j

0.724
(B)

0.138
Ti,j

(C) Ti+1,j

BEE 31602

Sem II 14/15

T0,2

T1,2

T2,2

T3,2

6.056

18.208

38.208

66.056

100

T1,1

T2,1

T3,1

T4,1

T5,1

5.104

17.104

37.104

65.104

100

T1,0

T2,0

T3,0

T4,0

T5,0

T4,2

T5,2

0.11
0

T0,1
0.055
0

T0,0
0

2
0

Q18

4
4

6
16

8
36

10
64

100

BEE 31602

Sem II 14/15

4.4

Wave equation (finite-difference method)

Q19

Refer to class note

Q20

2 y Tg 2 y

, 0 x 2 , t 0 where T 1.5 , 0.01 and g 10 .


t 2
x 2

2 y
2 y
1500 2
t 2
x
y i , j 1 2 y i , j y i , j 1
(k )

y i , j 1 2 y i , j y i , j 1
(0.01) 2

1500

1500

y i 1, j 2 y i , j y i 1, j
( h) 2
y i 1, j 2 y i , j y i 1, j
(0.5) 2

yi , j 1 2 yi , j yi , j 1 0.6( yi 1, j 2 yi , j yi 1, j )

yi , j 1 0.6( yi 1, j 2 yi , j yi 1, j ) yi , j 1 2 yi , j
yi , j 1 0.6 yi 1, j 0.8 yi , j 0.6 yi 1, j yi , j 1

------ (1)

1
= yi,j+1

0.6
(A) yi-1,j

0.8
(B)

0.6
yi,j

-1

yi , j 1 yi , j 1

(D) yi,j-1

x( x 2)
2k
yi , j 1 yi , j 1 0.02 x( x 2)
yi , j 1 yi , j 1 0.02 x( x 2)

------ (2)

(C) yi+1,j

BEE 31602

Sem II 14/15

Substitute eqn. (2) into eqn. (1):

yi , j 1 0.6 yi 1, j 0.8 yi , j 0.6 yi 1, j yi , j 1


0.6 yi 1, j 0.8 yi , j 0.6 yi 1, j ( yi , j 1 0.02 x( x 2))
2 yi , j 1 0.6 yi 1, j 0.8 yi , j 0.6 yi 1, j 0.02 x( x 2)
yi , j 1 0.3 yi 1, j 0.4 yi , j 0.3 yi 1, j 0.01x( x 2)

1
= yi,j+1

0.3

0.4

(A) yi-1,j

(B)

0.01x(x-2)

0.3
yi,j

(C) yi+1,j

y0,2

y1,2

y2,2

0.148

0.064

y0,1

y1,1

y2,1

0.243

y0,0

y1,0

y3,2

y4,2

0.148

y3,1

y4,1

0.340

0.243

y2,0

y3,0

y4,0

0.02

0.01

0.5
0

1.0
0.25

1.5
0.5

2.0
0.25

BEE 31602
Q21

2u 1 2u
2u 2u

,
where

t 2 2 x 2
t 2 x 2

ui , j 1 2ui , j ui , j 1
2

ui 1, j 2ui , j ui 1, j

(0.1)
(0.1) 2
ui , j 1 2ui , j ui , j 1 ui 1, j 2ui , j ui 1, j
ui , j 1 ui 1, j ui 1, j ui , j 1 A B C (Calculator formula)
Representation in molecule graph (calculating level 2):

1
= u,j+1
1

(A) ui-1,j

(B) ui+1,j
1

(C) ui,j-1
Given ut ( x, 0) 0
ui , j 1 ui , j 1

0
2(0.1)
ui , j 1 ui , j 1 ----------- (1)

Substitute (1) into ui , j 1 ui 1, j ui 1, j ui , j 1 :

ui , j 1 ui 1, j ui 1, j ui , j 1
2ui , j 1 ui 1, j ui 1, j
ui , j 1 0.5ui 1, j 0.5ui 1, j 0.5 A 0.5B (Calculator formula)
Representation in molecule graph (calculating level 1):

1
= ui,j+1
0.5
(A) ui-1,j

0.5
(B) ui+1,j

Sem II 14/15

BEE 31602

Sem II 14/15

Thus, pressure of the closed pipe is given as follows:

u1,2

u2,2

u3,2

u4,2

u5,2

0.2 0.9

u0,1

0.397
u1,1

0.086
u2,1

0.086
u3,1

0.397
u4,1

0.9
u5,1

0.9
u0,0

0.589
u1,0

0.225
u2,0

0.225
u3,0

0.589
u4,0

0.9
u5,0

0.9

0.729

0.278

0.278

0.728

0.9

u0,2

0.1
0

Q22

2
E
2 2
2
2
with c
c

c
,
0

20
,
t

x 2 t 2
t 2
x 2

Given

c 2 113.636 10 6

i , j 1 2i , j i , j 1
k2

i , j 1 2i , j i , j 1

113.636 106
113.636 106

i 1, j 2i , j i 1, j
h2

i 1, j 2i , j i 1, j

0.022
52
i , j 1 2i , j i , j 1 1,818.182(i 1, j 2i , j i 1, j )

i , j 1 1818.182i 1, j 3634.364i , j 1818.182i 1, j i , j 1

------ (1)

1818.182 A 3634.364 B 1818 .182C D

1
i,j+1
=

1,818.182
(A) i-1,j

-3,634.364
(B)

i,j

-1
(D) i,j-1

1,818.182
(C) i+1,j

BEE 31602

Sem II 14/15

( x,0)
x
t

i , j 1 i , j 1
2k

i , j 1 i , j 1
2(0.02)

i , j 1 i , j 1 0.04 x

------ (2)

Substitute eqn. (2) into eqn. (1):

i , j 1 1818.182i 1, j 3634.364i , j 1818.182i 1, j (i , j 1 0.04 x)


i , j 1 909.091i 1, j 1817 .182i , j 909.091i 1, j 0.02 x
909.091 A 1817 .182 B 909.091C 0.02 x

1
=

909.091
(A) i-1,j

i,j+1

-1,817.182
(B)

i,j

909.091
(C) i+1,j

0.02x

BEE 31602

Sem II 14/15

0,2

1,2

2,2

3,2

4,2

0.04
0

0.2

0.4

0.6

0,1

1,1

2,1

3,1

4,1

0.1

0. 2

0.3

2,0

3,0

4,0

0.02

0,0
0
20

1,0
5

0
0

10
0

15
0

Anda mungkin juga menyukai