13
1 COURSEWORK on Numerical Techniques in Engineering (ENGT5140 ) This is a course work on Numerical Techniques in Engineering (ENGT5140), which is the part of the module assessment. This course work determines 50% of your grade for the module. All coursework will be marked against the following criteria: Correctness of results (60%), including mathematical derivations and ac- curacy of simulation Elegance and clarity of presentation (20%). Your work should be presented as if writing for an audience of fellow students, and explain everything they would need to reproduce your work. Elegance and style of computer programming work (20%) Any course work must be conducted individually, cheating of any kind will not be tolerated. You may be asked for a presentation or an oral examination based on your course work, if necessary. The submission deadline is on Friday 8th January 2016, before 1:00pm and the coursework should be handed in to the Faculty of Technology Student Sup- port Centre on the ground floor of the Gateway House with a coursework cover sheet of ENGT5140. Late submission will be penalised.

1366831_courseengt5140_2015_2016

Embed Size (px)

DESCRIPTION

Coursework

Citation preview

Page 1: 1366831_courseengt5140_2015_2016

1

COURSEWORKon

Numerical Techniques in Engineering(ENGT5140 )

This is a course work on Numerical Techniques in Engineering (ENGT5140), which is the part of the module assessment. This course work determines 50% of your grade for the module.

All coursework will be marked against the following criteria:

• Correctness of results (60%), including mathematical derivations and ac- curacy of simulation

• Elegance and clarity of presentation (20%). Your work should be presented as if writing for an audience of fellow students, and explain everything they would need to reproduce your work.

• Elegance and style of computer programming work (20%)

• Any course work must be conducted individually, cheating of any kind will not be tolerated. You may be asked for a presentation or an oral examination based on your course work, if necessary.

The submission deadline is on Friday 8th January 2016, before 1:00pm and the coursework should be handed in to the Faculty of Technology Student Sup- port Centre on the ground floor of the Gateway House with a coursework cover sheet of ENGT5140. Late submission will be penalised.

In your submitted coursework, you should include:

• Details of your coursework report

• Programming codes in Matlab or other computer languages in a CD. You could lost 50% without the CD

• Any necessary materials such as plots, tables and diagrams

Page 2: 1366831_courseengt5140_2015_2016

dr

2

Coursework Questions

(You must choose FOUR QUESTIONS ONLY as your coursework)

1. A cylindrical pipe has a hot fluid flowing through it. Because the pressure is very high, the walls of the pipe are thick. For such a situation, the temperature distribution in the metal wall related to radial distance can be modelled by a second order differentialequation

d2 θ dθr

dr2 +

dr = 0

where θ is temperature, and r is the radial distance from the centreline.

(a) Solve for the temperature θ(r) within a pipe whose radius is 1 cm and whose outer radius is 2 cm if the fluid is at 500o C and the temperature of the outer circumference is 25o C .

(b) The pipe is insulated to reduce the heat loss. The insulation used has proper-dθ

ties such that the gradient at the outer circumference is proportional to thedr

difference in temperature from the outer wall to the surroundings, which can bemodelled by

r=2

= 0.083(θ(2) − 20)

Solve the equation with this boundary condition.

(c) In this question, you should use at least two numerical methods (suggested the shooting method and finite difference method)to solve the equation, and compare the solutions with different mesh steps by each method. Plot solutions and make your judgement for each method.

2. (a) Here is a cubic polynomial with three closely spaced real roots

f (x) = 816x3 − 3835x2 + 6000x −

3125 i. what are the exact roots of f (x)?

ii. Plot f (x) for 1.43 ≤ x ≤ 1.71. Show the location of the three

roots. iii. Starting with x0 = 1.5, what does Newton’s method do?

iv. Starting with x0 = 1.3, what does Newton’s method do?

v. Starting with x0 = 1, and x1 = 2, what does the secant method do?

(b) For n = 100, solve the tridiagonal system of equations

2x1 − x2 = 1

−xj −1 + 2xj − xj +1 = j, j = 2, 3, · · · , n − 1

−xn−1 + 2xn = n

Use the code bslashtx to solve the problem. You do need to modified the codebslashtx, and cannot apply it directly.

(c) Use the Jacobi method to solve the sparse system within three correct decimal places for n = 100. The correct solution is [1, −1, 1, −1, · · · , 1, −1]T . Report the

