#9424: numerical evaluation of symbolic sums
----------------------------+----------------------------------------------
       Reporter:  burcin    |        Owner:  burcin
           Type:  defect    |       Status:  needs_review
       Priority:  major     |    Milestone:  sage-duplicate/invalid/wontfix
      Component:            |   Resolution:
  symbolics                 |    Merged in:
       Keywords:            |    Reviewers:
        Authors:            |  Work issues:
Report Upstream:  N/A       |       Commit:
         Branch:            |     Stopgaps:
   Dependencies:            |
----------------------------+----------------------------------------------
Changes (by rws):

 * status:  new => needs_review
 * milestone:  sage-6.3 => sage-duplicate/invalid/wontfix


Comment:

 Your problem is threefold: 1. you use `n` both as sum endpoint and
 variable, 2. Sage `sum` is only intended with symbolic endpoints, and 3.
 the need to use Python summation may require defining a Python function
 instead of a Sage symbolic function:
 {{{
 sage: sum?
 ...
 Warning: This function only works with symbolic expressions. To sum any
      other objects like list elements or function return values,
      please use python summation...

 sage: I(n)=sum(abs(y2(p(k))-y1(p(k)))*Delta,k,1,n);
 sage: I
 n |--> 2*sum(abs(-4*k^2 - 3*(2*k - 1)*n + 3*n^2 + 4*k - 1), k, 1, n)/n^3

 sage: def I(n):
 ....:     return (2*sum(abs(-4*k^2 - 3*(2*k - 1)*n + 3*n^2 + 4*k - 1) for
 k in range(1,n+1))/n^3)
 ....:
 sage: I(10)
 1301/250
 sage: [I(i) for i in range(1,11)]
 [2, 5, 46/9, 5, 26/5, 277/54, 254/49, 665/128, 418/81, 1301/250]
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/9424#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to