Quiz 08ode Finitediff Solution

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Multiple-Choice Test

Finite Difference Method


Ordinary Differential Equations
COMPLETE SOLUTION SET
1. The exact solution to the boundary value problem
d2y
2
= 6 x − 0.5 x 2 , y (0 ) = 0 , y (12 ) = 0
dx
for y (4 ) is
(A) − 234.67
(B) 0.00
(C) 16.000
(D) 37.333

Solution
The correct answer is (A).

First separate the variables.


d2y
2
= 6 x − 0.5 x 2
dx
d ⎛ dy ⎞
⎜ ⎟ = 6 x − 0.5 x
2

dx ⎝ dx ⎠

= ∫ (6 x − 0.5 x 2 )dx
dy
dx
6 x 2 0.5 x 3
= − +C
2 3
0.5 3
= 3x 2 − x +C
3
⎛ 0.5 3 ⎞
y = ∫ ⎜ 3x 2 − x + C ⎟dx
⎝ 3 ⎠
3 0.5 4
= x3 − x + Cx + D
3 12
0.5 4
= x3 − x + Cx + D
12

Set y (0 ) = 0 to solve for D.


0 .5 4
y (0 ) = 0 3 − ×0 +C×0+ D
12
0=D
Set y (12 ) = 0 to solve for C.
0.5
y (12 ) = 12 3 − × 12 4 + C × 12
12
0 = 1728 − 864 + 12C
− 12C = 864
C = −72
Thus,
0.5 4
y = x3 − x + Cx + D
12
0.5 4
= x3 − x − 72 x
12
0.5 4
y (4 ) = 43 − × 4 − 72 × 4
12
= 64 − 10.6667 − 288
= −234.67
2. Given
d2y
2
= 6 x − 0.5 x 2 , y (0 ) = 0 , y (12 ) = 0
dx
d2y
the value of at y (4 ) using the finite difference method and a step size of h = 4 can
dx 2
be approximated by

y (8) − y (0 )
(A)
8
y (8) − 2 y (4 ) + y (0 )
(B)
16
y (12 ) − 2 y (8) + y (4 )
(C)
16
y (4 ) − y (0 )
(D)
4

Solution
The correct answer is (B).

h h
● ● ●
i−1 i i+1

d2y
The finite difference approximation for at node i , that is x = xi , is given by
dx 2
d2y y − 2 yi + yi −1
2
≈ i +1
dx i h2
where
yi +1 = y (8)
yi = y (4)
yi −1 = y (0)
h=4
Thus
d 2 y y (8) − 2 y (4 ) + y (0 )

dx 2 (4)2
y (8) − 2 y (4 ) + y (0 )

16
3. Given
d2y
2
= 6 x − 0.5 x 2 , y (0 ) = 0 , y (12 ) = 0
dx
the value of y (4 ) using the finite difference method with a second order accurate central
divided difference method and a step size of h = 4 is

(A) 0.000
(B) 37.333
(C) − 234.67
(D) − 256.00

Solution
The correct answer is (D).

d2y
− 6 x − 0.5 x 2 = 0
dx 2
now

h h
● ● ●
i−1 i i+1
d2y
The finite difference approximation for at node i , that is x = xi , is given by
dx 2
d2y y − 2 yi + yi −1
2
≈ i +1
dx i h2
Thus
yi +1 − 2 yi + yi −1
− 6 xi + 0.5 xi2 = 0
(h )2

yi +1 − 2 yi + yi −1 − 6 xi h 2 + 0.5 xi2 h 2 = 0
yi +1 − 2 yi + yi −1 = 6 xi h 2 − 0.5 xi2 h 2
= 6 xi 4 2 − 0.5 xi2 4 2
= 96 xi − 8 xi2
4
● ● ● ● ●
node # 0 1 2 3 4
x
At node i = 0, x0 = 0
y0 = 0
At node i = 1, x1 = 4
y 2 − 2 y1 + y 0 = 96 x1 − 8 x12
= 96(4) − 8(16 )
= 256
At node i = 2, x2 = 8
y3 − 2 y 2 + y1 = 96 x 2 − 8 x22
= 96(8) − 8(64)
= 256
At node i = 3, x3 = 12
y3 = 0

Writing the above equations in matrix form


⎡1 0 0 0 ⎤ ⎡ y0 ⎤ ⎡ 0 ⎤
⎢1 − 2 1 0⎥ ⎢ y ⎥ ⎢256⎥
⎢ ⎥⎢ 1 ⎥ = ⎢ ⎥
⎢0 1 − 2 1⎥ ⎢ y2 ⎥ ⎢256⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎣0 0 0 1⎦ ⎣ y3 ⎦ ⎣ 0 ⎦

