%Vara ursprungsvariabler
k=0.3298;
Ut=2.1611;

Idq=0.04;
Vdd=10;
Udsq=5;

Rd=100;
Rs=23.5;

R1=195000;
R2=110000;

Vg=Vdd*(R2/(R1+R2))
%Anta Idsq korrekt
%Ugsq=Vg-(Idq*Rs)
Ugsq=sqrt((2*Idq)/k)+Ut
%Ugsq=2.88;

gm=sqrt(2*k*Idq)

Au=-(Rd*gm)/(1+Rs*gm)

Rkvot=(Ugsq+Rs*Idq)/Vdd
R1R2=(1/Rkvot)-1



