Does anyone knows why after the substitution below, the scaled_s21 variable becomes of type 'sage.symbolic.expression.Expression' instead of continuing as 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'?
I'm confused. I just wanted to use the numerator() and denominator() methods, but with the type changing, I'm unable.
Thnak you!
s = polygen(CC, "s")
p = 0.894289785676221
e = s^4 + 2.14081977623463*s^3 + 3.15237117897600*s^2 + 2.31898630138664*s + 0.902488008823108
s21 = p/e
print(s21)
print(type(s21))
print(s21.parent())
omega0 = sqrt(2*pi*750e6*2*pi*1250e6)
scaled_s21 = s21.subs(s=omega0/(2*pi*1250e6-2*pi*750e6)*(s/omega0 + omega0/s))
print(scaled_s21)
print(type(scaled_s21))
print(scaled_s21.parent())
Output:
0.894289785676221/(s^4 + 2.14081977623463*s^3 + 3.15237117897600*s^2 + 2.31898630138664*s + 0.902488008823108)
<class 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>
Fraction Field of Univariate Polynomial Ring in s over Complex Field with 53 bits of precision
0.894289785676221/(1.00000000000000*(3.75000000000000e9*pi/s + (1.00000000000000e-9)*s/pi)^4 + 2.14081977623463*(3.75000000000000e9*pi/s + (1.00000000000000e-9)*s/pi)^3 + 3.15237117897600*(3.75000000000000e9*pi/s + (1.00000000000000e-9)*s/pi)^2 + 8.69619863019990e9*pi/s + (2.31898630138664e-9)*s/pi + 0.902488008823108)
<type 'sage.symbolic.expression.Expression'>
Symbolic Ring