Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi, @dan_fulea!

Thank you for the answer, it really works. However, I'm still confused, as your solution returned an object of type "ring", and I was expecting an object of type "symbolic". Being honest, as my background is in engineering, I do not know what a "ring" is, I have never being introduced to the concept of "rings" before. Nevertheless, as you observed the issue in preparsing the function, I searched a little more and found another solution that returns a symbolic object. If I change

gds.<omega> = QQ[]
group_delay_spec(omega) = gds(str_GroupDelaySpec)
print(group_delay_spec(omega))
print(type(group_delay_spec(omega)))

by

group_delay_spec(omega) = sage_eval(str_GroupDelaySpec, locals={'omega':omega})
print(group_delay_spec(omega))
print(type(group_delay_spec(omega)))

the code returns

omega + 5/2
<type 'str'>
omega + 5/2
<type 'sage.symbolic.expression.Expression'>