Plotting Schottkly diode I-V chracteristics

8 ビュー (過去 30 日間)
Ranjan Kandasamy
Ranjan Kandasamy 2021 年 8 月 31 日
編集済み: Srijith Kasaragod 2021 年 9 月 20 日
I am trying to plot current density vs voltage for the schottky diode.
This is my code so far:
clc
clear all
n = 1.02; %Ideality factor
A = 33.65; %Richardson constant
q = 1.602*10^-19; % electron charge
K = 1.38*10^-23; %Boltzmann constant
T = 300; % Absolute temperature
phi_b = 0.28; %Barrier Height
V = 0:0.2:2;
J_0 = A* (T* T)* exp((-q* phi_b)./(K* T));
J = J_0 * exp((q* V)./(n* K* T))* (1 - (exp(-q* V)./(K* T)));
plot(V, log(J ./(1 - exp(-q* V)/(k *T))))

採用された回答

Srijith Kasaragod
Srijith Kasaragod 2021 年 9 月 2 日
編集済み: Srijith Kasaragod 2021 年 9 月 7 日
Assuming correctness of parameters and equations, error exists only in final 2 lines of code. Multiplication to compute J must be elementwise multiplication rather than matrix multiplication. Also Botzmann constant is saved as variable 'K' and not 'k'. Making these two changes generates the plot.
J = J_0* exp((q* V)./(n* K* T)).* (1 - (exp(-q* V)./(K* T)));
plot(V, log(J ./(1 - exp(-q* V)/(K *T))));
  2 件のコメント
Ranjan Kandasamy
Ranjan Kandasamy 2021 年 9 月 2 日
編集済み: Ranjan Kandasamy 2021 年 9 月 2 日
How do I know if I need to do matrix multiplication or element-wise multiplication? I tried doing what you said and still get this error:
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To perform elementwise
multiplication, use '.*'.
Error in ss (line 11)
J = J_0* exp((q* V)./(n* K* T))* (1 - (exp(-q* V)./(K* T)));
Okay, I changed the above expression to J = J_0.* exp((q* V)./(n* K* T)).* (1 - (exp(-q* V)./(K* T))) and it works, but again how do I know where to use element-wise operators?
Srijith Kasaragod
Srijith Kasaragod 2021 年 9 月 3 日
編集済み: Srijith Kasaragod 2021 年 9 月 20 日
You have 11 voltage values in array 'V'. Your requirement is to find corresponding 11 current values and plot the I-V characteristics. The two terms being multiplied in line 11 are both of size 1-by-11. To get the required current values, you have to perform element-wise multiplication between these two arrays. Matrix multiplication would give either 1-by-1 or 11-by-11 matrix according to the order of matrix multiplication, which is not the desired output.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by