Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Assignment #1 System of equations and Finite Difference Method

Question 1: Set up a system of 3 equations and 3 variables (opt for your own values for the
matrix elements)
a11*x1+a12*x2+a13*x3=b1
a21*x1+a22*x2+a23*x3= b2
a31*x1+a32*x2+a33*x3=b3

(i) Write the above as a matrix equation: Ax=B;


(ii) Solve for x by inverting the matrix, i.e., x=A-1*B (say with calculator or
pen/paper).
(iii) Now solve for x using matlab. Explore different options for inverting a matrix in
matlab like inv(). Also use the backslash operator

Question 2: Refer to the sample program provided. After familiarizing with the same, modify
it to solve the problem
𝑑2𝑉
= 𝛿(𝑥 − 7)
𝑑𝑥 2
with the boundary conditions V(0)=0, and dV/dx =0 at x = L (refer the code for the
parameters). Plot your results and explain why your results make sense

Question 3: Let us now solve a problem in electrostatics


𝑑2 𝑉
𝜖 2 = −𝜌
𝑑𝑥
Modify the sample code such that you can handle non-uniform mesh and variations in
dielectric constant.

Use your code to address the following problems. For each case, plot the V and electric field
as a function of x, and compare with analytical results (if available). Clearly identify and
discuss the presence of discontinuities/unique features, if any.
𝐹
Use the following parameters, unless otherwise specified 𝜖 = 3.9 × 8.854 × 10−14 𝑐𝑚, 𝐿 =
10−4 𝑐𝑚
(i) Simple parallel plate capacitor. 𝜌 = 0, V(0)=0, and V(L)=1

(ii) Parallel plate capacitor with 𝜌 = 𝛿(𝑥 − 0.7 × 10−4 𝑐𝑚) and two dielectrics as given
below. Note that the grid spacing for each region is also mentioned (V(0)=0, and V(L)=1).
𝐹
for 0 < 𝑥 < 0.5 × 10−4 𝑐𝑚, 𝜖 = 3.9 × 8.854 × 10−14 and grid spacing is 50nm
𝑐𝑚
𝐹
for 0.5 × 10−4 𝑐𝑚 < 𝑥 < 10−4 𝑐𝑚, 𝜖 = 9 × 8.854 × 10−14 𝑐𝑚 and grid spacing is 20nm

You might also like