Docsity

Matlab problem solution, Study notes of Physics of semiconductor devices

Partial preview of the text

Download Matlab problem solution and more Study notes Physics of semiconductor devices in PDF only on Docsity!

MATLAB CODE TO SOLVE THE

LAPLACE HEAT EQUATION

CHAUDHARY CHARAN SINGH

UNIVERSITY MEERUT

PRESENTED BY:

SHIVANI

AND

PARNIKA SINGH

UNDER THE

SUPERVISION OF

PROF. ANIL

KUMAR MALIK

CONTEXT ๏ƒ˜ (^) Introduction to MATLAB ๏ƒ˜ (^) Features of MATLAB ๏ƒ˜ (^) MATLAB Interface ๏ƒ˜ (^) Basic Commands in MATLAB ๏ƒ˜ (^) Applications & Advantages of MATLAB ๏ƒ˜ (^) Laplace Equation ๏ƒ˜ (^) Methods (Analytical & Numerical) ๏ƒ˜ (^) Finite Difference Method (FDM) ๏ƒ˜ (^) Need of FDM

INTRODUCTION TO MATLAB ๏ƒ˜ (^) MATLAB stands for MATrix Laboratory. ๏ƒ˜ (^) Developed by Math Works. ๏ƒ˜ (^) It is a high-level programming language. ๏ƒ˜ (^) Used for numerical computations. ๏ƒ˜ (^) Performs matrix and mathematical operations.

FEATURES OF MATLAB ๏ƒ˜ (^) Easy to learn and use ๏ƒ˜ (^) Fast calculations ๏ƒ˜ (^) Simple programming ๏ƒ˜ (^) Built-in mathematical ๏ƒ˜ (^) functions ๏ƒ˜ (^) Creates 2D and 3D graphs ๏ƒ˜ (^) Solves complex problems ๏ƒ˜ (^) Widely used in engineering and scientific research

8

APPLICATION

S OF MATLAB

ELECTRONICS AND SEMICONDUCT OR PHYSICS Circuit design & prototyping using Simscape Electrical CONTROL SYSTEMS & MECHATRONIC S Automotive Robotics Aerospace SIGNAL PROCESSING & WIRELESS COMMUNICATIO NS Audio & video processing DEEP LEARNING & COMPUTER VISION Build, train & deploy deep neural networks Medical imagery ACADEMIC LAB WORK Mathematical modelling: quantum mechanics, matrix diagonalization , statistical mechanics

LAPLACE HEAT EQUATION (STEADY-STATE HEAT CONDUCTION)

METHOD TO SOLVE LAPLACE EQUATION

1. Analytical Method: - (^) Gives the exact solution - (^) Suitable for simple problem

  1. Numerical Method:
    • (^) Gives the approximate solution
    • (^) Suitable for complex problems Two methods are used to solve the Laplace equation :

NEED OF FINITE DIFFERENCE METHOD ๏ƒ˜ (^) Used to solve complex differential equations. ๏ƒ˜ (^) Provides approximate numerical solutions. ๏ƒ˜ (^) Useful when analytical solutions are difficult or impossible. ๏ƒ˜ (^) Easy to implement in MATLAB. ๏ƒ˜ (^) Gives accurate results with less computation time. ๏ƒ˜ (^) Widely used in engineering and scientific research. ๏ƒ˜ (^) Suitable for solving the Laplace equation.

TYPES OF FINITE DIFFERENCE METHOD The three main types are:

1. Forward Difference โ€“ - (^) It Uses the next grid point. - (^) First-order accurate. - (^) Formula: du/dx = [u(x + h) โˆ’ u(x)] / h 2. Backward Difference - - (^) It uses the previous grid point. - (^) First-order accurate. - (^) Formula: du/dx = [u(x) โˆ’ u(x โˆ’ h)] / h 3. Central Difference โ€“

  • (^) It uses both previous and next grid points.
  • (^) More accurate than forward and backward difference.
  • (^) Formula:
  • (^) du/dx = [u(x + h) โˆ’ u(x โˆ’ h)] / 2h #NOTE - We use the Central Difference Method because it provides higher accuracy for solving the Laplace equation in

MATLAB PROGRAM

The MATLAB program is used to solve the two-

dimensional Laplace equation using the Finite

Difference Method (FDM). First, the computational

grid is created and the boundary conditions are

applied. Then, the interior grid values are updated

iteratively using the finite difference equation

until the solution converges. Finally, the numerical

solution is displayed.

QUESTION : Solve โˆ‡ยฒT = 0 in the square region bounded by the coordinate axes and the lines x = 4 and y = 4, with the following boundary conditions: i. T(0, y) = 0, for 0 โ‰ค y โ‰ค 4 ii. T(4, y) = 12 + y, for 0 โ‰ค y โ‰ค 4 iii. T(x, 0) = 3x, for 0 โ‰ค x โ‰ค 4 iv. T(x, 4) = xยฒ, for 0 โ‰ค x โ‰ค 4

19 %% Boundary Conditions % Left Boundary (x = 0) u(:,1) = 0; % Right Boundary (x = 4) for j = 1:N y = j - 1; u(j,N) = 12 + y; end % Bottom Boundary (y = 0) for i = 1:N x = i - 1; u(1,i) = 3*x; end

20 % Top Boundary (y = 4) for i = 1:N x = i - 1; u(N,i) = x^2; end %% Gauss-Seidel Iterative Method tol = 1e-6; % Convergence tolerance error = 1; % Initial error while error > tol old = u; for j = 2:N- for i = 2:N- u(j,i) = 0.25 * ( ... u(j+1,i) + ... u(j-1,i) + ... u(j,i+1) + ... u(j,i-1) ); end