Page 3: 1366831_courseengt5140_2015_2016

2

number of steps needed and backward error. The system is

2 11 2 1

x1

x2

1

0 . . .

. . . . . .

.

.

. =

.

1 2 1

.

0

.

1 2 xn −1

3. Write a program with Matlab for both Jacobi and Gauss-Seidel methods to solve the following equations. Make sure at the beginning you solve each equation for the variable that has the largest coefficient, why?

(a) Apply the program to the system of equations

x1 + 9x2 − 2x3 = 36

2x1 − x2 + 8x3 = 121

6x1 + x2 + x3 = 107

with an initial

(b) Apply the program to

x1 = 1, x2 = 1, x3 = 1

A(t)x = b

starting from x = [0, 0, 0]T , where1 t t

2

A(t) = t 1 t , b =

2t t 1

For t = 0.2, 0.5, 0.8, 0.9 determine the number of steps to obtain the solution to6 significant digits in the computations. Plot the number of steps as functions of t and make your comments.

(c) Solve the sparse system within six correct decimal places for n = 100 and n =100000. The correct solution is [1, 1, · · · , 1]T . Report the number of steps needed and backward error. The system is

3 −1

−1 3 −1

x1

x2

2

1 . . .

. . . . . .

.

.

. =

.

.

−1 3 −1

.

1

−1 3 xn

2

4. A cable hung at its two ends as shown in Fig. 1 by its own weight will have a catenary shape described by the equation

y = Tx

wwx

cosh 1Tx

(1)

where w is the weight per unit length and Tx is the horizontal, x-component of the tension of the cable. Equation (1) is for the case when both w and Tx are

Page 4: 1366831_courseengt5140_2015_2016

constant

Page 5: 1366831_courseengt5140_2015_2016

x

2

Figure 1: A diagram for a cable.

throughout the cable. In fact, Equation (1) is the solution of the differential equation

d2 y w ds w "

dy 2

#1/2

dx2 =

T= 1 +

dx Tx dx(2)

where s is a variable along the length of the cable.

(a) Applying the Runge-Kutta method to solve the equation (2), where w = 0.12 kN/m, xA = yA = 0, xB = 200 m, and yB = 50 m. Let the initial conditions be y = 0 at x = xA = 0, iterate Tx value until yB is within 99.9% of 50 m.

(b) How could the problem be solved if xA = 100 m and yA = 25 m by application of the Runge-Kutta method (w remains equal to 0.12 kN/m)?

(c) Making a discussion about numerical results with different mesh steps and with other methods if possible.

5. The equation′y = 1 + y , y(0) = 0

has the analytical solution y(t) = tan t. The tangent function is infinite at t = π/2.

(a) Write your program to solve this initial value problem between t = 0 and t = 1.6, and compare the results of the program with the analytical solution

(b) What is the behaviour of the Runge-Kutta fourth order method when used be- tween t = 0 and t = 1.6

(c) Compare the results from your program with R-K methods and make comments on the behaviour change with step sizes.

6. Here is a typical steady-state heat flow problem. Consider a thin steel plate to be a10 × 20 (cm)2 rectangle. If one side of the 10 cm edge is held at 1000 C and the other three edges are held at 00 C, what are the steady-state temperature at interior points? We can state the problem mathematically in this way if we assume that heat flows only in the x and y directions:Find u(x, y) (temperature) such that

∂2 u ∂2 u

Page 6: 1366831_courseengt5140_2015_2016

∂x2 +

∂y2 = 0 (3)

Page 7: 1366831_courseengt5140_2015_2016

with boundary conditions

u(x, 0) = 0

u(x, 10) = 0

u(0, y) = 0

u(20, y) = 100

We replace the differential equation by a difference equation

1h2

[ui+1,j + ui−1,j + ui,j +1 + ui,j −1 − 4ui,j ] = 0 (4)

which relates the temperature at the point (xi, yj ) to the temperature at four neigh- bouring points, each the distance h away from (xi , yj ). An approximation of Equation (3) results when we select a set of such points (these are often called as nodes) and find the solution to the set of difference equations that result.

(a) If we choose h = 5 cm , find the temperature at interior points.