which gives
y (0 ) = y0 = 0
y (4 ) ≈ y1 = −256
y (8) ≈ y2 = −256
y (12) = y3 = 0
Hence
y (4) ≈ −256
4. The transverse deflection u of a cable of length L that is fixed at both ends, is given as a
solution to
d 2 u Tu qx( x − L )
= +
dx 2 R 2R
where
T = tension in cable
R = flexural stiffness
q = distributed transverse load

T T q
u (x )

x
lbs
Given L = 50" , T = 2000 lbs , q = 75 , and R = 75 × 106 lbs ⋅ in 2
in
Using finite difference method modeling with second order central divided difference
accuracy and a step size of h = 12.5" , the value of the deflection at the center of the cable
most nearly is
(A) 0.072737″
(B) 0.080832″
(C) 0.081380″
(D) 0.084843″

Solution
The correct answer is (D).

h h
● ● ●
i−1 i i+1

At node i , using finite difference approximations,


d 2u u − 2ui + ui −1 (2000)ui 75 × xi ( xi − 50)
≈ i +1 = +
2
dx i h2 (
75 × 106 ) (
2 75 × 106 )
12.5
● ● ● ● ●
node # 0 1 2 3 4
x
For i = 0, x0 = 0
u0 = 0 ″ (1)
For i = 1, x1 = 12.5
u2 − 2u1 + u0
=
(2000)u1 75 × x1 ( x1 − 50)
+
h2 (
75 × 10 6
) (
2 75 × 106 )
u2 − 2u1 + u0
=
(2000)u1 + 75 × 12.5(12.5 − 50)
12.52 (
75 × 106 ) (
2 75 × 106 )
u2 − 2u1 + u0
= 2.6667 × 10− 5 u1 − 2.3438 × 10− 4
156.25
u2 − 2u1 + u0 = 4.1667 × 10−3 u1 − 3.6621 × 10 −2
u2 − 2.0042u1 + u0 = −3.6621 × 10 − 2 (2)
For i = 2, x2 = 25
u3 − 2u2 + u1 (2000)u2 75 × x2 ( x2 − 50 )
= +
h2 (
75 × 106 ) (
2 75 × 106 )
u3 − 2u2 + u1 (2000 )u2 75 × 25(25 − 50 )
= +
12.52 (
75 × 106 ) (
2 75 × 106 )
u3 − 2u2 + u1
= 2.6667 × 10− 5 u2 − 3.1250 × 10− 4
156.25
u3 − 2u2 + u1 = 4.1667 × 10−3 u2 − 4.8828 × 10 −2
u3 − 2.0042u2 + u1 = −4.8828 × 10− 2 (3)
For i = 3, x3 = 37.5
u4 − 2u3 + u2 (2000 )u3 75 × x3 ( x3 − 50)
= +
h2 (
75 × 106 ) (
2 75 × 106 )
u4 − 2u3 + u2 (2000 )u3 75 × 37.5(37.5 − 50 )
= +
12.52 (
75 × 106 ) 2 75 × 106( )
u4 − 2u3 + u2
= 2.6667 × 10−5 u3 − 2.3438 × 10− 4
156.25
u4 − 2u3 + u2 = 4.1667 × 10−3 u3 − 3.6621 × 10−2
u4 − 2.0042u3 + u2 = −3.6621× 10− 2 ( 4)
For i = 4, x4 = 50
u4 = 0 ″ (5)
Rewrite Equations 1-5 in matrix form
⎡1 0 0 0 0⎤ ⎡u0 ⎤ ⎡ 0 ⎤
⎢1 − 2.0042 1 0 ⎥ ⎢ ⎥ ⎢ −2 ⎥
0⎥ ⎢ u1 ⎥ ⎢ − 3.6621 × 10 ⎥

⎢0 1 − 2.0042 1 0⎥ ⎢u2 ⎥ = ⎢− 4.8828 × 10− 2 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
⎢0 0 1 − 2.0042 1⎥ ⎢u3 ⎥ ⎢ − 3.6621 × 10− 2 ⎥
⎢⎣0 0 0 0 1⎥⎦ ⎢⎣u4 ⎥⎦ ⎢⎣ 0 ⎥⎦
Solving this matrix by using Gauss elimination gives
u0 = 0"
u1 = 0.060605"
u2 = 0.084843"
u3 = 0.060605"
u4 = 0"
Hence
u (25) ≈ u2 = 0.084843"
5. The radial displacement u of a pressurized hollow thick cylinder (inner radius = 5″,
outer radius = 8″) is given at different radial locations.
Radius Radial
(in) Displacement
(in)
5.0 0.0038731
5.6 0.0036165
6.2 0.0034222
6.8 0.0032743
7.4 0.0031618
8.0 0.0030769

