Test mixed signals matlab ELEN421 Matlab Project one due nex
Test mixed signals, matlab
Solution
clear;
%WIDLAR CURRENT SOURCE CIRCUIT%
%Here,I have used Guass-siedel method to solve the given non-algebraic equation of I_0%
I_ref=input(\'I_ref = (mA)\'); %If I_ref = 4mA give input as 4 only;
R_E=input (\'R_E= (kohms)\'); %If R_E = 2Kohms give input as 2 only;
I_0=1; %initial guess of I0 is 1 mA;
I_0K=(0.025/R_E)*log(I_ref/I_0); %calculating I_0 of next iteration;
N=0; %initiate no of iterations with N=0;
while abs (I_0K-I_0) > 0.00001;
I_0=I_0K;
I_0K=(0.025/R_E)*log(I_ref/I_0);
N=N+1;
end;
disp(\'Number of Iterations N=\')
N
disp(\'Widlar Current I(mA)=\')
I_0
| I_ref(mA) | R_E(Kohms) | I_0(mA) | N(no of iterations) |
|---|---|---|---|
| 4 | 2 | 0.0539 | 8 |
| 4 | 1 | 0.0938 | 9 |
| 3 | 2 | 0.0509 | 8 |
