Roots of Symbolic Transfer Function

2 views (last 30 days)
Wesley
Wesley on 18 Dec 2024
Edited: Walter Roberson on 18 Dec 2024
I am trying to do some symbolic math. I can get a solution for the desired equation, Htf, ( S.Htf), but it is in a different form than I would like.
syms s gm1 gmp ro1 rop R2 R1 Cgs Cout Zcgs Zcgd Zcout Z1 Z2 Vinp Vinm Vout1 Vd Vout2 Htf
eqn1 = Vout1 == (-gm1*Vinp + gm1*Vinm)*Z1;
eqn2 = Z1 == 1/(1/ro1 + 1/Zcgs);
eqn3 = Vd == (-gmp*Vout1)*Z2;
%eqn4 = Iout1 == (Vout1 - Vd)/Zcgd;
eqn5 = Z2 == 1/(1/rop + 1/(R2 + R1) + 1/Zcout);
eqn6 = Vinm == Vd*(R1/(R1 + R2));
eqn7 = Vout2 == Vd*(Zcout/(Zcout));
eqn8 = Zcgs == 1/(s*Cgs);
%eqn9 = Zcgd == 1/(s*Cgd);
eqn10 = Zcout == 1/(s*Cout);
eqn11 = Htf == Vout2/Vinp;
%S = solve(eqn1,eqn2,eqn3,eqn5,eqn6,eqn7,eqn8,eqn10,eqn11,Zcgs,Zcgd,Zcout,Z1,Z2,Vinp,Vinm,Vout1,Vd,Vout2,Iout1,Htf,ReturnConditions=true);
S = solve(eqn1,eqn2,eqn3,eqn5,eqn6,eqn7,eqn8,eqn10,eqn11,Zcgs,Zcgd,Zcout,Z1,Z2,Vinp,Vinm,Vout1,Vd,Vout2,Htf);
S.Htf looks like:
S.Htf = (R1*gm1*gmp*ro1*rop + R2*gm1*gmp*ro1*rop)/(R1 + R2 + rop + Cgs*R1*ro1*s + Cgs*R2*ro1*s + Cout*R1*rop*s + Cout*R2*rop*s + Cgs*ro1*rop*s + R1*gm1*gmp*ro1*rop + Cgs*Cout*R1*ro1*rop*s^2 + Cgs*Cout*R2*ro1*rop*s^2)
I would like to get this in a symbolic form with factored roots in the variable 's', so that the equation looks like:
S.Htf = A/( (B + s)*(C+s) )
Is there a good way to accomplish this? I am struggling to figure it out.

Answers (1)

Walter Roberson
Walter Roberson on 18 Dec 2024
Edited: Walter Roberson on 18 Dec 2024
syms s gm1 gmp ro1 rop R2 R1 Cgs Cout Zcgs Zcgd Zcout Z1 Z2 Vinp Vinm Vout1 Vd Vout2 Htf
eqn1 = Vout1 == (-gm1*Vinp + gm1*Vinm)*Z1;
eqn2 = Z1 == 1/(1/ro1 + 1/Zcgs);
eqn3 = Vd == (-gmp*Vout1)*Z2;
%eqn4 = Iout1 == (Vout1 - Vd)/Zcgd;
eqn5 = Z2 == 1/(1/rop + 1/(R2 + R1) + 1/Zcout);
eqn6 = Vinm == Vd*(R1/(R1 + R2));
eqn7 = Vout2 == Vd*(Zcout/(Zcout));
eqn8 = Zcgs == 1/(s*Cgs);
%eqn9 = Zcgd == 1/(s*Cgd);
eqn10 = Zcout == 1/(s*Cout);
eqn11 = Htf == Vout2/Vinp;
%S = solve(eqn1,eqn2,eqn3,eqn5,eqn6,eqn7,eqn8,eqn10,eqn11,Zcgs,Zcgd,Zcout,Z1,Z2,Vinp,Vinm,Vout1,Vd,Vout2,Iout1,Htf,ReturnConditions=true);
S = solve(eqn1,eqn2,eqn3,eqn5,eqn6,eqn7,eqn8,eqn10,eqn11,Zcgs,Zcgd,Zcout,Z1,Z2,Vinp,Vinm,Vout1,Vd,Vout2,Htf);
Warning: Solutions are only valid under certain conditions. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
[N,D] = numden(S.Htf);
R = solve(D, s);
HTF = N / ((R(1) - s) * (R(2) - s))
pretty(HTF)
R1 gm1 gmp ro1 rop + R2 gm1 gmp ro1 rop ------------------------------------------------------------------------------------------------------------------------------------------------------------- / Cgs R1 ro1 - #1 + Cgs R2 ro1 + Cout R1 rop + Cout R2 rop + Cgs ro1 rop \ / #1 + Cgs R1 ro1 + Cgs R2 ro1 + Cout R1 rop + Cout R2 rop + Cgs ro1 rop \ | s + ---------------------------------------------------------------------- | | s + ---------------------------------------------------------------------- | \ #2 / \ #2 / where 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 #1 == sqrt(Cgs R1 ro1 + 2 Cgs R1 R2 ro1 + 2 Cgs R1 ro1 rop + Cgs R2 ro1 + 2 Cgs R2 ro1 rop + Cgs ro1 rop - gm1 gmp Cgs Cout R1 ro1 rop 4 2 2 2 2 2 2 - 2 Cgs Cout R1 ro1 rop - gm1 gmp Cgs Cout R1 R2 ro1 rop 4 - 4 Cgs Cout R1 R2 ro1 rop - 2 Cgs Cout R1 ro1 rop - 2 Cgs Cout R2 ro1 rop - 2 Cgs Cout R2 ro1 rop 2 2 2 2 2 2 2 2 + Cout R1 rop + 2 Cout R1 R2 rop + Cout R2 rop ) #2 == (Cgs Cout R1 ro1 rop + Cgs Cout R2 ro1 rop) 2

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!