I need to find the current of a diode in Matlab there are 2 equations and I couldn't find an intersection point. There is no real intersection point in this functions but I need to find the closest possible current values possible (need 3 correct digits after point) current code is here;
clc;
close all;
clear all;
a=27;% tempature in celcius
b=2*(10.^(-14));%saturation current
q=1.6e-19;%electron charge
k=1.38e-23;%boltzman's constant
t=a+273;%temp in kelvin
v=-0.2:0.00001:0.715;%source voltage
i=b*(exp(q*v/(k*t))-1);%diode i-v characteristic formula
i2=(5-v)/1000;%kirchoff's voltage law formula
plot (v,i,v,i2)
xlabel('Voltage -->')
ylabel('Current -->')
grid on;
axis([0.2 2 0 0.03])`
I need to find closest i
and i2
values. And because of I'm going to do it repeatedly I have to formulate it.