Professional Documents
Culture Documents
CMPE Lab 9
CMPE Lab 9
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%
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)
------------------ (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.
------------- (6)
------------- (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.
------------- (10)
MATLAB CODE:
clc
clear all
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.