thank you! )) but I need to use my values, now just variables (Ts,Pole1 etc)
I was trying this: r=2*2*pi Pole1=r*exp(I*2*pi/3) Pole2=-r Pole3=r*exp(-I*2*pi/3) Ts=0.1 z = exp(I*2*pi*Ts*f) p = (2/Ts)*(z-1)/(z+1) H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) show(H) show() works fine, but if i want to use H function now: round(H(4).abs(),5) a have got "Type error" message :-\ On Dec 9, 2:11 am, bsdz <[EMAIL PROTECTED]> wrote: > (Sorry if this reply appears twice - 1st one disappeared?) > > This worked for me: - > > H, p, Pole1, Pole2, Pole3, Ts, z, f = var("H p Pole1 Pole2 Pole3 Ts z > f") > p = (2/Ts)*(z-1)/(z+1) > z = exp(I*2*pi*Ts*f) > H = (p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) > show(H) > > The only difference is that I have declared the variables in the first > line. Hope that helps. > > On Dec 8, 5:58 pm, Sand Wraith <[EMAIL PROTECTED]> wrote: > > > Hi all! Please help me to replace variables: > > > I have this function: > > > H(p)=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) > > > where Pole1,Pole2,Pole3 - complex: > > > r=2*2*pi > > Pole1=r*exp(I*2*pi/3) > > Pole2=-r > > Pole3=r*exp(-I*2*pi/3) > > Ts=0.1 > > > And I need to make a few replaces: > > > need to replace "p" with "(2/Ts)*(z-1)/(z+1)", where z is a new > > variable, and then replace "z" with "exp(I*2*pi*Ts*f)". To have H(f) > > function at the end. > > > I am trying to write: > > > z=exp(I*2*pi*Ts*f) > > p=(2/Ts)*(z-1)/(z+1) > > H=(p^3)/((p-Pole1)*(p-Pole2)*(p-Pole3)) > > > and now if I want to look at H: > > H > > or > > show(H) > > I've got many errors... > > > tail of long output: > > > <sage-display> > > stdin:16:Incorrect syntax: Syntax error > > _tmp_ : (8000.0( > > ^ > > <sage-display>(%o90) > > > what is wrong with it? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---