The maximum normal stress, in psi, on the cylinder is given by


⎛ u (5) du ⎞
σ max = 3.2967 × 10 6 ⎜ + 0.3 (5)⎟
⎝ 5 dr ⎠
The maximum stress, in psi, with second order accuracy is
(A) 2079.6
(B) 2104.5
(C) 2130.7
(D) 2182.0

Solution
The correct answer is (A).

If we look at the Taylor series


u ′′(r )(Δr ) u ′′′(r )(Δr )
2 3
u (r + Δr ) = u (r ) + u ′(r )Δr + + +"
2 6
and

u (r + 2Δr ) = u (r ) + u′(r )(2Δr ) +


( )
u′′(r ) 2Δr 2 u′′′(r )(2Δr )
+ +"
3

2 6
Multiply the first equation by 4 and subtract it from the second equation.
u (r + 2Δr ) − 4u (r + Δr ) = −3u (r ) − u′(r )2Δr + O(Δr )
3

u′(r )(2Δr ) = −u (r + 2Δr ) + 4u (r + Δr ) − 3u (r ) + O(Δr )


3

− u (r + 2Δr ) + 4u (r + Δr ) − 3u (r ) O(Δr )
3
u′(r ) = +
2Δr 2Δr
− u (r + 2Δr ) + 4u (r + Δr ) − 3u (r )
u′(r ) = + O(Δr )
2

2Δr
This equation is second order accurate, that is, the true error is O(Δr ) .
2

du − u (r + 2Δr ) + 4u (r + Δr ) − 3u (r )

dr 2Δr
r = 5, Δr = 0.6
− u( ) + 4u ( 5 + 0.6) − 3u ( 5)
du
(5) ≈ 5 + 2 × 0.6
dr 2 × 0.6
− u ( 6.2) + 4u ( 5.6) − 3u ( 5)
=
2 × 0.6

− 0.0034222 + 0.014466 − 0.011619


=
1.2
= −0.00047933
Thus,
⎛ u (5) du ⎞
σ max = 3.2967 × 106 ⎜ + 0.3 (5)⎟
⎝ 5 dr ⎠
⎛ 0.0038731 ⎞
≈ 3.2967 × 106 ⎜ + 0.3 × (− 0.00047933)⎟
⎝ 5 ⎠
= 2079.6 psi
6. For a simply supported beam (at x = 0 and x = L ) with a uniform load q, the vertical
deflection v( x ) is described by the boundary value ordinary differential equation as
d 2 v qx( x − L )
= , 0≤ x≤L
dx 2 2 EI
where
E = Young’s modulus of the beam
I = second moment of area
dv dv
This ordinary differential equation is based on assuming that is small. If is not
dx dx
small, then the ordinary differential equation is given by

L
x
2
d v
dx 2 qx(x − L )
(A) =
⎛ dv ⎞
2 2 EI
1+ ⎜ ⎟
⎝ dx ⎠
d 2v
dx 2 qx(x − L )
(B) 3
=
⎛ ⎛ dv ⎞ 2 ⎞ 2 2 EI
⎜1 + ⎜ ⎟ ⎟
⎜ ⎝ dx ⎠ ⎟
⎝ ⎠
2
d v
dx 2 qx( x − L )
(C) =
⎛ dv ⎞ 2 EI
1+ ⎜ ⎟
⎝ dx ⎠
2
d v
(D) dx 2 = qx( x − L )
dv 2 EI
1+
dx

Solution
The correct answer is (B).
The equation for the deflection in a beam is
1 M
=
ρ EI
Where
1
= curvature of the beam
ρ
M = internal moment of the beam where the curvature is to be determined

The curvature of a function v can be rewritten in rectangular format as


d 2v
1 dx 2
=
ρ ⎛ ⎛ dv ⎞ 2 ⎞
3
2
⎜1 + ⎜ ⎟ ⎟
⎜ ⎝ dx ⎠ ⎟
⎝ ⎠

qL
The reaction at each support is .
2

q qx
x
2
M M
O O

x x
qL qL
2 2

Writing the balance of the bending moments at point O at a distance x from the left end,
qL x
M+ x − (qx ) = 0
2 2
2
qx qL
M = − x
2 2
qx( x − L )
=
2
Thus the equation for the deflection of the simply supported beam is
d 2v
dx 2 qx(x − L )
3
=
⎛ ⎛ dv ⎞ 2 ⎞ 2 2 EI
⎜1 + ⎜ ⎟ ⎟
⎜ ⎝ dx ⎠ ⎟
⎝ ⎠

You might also like