Try this instead: # just as you had before: r=2*2*pi Pole1=r*exp(I*2*pi/3) Pole2=-r Pole3=r*exp(-I*2*pi/3) Ts=0.1 # one change here: var('f') z=exp(I*2*pi*Ts*f) p=(2/Ts)*(z-1)/(z+1) H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3))
Then H (or show(H)) will print out a complicated expression in terms of f, and H.subs(f=3) will plug in f=3. H.subs(f=3).n(4) will gives a decimal approximation to H.subs(f=3) to 4 bits of precision. H.subs(f=3).n(digits=12) will give an approximation to 12 decimal digits of precision. Or, as Tim Lahey hints, you could define a function: HH(x) = (x^3)/((x-Pole1)*(x-Pole2)*(x-Pole3)) Then 'HH(p)' will return the same thing as 'H' does. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---