Symbolsk løsning av nodeligninger med Matlab
From ift
% Using Kirchoff's current law (KCL) on a source follower configuration % to find Vout as a function of Vin % Only Cgd is considered (Zc) % Kjetil Ullaland ligning1='(Vout-Vgs)/Zc+gm*Vgs+Vout/Rl=0'; ligning2='(Vgs-Vout)/Zc+(Vgs-Vin)/Rs=0'; ligning1=subs(ligning1,'1/(j*w*C)','Zc'); ligning2=subs(ligning2,'1/(j*w*C)','Zc'); pretty(ligning1); pretty(ligning2); disp('Solve for Vgs'); vgs_solved=solve(ligning2,'Vgs'); pretty(simplify(vgs_solved)); disp('Solve for Vout(vin)'); ligning3=subs(ligning1,vgs_solved,'Vgs'); Vout_solved=solve(ligning3,'Vout'); pretty(simplify(Vout_solved))
% Using Kirchoff's current law (KCL) on single transistor stage, fig. 9.18 % to find Vo as a function of Is % Kjetil Ullaland, 2015 syms Vo V1 s gm R1 R2 C C1 C2 Is Zc Rz; eq1=sym('(Vo-V1)/(Zc+Rz)+gm*V1+Vo/R2+Vo*s*C2=0'); eq2=sym('(V1-Vo)/(Zc+Rz)+V1*s*C1+V1/R1+Is=0'); eq1=subs(eq1,Zc,'1/(s*C)'); eq2=subs(eq2,Zc,'1/(s*C)'); solV1=solve(eq2,V1); eq3=simplify(subs(eq1,V1,solV1)); SolVo=simplify(solve(eq3,[Vo])); pretty(simplify(SolVo/Is));