CS计算机代考程序代写 scheme ENGR20005

ENGR20005
Numerical Methods in Engineering
Workshop 9 Solutions
9.5 (a)
(b) See Q9 5b sol.m
dx2 we assume a solution of the form
y = exp (λx) Substituting this into the differential equation gives
λ2eλx + eλx = 0 ⇒ λ2 = −1
⇒ λ = ±i Hence the general solution is given by
y = Aeix + Be−ix
= C cos (x) + D sin (x)
i. Fory(0)=1andy(π/2)=1
y(0) = C cos (0) + D sin (0)
See Q9 5a sol.m
(c) To find the general solution to
d2y + y = 0
Thus the solution is
ii. Fory(0)=1andy(π)=1
Hence no solution exists
y = cos (x) + sin (x)
y(0)=C =1 y(π) = −11
= C = 1 y(π/2) = cos (π/2) + D sin (π/2) = D= 1
1
(1)

9.6 (a)
Integrating
we have
(b)
= − α2 ( y 2 − y ) + y Applying the central difference scheme
ui+1 −2ui +ui−1 +α = 0 ∆2
for i = 2,3,4.
Thus, the discretised system is given by
−2 1 0u2  −α∆2  1 −2 1u3= −α∆2 
0 1 −2 u4 −α∆2 − 1 2
iii. Fory(0)=1andy(2π)=1y
Hence the solution is
(0)=C =1 y(2π)=1 =1
y = cos (x) + D sin (x)
for any choice of D. Thus, there are infinite solutions.
d2u + α = 0 dy2
⇒ du = −α + C dy
⇒u =−21αy2+Cy+D
Applying the boundary conditions
u(0) = D = 0
Hence
And so, the solution is
u(1) = −21α(1)2 + C(1) = 1 ⇒ − 12 α + C = 1
⇒ C = 1 + 12 α
u = − 12 α y 2 + 􏰄 1 + 12 α 􏰅 y

Solving for α = 0.01, 1, 100 gives 0
0 0
0.2509 {u}α=0.01 = 0.5013 0.7509
0.3438  9.6250  {u}α=1 = 0.6250 {u}α=100 = 13.0000 0.8438 10.1250
111
(c) The derivative matrix wil 5 Gauss–Lobatto nodes in local coordinates ξ is given by
−5.0000 6.7565 −2.6667 1.4102 −0.5000
−1.2410 0.0000 1.7457 −0.7638 0.2590  [D] =  0.3750 −1.3366 −0.0000 1.3366 −0.3750 −0.2590 0.7638 −1.7457 −0.0000 1.2410 
0.5000 −1.4102 2.6667 −6.7565 5.0000 And the Jacobian from local coordinates ξ to x is
Hence the second derivative matrix is
15.0000 1  7.1869
[D2] = [D][D] = −0.7500 J2  0.3131
−28.4362 −11.6667 4.0833 −1.1667
21.3333 5.3333 −6.6667 5.3333
−12.3972 −1.1667 4.0833 −11.6667
4.5000 
0.3131  −0.7500 7.1869 
J = dx = b − a dξ 2
4.5000 −12.3972 21.3333 −28.4362 15.0000 Applying boundary conditions, we have
−11.6667 5.3333 −1.1667  [Dˆ] =  4.0833 −6.6667 4.0833 
−1.1667 5.3333 −11.6667
−α − 0.3131 {ˆb} = −α + 0.7500
−α − 7.1869 Solving for α = 0.01, 1, 100 gives
0 0.2441
{u}α=0.01 = 0.6250 0.8988
0 0
0.2441 {u}α=1 = 0.6250 0.8988
 7.1860  {u}α=100 = 12.6250  7.3497 
111
3

9.6 (a) Discretising gives the system
j=2,i=2: j=2,i=3: j=2,i=4: j=2,i=5: j=3,i=2: j=3,i=3: j=3,i=4: j=3,i=5: j=4,i=4: j=4,i=5: j=5,i=4: j=5,i=5:
(b) In matrix form
(−2φ22 + φ32) + (−2φ22 + φ23)
(−2φ23 + φ32) + (φ22 − 2φ23 + φ24)
(−2φ24 + φ34) + (23−2φ24 + φ25)
(−2φ25 + φ35) + (φ24 − 2φ25)
(φ22 − 2φ32) + (−2φ32 + φ33)
(φ23 − 2φ33) + (φ32 − 2φ33 + φ34)
(φ24 − 2φ34 + φ44) + (φ33 − 2φ34 + φ35)= −λ∆2φ34
(φ25 − 2φ35φ45) + (φ34 − 2φ35)
(φ34 − 2φ44 + φ54) + (−2φ44 + φ45) (φ35 − 2φ45 + φ55) + (φ44 − 2φ45) (φ44 − 2φ54) + (−2φ45 + φ55)
(φ45 − 2φ55) + (φ54 − 2φ55)
−41
1−41 1 1−411
 1−4 1 1 −41 11−41
[L]= 1 1 −4 1 1
 1 1−4 1
  
(c) See Q9 6 sol.m.
(d) The first four eigenfunctions are given by
4
= −λ∆2 φ35 = −λ∆2 φ44 = −λ∆2 φ45 = −λ∆2 φ45 = −λ∆2 φ55

 
    
1 −4 1 1  11−4 1 1 −41
1 1 −4
= −λ∆2 φ22 = −λ∆2 φ23 = −λ∆2 φ24 = −λ∆2 φ25 = −λ∆2 φ32 = −λ∆2 φ22

(e) See Q9 6 sol.m
5