You are on page 1of 10

CHE3001- Computational Methods in Process Engineering

Assessment No: 09 HRIDYA ASHOKAN


Date: 23/11/2021 19BCM0009

LAB ASSESSMENT 9: (CMPE LAB L49+L50)

AIM: To develop a MATLAB code to solve elliptical partial differential equation (PDE) using
Liebmens method.
PROBLEM STATEMENT: Solve for the temperature of the heated plate in Figure. Employ over
relaxation with a value of 1.5 for the weighting factor and iterate to εs =1%

The output must be in the following format


Iteration vs Temperature at each node point

Iteration vs εai,j
CHE3001- Computational Methods in Process Engineering

THEORY AND ALGORITHM: The majority of numerical Laplace equation solutions involve
systems that are significantly bigger than a 10-by-10 grid, for example, has 100 linear algebraic
equations. In Equations, there are no more than five unknown terms per line. This indicates that a
considerable fraction of the words in bigger grids will be zero. Full matrix elimination approaches
waste a lot of computer memory storing these zeros when used to such sparse systems. As a result,
approximation approaches are a feasible option for getting elliptical equation solutions. The most often
used method is Gauss-Seidel, which is also known as Liebmann’s method when applied to PDEs. Heat
transfer in a plate is governed by the Laplace Equation which is given as:

--------------- (1)

Central differences based on the grid scheme from the figure are:

------------------ (2)
And

---------------------- (3)

which have errors of O[D(x)2] and O[D(y)2], respectively. Substituting these expressions into Laplace
Equation gives

-------------------- (4)

For a square grid, Δ𝑥 = Δ𝑦 and by collection of terms, the equation becomes


CHE3001- Computational Methods in Process Engineering

------------------ (5)

The Laplacian difference equation expresses this connection, which holds for all interior locations on
the plate. Furthermore, boundary criteria along the plate's borders must be given in order to produce a
unique solution. The simplest instance is when the temperature at the border is fixed. This is referred
to as a Dirichlet border condition.

For point (1,1) we get

------------- (6)

Putting the values T0,1 = 75 and T1,0 = 0 we get

------------- (7)

Similarly doing for other points we get set of nine simultaneous equations with nine unknowns. These
are

This indicates that a considerable fraction of the words in bigger grids will be zero. Full-matrix
elimination approaches waste a lot of computer resources storing these zeros when used to such sparse
systems. As a result, approximation approaches are a feasible option for getting elliptical equation
solutions. The most often used technique is Gauss-Seidel, which is also known as Liebmann's method
when applied to PDEs. Equation 5 is written as follows in this technique:

------------ (8)

and solved iteratively for j = 1 to 3 and i=1 to 3. Because Equation 5 is diagonally dominant, this
procedure will eventually converge on a stable solution. Overrelaxation is sometimes employed to
accelerate the rate of convergence by applying the following formula after each iteration:

-------------(9)
CHE3001- Computational Methods in Process Engineering

where 𝑇𝑖,𝑗new and 𝑇𝑖,𝑗old are the values of 𝑇𝑖,𝑗 from the present and past iterations respectively, and λ is
a weighting factor that is set between 1 and 2.

As with the conventional Gauss-Seidel method, the iterations are repeated until the absolute values of
all the percent relative errors (𝜀𝑎)𝑖,𝑗 fall below a prespecified stopping criterion εs.

The percent relative errors are estimated by

------------- (10)

MATLAB CODE:

clc
clear all

disp("Name: Hridya Ashokan")

disp("Registration Number: 19BCM0009")

disp('Elliptical partial differential equation');


T_top = input('enter the temp at the top of the heated plate in C :');
T_left = input('enter the temp at the left of the heated plate in C :');
T_right = input('enter the temp at the right of the heated plate in C :');
T_bottom = input('enter the temp at the bottom of the heated plate in C :');
n = 5;
L = input('enter the length of the relaxation for the weighting factor:');
T = zeros(n); T_old = zeros(n);
err = zeros(n);
tol = input('enter the tolerance limit for error calculation in %:');
T(1,:) = T_bottom;
T(n,:) = T_top;
T(:,1) = T_left;
T(:,n) = T_right;
for k = 1:10
for i = 2:n-1
for j = 2:n-1
T_old(i,j) = T(i,j);
T_new = (T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1))/4;
T(i,j)= (L*T_new)+(1-L)*T_old(i,j);
err(i,j) = abs((T(i,j)-T_old(i,j))/T(i,j))*100;
CHE3001- Computational Methods in Process Engineering

end
end
fprintf('The iteration at %d \n \n', k);
Temperature = T(2:4,2:4); error = err(2:4,2:4);
disp('The temperature of heated plate in C:');
disp(Temperature);
fprintf('\n');
disp('The error Ea at this iteration in % is');
disp(error);
if err<tol
break;
end
end
Temp=Temperature;
fprintf(' The final temps of the heated plate in C: \n', k);
disp(Temp);
CHE3001- Computational Methods in Process Engineering
CHE3001- Computational Methods in Process Engineering

OUTPUT:
CHE3001- Computational Methods in Process Engineering
CHE3001- Computational Methods in Process Engineering
CHE3001- Computational Methods in Process Engineering

CONCLUSION:

The ultimate temperature distribution of the heated plate is seen in the diagram above.

You might also like