Symbolsk løsning av nodeligninger med Matlab: Difference between revisions
From ift
mNo edit summary |
mNo edit summary |
||
Line 2: | Line 2: | ||
% Using Kirchoff's current law (KCL) on a source follower configuration | % Using Kirchoff's current law (KCL) on a source follower configuration | ||
% to find Vout as a function of Vin | % to find Vout as a function of Vin | ||
% Kjetil Ullaland | % Kjetil Ullaland | ||
ligning1='(Vout-Vgs)/Zc+gm*Vgs+Vout/Rl=0'; | ligning1='(Vout-Vgs)/Zc+gm*Vgs+Vout/Rl=0'; | ||
Line 12: | Line 12: | ||
disp('Solve for Vgs'); | |||
vgs_solved=solve(ligning2,'Vgs'); | |||
ligning3=subs(ligning1, | pretty(simplify(vgs_solved)); | ||
Vout_solved= | |||
pretty(Vout_solved) | disp('Solve for Vout(vin)'); | ||
ligning3=subs(ligning1,vgs_solved,'Vgs'); | |||
Vout_solved=solve(ligning3,'Vout'); | |||
pretty(simplify(Vout_solved)) | |||
</pre> | </pre> |
Revision as of 08:13, 9 September 2014
% Using Kirchoff's current law (KCL) on a source follower configuration % to find Vout as a function of Vin % 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))