You are on page 1of 12

Assignment 2

EE 735
Outline
• Numerical integration

• System of linear equations and its numerical solution

• System of non linear equation its numerical solution


Numerical Integration
y 𝑦=𝑓 𝑥
𝑎+𝑏
𝑓
2
𝑓(𝑎) Definite integral
𝑓(𝑏)
𝑏
𝑎+𝑏
න 𝑓 𝑥 𝑑𝑥 ≈ 𝑏 − 𝑎 𝑓
𝑎 2

𝑎+𝑏 x
𝑎 𝑏
2
Trapezoidal Rule
y 𝑦=𝑓 𝑥

𝑏
𝑓 𝑎 +𝑓 𝑏
න 𝑓 𝑥 𝑑𝑥 ≈ 𝑏 − 𝑎
𝑓(𝑏) 𝑎 2

𝑓(𝑎)

Numerical Integration

𝑏 𝑁
𝑓 𝑥𝑖−1 + 𝑓 𝑥
න 𝑓 𝑥 𝑑𝑥 ≈ ෍ Δ𝑥𝑖
𝑎 2
x 𝑖=1
𝑎 𝑏
Simpson’s Rule
Lagrange polynominal

Numerical Integration

2𝑀 + 𝑇
𝑆𝑖𝑚𝑝𝑜𝑛′ 𝑠 𝑚𝑒𝑟ℎ𝑜𝑑 𝑖𝑠 𝑡ℎ𝑒 𝑤𝑒𝑖𝑔ℎ𝑡𝑒𝑑 𝑎𝑣𝑒𝑟𝑎𝑔𝑒 𝑜𝑓 𝑀𝑖𝑑 𝑝𝑜𝑖𝑛𝑡 𝑎𝑛𝑑 𝑡𝑟𝑎𝑝𝑒𝑧𝑜𝑖𝑑𝑎𝑙 𝑚𝑒𝑡ℎ𝑜𝑑𝑠 𝑆 =
3
Assignment

Question 1.
Solve the following for abrupt and linearly graded pn junction diode.

(a) Plot the Electric field profile by solving the Gauss Law using numerical integration techniques such
as Trapezoidal or Simpson’s methods. Compare the result with the inbuilt MATLAB functions for
integration. Check the accuracy of numerically integrated results by varying the grid spacing.

𝜌 𝑥
𝐸(𝑥) = ‫׬‬ 𝑑𝑥 , for −𝑥𝑝 ≤ 𝑥 ≤ 𝑥𝑛
𝜖𝑠
System of linear equations
Numerical methods to solve Ax=b
2
𝑞
∇ 𝑉 𝑥 =− 𝑁𝐷 − 𝑁𝐴 • Direct methods:
𝜖𝑠 1. Gauss elimination
2. LU decomposition
Using central difference approximation

ℎ2 𝑞 • Indirect methods: Iterative


𝑉𝑖−1 − 2𝑉𝑖 + 𝑉𝑖+1 = − 𝑁𝐷 − 𝑁𝐴 1. Gauss Seidel
𝜖𝑠

A has to be Strictly diagonal dominant


In terms of coefficient matrix 𝐴

𝐴 𝑛×𝑛 𝑉 𝑛×1 = 𝑏 𝑛×1


L U decomposition method for AV=b
The operation count of LU decomposition is much lesser than Gauss elimination.

• decompose 𝐴 𝑖𝑛𝑡𝑜 𝐿 𝑎𝑛𝑑 𝑈 matrix

• 𝑨𝒙 = 𝒃 → 𝐿𝑈𝑉 = 𝑏

• 𝑳𝒚 = 𝒃 𝑎𝑛𝑑 𝑼𝒙 = 𝒚 → these can be solved for V vector, by forward and


backward substitutions respectively.
L U decomposition method for AV=b

𝑭𝒐𝒓𝒘𝒂𝒓𝒅 𝒔𝒖𝒔𝒕𝒊𝒕𝒖𝒕𝒊𝒐𝒏 𝑩𝒂𝒄𝒌𝒘𝒂𝒓𝒅 𝒔𝒖𝒔𝒕𝒊𝒕𝒖𝒕𝒊𝒐𝒏


𝑳𝒚 = 𝒃 𝑼𝒙 = 𝒚
L U factorization

𝑅2 → 𝑅2 + 2𝑅1
𝑅3 → 𝑅3 − 4𝑅1

𝑅3 → 𝑅3 + 0.5𝑅2

𝑳 𝑼
System of non-linear equations
• Charge neutrality equation: 𝑁𝐷+ − 𝑁𝐴− = 𝑛 − 𝑝

𝑁𝐷
𝑁𝐷+ =
𝐸 − 𝐸𝐷
1 + 2 exp 𝐹
𝑘𝑇

𝑁𝐴
𝑁𝐴− =
𝐸 − 𝐸𝐹
1 + 4 exp 𝐴
𝑘𝑇

𝑁𝐷 𝑁𝐴 𝐸𝑉 − 𝑬𝑭 𝑬𝑭 − 𝐸𝑐
− = −𝑁𝑣 exp + 𝑁𝑐 exp
𝑬𝑭 − 𝐸𝐷 𝐸𝐴 − 𝑬𝑭 𝑘𝑇 𝑘𝑇
1 + 2 exp 1 + 4 exp
𝑘𝑇 𝑘𝑇
Newton Raphson Method
• Numerical analysis to find the roots of real valued functions
𝑥𝑜 is the initial guess for a root of 𝑓.

𝑓 𝑥𝑜
𝑥1 = 𝑥𝑜 − ′
𝑓 𝑥𝑜

𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 − ′
𝑓 𝑥𝑛

You might also like