(b) Write a program to calculate the temperature distribution on interior points with h = 2.5, h = 0.25, h = 0.025 and h = 0.0025 cm. Discuss your solutions and examine the effect of grid size h.

(c) Modified the difference equation (4) so that it permits to solve the equation

∂2u ∂2 u

on the region

∂x2 +

∂y2 = xy(x − 2)(y − 2)

0 ≤ x ≤ 2, 0 ≤ y ≤ 2

with boundary condition u = 0 on all boundaries except for y = 0, where u = 1.0. Write and run the program with different grid sizes h and discuss your numerical results.

7. If a anti level beam of length L, which bends due to a uniform load of w lb/ft, is also subject to an axial force P at its free end (see Figure 2). The equation of its elastic curve is

d2 yEI

dx2 = P y −wx2

2(5)

For this equation, the origin O has been taken at the free end. I is the moment of

inertia; here I =bh3

12. At the point x = L,

dy= 0 and at x = 0, y = 0.

dx

(a) Solve the boundary value problem by any numerical method for a wooden beam,2 in × 4 in × 10 ft, where E = 12 × 105 lb/in2 . Find y versus x when the beam has the 4 in dimension vertical with w = 25 lb/ft and a tension force of P = 500 lb.

(b) And also solve for the deflections if the beam is turned so that the 4 in dimension is horizontal.

(c) If the factor of the radius of curvature has been taken into account, Equation (5)becomes

EI d2 y wx2

Page 8: 1366831_courseengt5140_2015_2016

[1 + (y′)2 ]3/2 dx2 = P y − (6)

2

Page 9: 1366831_courseengt5140_2015_2016

Y

L

P

O X

Figure 2: Diagram for a cantilever beam.

If the defection of the beam is small, the difference is negligible, but in some cases this is not true. Furthermore, if there is considerable bending of the beam, the horizontal distance from the origin to the wall is less than L, the original length of the beam. Solve the equation (6) with the same conditions, and determine by how much the deflections differ from those previous calculations.

8. Consider a laterally insulated metal bar of length L = 1, which satisfies the heat equation

∂u ∂2 u∂t

= ∂x2

Suppose that the ends of the bar are kept at temperature u = 0oC and the temperature in the bar at t = 0, u(0, x) = sin πx.

(a) Using an explicit method with different meshes h to solve the equation and find numerical solutions at t = 5

(b) Using an implicit method with different meshes h to solve the equation and find numerical solutions at t = 5

(c) Using Crank-Nicolson method with different meshes h to solve the equation and find numerical solutions at t = 5

(d) Making your discussion for these three methods

The exact solution for this problem is

−π2 tu(t, x) = sin(πx)e

which can be used to compare with your numerical solutions.

9. Condon and Odishaw (1967) discuss Duffing equation for the flux φ in a transformer.This nonlinear differential equation is

d2φ 2 3 ω ′dt2

+ ω0 φ + bφ = E cos(ωt), φ(0) = φ (0) = 0N

In this equation , E cos ωt is the sinusoidal source voltage and N is the number of turns in the primary winding, where ω0 and b are parameters of the transformer design. Make a plot of φ versus t (and compare to the source voltage) if E = 165, ω

Page 10: 1366831_courseengt5140_2015_2016

= 120π,

Page 11: 1366831_courseengt5140_2015_2016

0N = 600, ω2 = 83 and b = 0.14. For approximate calculations, the nonlinear term bφ3 is sometimes neglected. Evaluate your result to determine whether this makes a significant error in the results.(Condon E. and Odishaw H., (1967) Handbook of Physics, New York, McGraw-Hill)

10. A Foucault pendulum is one free to swing in both the x- and y- directions. It is frequently displayed in science museums to exhibit the rotation of the earth, which causes the pendulum to swing in directions that continuously vary. The equations of motion are

d2 x dy 2

dt2 − 2ω sin(φ)

dt + k x = 0

d2 y dx 2

dt2 + 2ω sin(φ)

dt + k y = 0

where damping is absent (or compensated for). Here ω is the angular velocity of the earth’s rotation (7.29 × 10−5 sec−1 ), φ is the latitude, k2 = g/l, where l is the length of the pendulum.

(a) How long will it take a 10 meter long pendulum to rotate its plane of swing by45o at the latitude where you were born?

(b) How long if located in Leicester, UK?