Hello, I'd like to plot this function of x (latex code):
x/2 + sum_{r=1}^n cos(rx)
for some fixed n. However I'm running into problems... as I understand it
sage converts the sum of cosines in a sum of exponentials, but then somehow
doesn't get real values (and thus can't plot the function in the plane).
Below is the code and the error. Am I doing something wrong? I'm on sage
4.4.2

renato


k = var('k');
s(x,n) = x/2 + sum(cos(k*x),k,1,n);
n0 = 5;
plot(s(x,n0),(x,0,pi));

verbose 0 (3495: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 200 points.
verbose 0 (3495: plot.py, generate_plot_points) Last error message:
'can't convert complex to float; use abs(z)'

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to