0% found this document useful (0 votes)
11 views

Assignment6

The document outlines Assignment 6 for the course ME 5107: Numerical Methods in Thermal Engineering, which includes hand calculations and programming tasks related to numerical methods for differential equations. It specifies due dates for Group A and Group B, and details various problems involving stability analysis, truncation error, and numerical solutions for heat and wave equations. Additionally, it includes specific methods to be used for solving an initial value problem and requires plotting and error evaluation for different numerical techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Assignment6

The document outlines Assignment 6 for the course ME 5107: Numerical Methods in Thermal Engineering, which includes hand calculations and programming tasks related to numerical methods for differential equations. It specifies due dates for Group A and Group B, and details various problems involving stability analysis, truncation error, and numerical solutions for heat and wave equations. Additionally, it includes specific methods to be used for solving an initial value problem and requires plotting and error evaluation for different numerical techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

ME 5107: Numerical Methods in Thermal Engineering Jan–May 2025

Assignment 6

General Instructions
ˆ Solutions due by 8th April for Group A

ˆ Solutions due by 11th April for Group B

Hand calculations
0
1. (20 points) Consider the Euler explicit method applied to a differential equation y = f (y, t) with initial condition
y(t = 0) = y0 . In the lecture, to perform stability analysis, we linearized the differential equation to get:
0 0
y = λy + c1 + c2 t. Further, neglecting the inhomogenous terms, we obtained the model problem y = λy, where
λ = λR + iλI with λR ≤ 0. We will now study the effects of inhomogeous terms in the linearized equation on
stability analysis.
 c1 c2  c1 c2 c2 t
(a) Verify that y(t) = y0 + + 2 eλt − − 2− is an exact solution to the differential equation
λ λ λ λ λ
(b) Apply Euler explicit method to derive a difference equation of the form: yn+1 = αyn + βn + γ. What are
α, β, and γ?
(c) Use transformation zn = yn+1 − yn to derive the following difference equation: zn+1 = αzn + β.
(d) Solve the above difference equation and obtain an expression for zk in terms of y0 , α, β, γ for some k.
(e) Express the numerical solution ynnum in terms of y0 using the result from part (d)
(f) Show that the stability of the error, en = ynnum − ynanaly depends only on λ.

2. (10 points) Calculate the truncation error and examine the consistency and stability of Dufort-Frankel’s method
for the solution of one-dimensional transient heat conduction equation given by

un+1 − uin−1 un − un+1 − un−1 + uni−1


i
= i+1 i
2
i
(1)
2∆t ∆x

3. (10 points) Calculate the truncation error and examine the consistency and stability of the following discretiza-
tions for the solution of first-order wave equation give by
∂u ∂u
+c = 0, c>0 (2)
∂t ∂x
(a) Euler explicit method
un+1 − uni un − uni−1
i
+ c i+1 =0 (3)
∆t 2∆x
(b) Lax method
un+1 − 12 (uni+1 + uni−1 ) un − uni−1
i
+ c i+1 =0 (4)
∆t 2∆x

Programming
1. (60 points) The heat equation with a source term is

∂T ∂2T
= α 2 + S(x), 0 ≤ x ≤ L (5)
∂t ∂x
The initial and boundary conditions are T (x, 0) = 0, T (0, t) = 0 and T (L, t) = Tsteady (L). Taking α = 1, L = 15
and S(x) = −(x2 − 4x + 2)e−x . The exact steady solution is

Tsteady (x) = x2 e−x . (6)


ME 5107: Numerical Methods in Thermal Engineering Jan–May 2025

Solve the equation to steady state on a uniform grid with a grid spacing of ∆x = 1, 0.1 and employing a time
step of ∆t = 0.005. For each of the following methods (i) plot the variation of error in 1−norm with respect to
∆x on a log-log plot for a ∆t = 0.005 (ii) plot the exact and the numerical solutions for ∆x = 1 and ∆t = 0.005.
Comment on the maximum time step you can use in each of the following methods and show that by employing
a larger ∆t you can take fewer iterations to arrive at the steady solution in case of implicit methods. (a) Explicit
Euler time-advacement with second-order central difference scheme for spatial derivate (b) Implicit Euler time-
advancement with second-order central difference scheme for spatial derivate (c) Crank-Nicolson method.
2. (60 points) Consider the following initial value problem

dy
= −λ (y − e−t ) − e−t , λ>0
dt
with the intial condition y(t = 0) = y0 . Solve this initial value problem for λ = 10 and y0 = 10 using
explicit Euler, implicit Euler, trapezoidal, second-order Runge-Kutta, fourth-order Runge-Kutta and Runge-
Kutta-Fehlberg method. Use time step sizes h = 0.1, 0.05, 0.025, 0.0125, 0.00625 and integrate from t = 0 to 0.8.
The exact analytical solution to this equation is

y = e−t + (y0 − 1)e−λt .

(a) For each method, plot the solutions obtained along with the exact solution from t = 0 to t = 0.8.
(b) Evaluate the error between the numerical and the exact solution at t = 0.8 as follows. If the order of the
method is p, then the ratio of the error corresponding to a step size of h and h/2 should be 2p . Tabulate this ratio
for successive pairs of h and deduce the asymptotic value of p for each method. Use double precision arithmetic
throghout. The formulation of the methods is given as follows,

ˆ Explicit Euler Method


yi+1 = yi + hf (xi , yi )

ˆ Implicit Euler Method


yi+1 = yi + hf (xi+1 , yi+1 )

ˆ Trapezoidal Method
h
yi+1 = yi + [f (xi , yi ) + f (xi+1 , yi+1 )]
2
ˆ Second-Order Runge-Kutta Method
yi+1 = yi + hk2
where

k1 = f (xi , yi )
 
h h
k2 = f xi + , yi + k1
2 2

ˆ Fourth-Order Runge-Kutta Method


h
yi+1 = yi + (k1 + 2k2 + 2k3 + k4 )
6
where

k1 = f (xi , yi )
 
h h
k2 = f xi + , yi + k1
2 2
 
h h
k3 = f xi + , yi + k2
2 2
k4 = f (xi + h, yi + hk3 )

ˆ Runge-Kutta-Fehlberg Method
 
16 6656 28561 9 2
yi+1 = yi + k1 + k3 + k4 − k5 + k6
135 12825 56430 50 55
ME 5107: Numerical Methods in Thermal Engineering Jan–May 2025

where

k1 = hf (xi , yi )
 
h k1
k2 = hf xi + , yi +
4 4
 
3h 3k1 9k2
k3 = hf xi + , yi + +
8 32 32
 
12h 1932k1 7200k2 7296k3
k4 = hf xi + , yi + − +
13 2197 2197 2197
 
439k1 3680k3 845k4
k5 = hf xi + h, yi + − 8k2 + −
216 513 4104
 
h 8k1 3544k3 1859k4 11k5
k6 = hf xi + , yi − + 2k2 − + − .
2 27 2565 4104 40

You might also like