## Network Functions : example 10.35 : (pg 10.35)
import math
m=(2./(math.sqrt(2.)*math.sqrt(10.)));
a=90.;
x=(a-math.atan(3.)*57.3-math.atan(1)*57.3);
print("\nF(s) =(4s/s^2+2s+2) = 4s/(s+1-j)*(s+1-j)");
print("\n At s=j2");
##pmag = phasor magnitudes
print("\n|F(j2)|=Product of pmag from all zeros to j2/Product of pmag from all poles to j2");
print"%s %.2f %s"%("\n = ",m,"");
print"%s %.2f %s"%("\nf(w) = atand(2/0)-atand(3)-atand(1)= ",x," degrees");
## Network Functions : example 10.36 : (pg 10.35 & 10.36)
import math
m=((5.*math.sqrt(17.))/(math.sqrt(20.)*4.));
a=90.;
w=(math.atan(4.)*57.3+math.atan(4/3.)*57.3-(a)-math.atan(4/2.)*57.3);
print("\nF(s) = (s+1)(s+3)/s(s+2))");
print("\nAt s=j4");
##vmag = vector magnitudes
print("\nPrduct of vmag from all zeros to j4/ Product of vmag from all poles to j4");
print"%s %.2f %s"%("\n =",m,"");
print("\nphi(w)= atand(4)+atand(4/3)-atand(4/0)-atand(4/2)");
print"%s %.2f %s"%("\n = ",w," degrees");