Items tagged with summation summation Tagged Items Feed

Greetings to all.

I would like to share a brief observation concerning my experiences with the Euler-Maclaurin summation routine in Maple 17 (X86 64 LINUX). The following Math StackExchange Link shows how to compute a certain Euler-MacLaurin type asymptotic expansion using highly unorthodox divergent series summation techniques. The result that was obtained matches the output from eulermac which is definitely good to know. What follows is the output from said routine.

> eulermac(1/(1+k/n),k=0..n,18);
     1       929569        3202291        691                O(1)
O(- ---) - ----------- + ----------- - --------- + 1/1048576 ----
     19             15            17          11              19
    n      2097152 n     1048576 n     32768 n               n

                                           n
                                          /
        174611      5461        31       |      1           17        1
     - -------- + --------- + ------- +  |   ------- dk - ------- + ------
             19          13         9    |   1 + k/n            7        5
       6600 n     65536 n     4096 n    /                 4096 n    256 n
                                          0

         1       1
     - ------ + ---- + 3/4
            3   16 n
       128 n

While I realize that this is good enough for most purposes I have two minor issues.

  • One could certainly evaluate the integral without leaving it to the user to force evaluation with the AllSolutions option. One can and should make use of what is known about n and k. In particular one can check whether there are singularities on the integration path because we know the range of k/n.
  • Why are there two order terms for the order of the remainder term? There should be at most one and a coefficient times an O(1) term makes little sense as the coefficient would be absorbed.

You might want to fix these so that the output looks a bit more professional which does enter into play when potential future users decide on what CAS to commit to. Other than that it is a very useful routine even for certain harmonic sum computations where one can use Euler-Maclaurin to verify results.

Best regards,

Marko Riedel

I have the following expression (obtained from an earlier calculation):

I want to collect all the terms under one summation. So I define a rule:

collectf:=proc(f)
A::algebraic*f(a::algebraic)+B::algebraic*f(b::algebraic)\
 +C::algebraic*f(c::algebraic)+D::algebraic*f(d::algebraic)=f(A*a+B*b+C*c+D*d);
end proc:

and then

applyrule(collectf(Sum),%);

I get

Error, (in +) unable to identify A::algebraic

I used similar constructs before so I think the rule is constructed correctly. I should, however, mention that I use the Physics:-Vectors package and in fact the expression I start up with here reads, in 1-d Maple inputform:

Physics[Vectors][`+`](Physics[Vectors][`+`](Physics[Vectors][`+`](-y*(Sum((diff(a[n](r), r))/(exp(I*Pi*n/L))^2, n))/r, (2*I)*(Sum(a[n](r)/(exp(I*Pi*n/L))^2, n))*k0), y*(Sum(a[n](r)/(exp(I*Pi*n/L))^2, n))*k0^2), -y*(Sum((diff(a[n](r), r, r))/(exp(I*Pi*n/L))^2, n)))

Is my problem related to the use of Physics:-Vectors? If so, how can I get around that?

TIA,

Mac Dude

How can I show the expression of the following summation as the output, not 11?

3+7+1

 

Hi,
Relevant developments in Physics happened during the last month and a 1/2, some of them of interest beyond the use of this package. Among the most exciting things I can mention:

  1. The redefinition of the derivative rule for the complex components (abs, argument, conjugate, Im, Re, signum) together with the introduction of Wirtinger calculus, as an user-option to work with complex variables. In other words: it is now possible to compute taking z and its conjugate as independent variables and in equal footing.
  2. Introduction of textbook mathematical display for all the inert functions of the mathematical language, also for unknown functions f(x).
  3. New options in Physics:-Setup to indicate that some mathematical objects are real (different from assume(x, real), while integrated with `is` and `coulditbe`).
  4. A rather large number of micro developments advancing the integration of Physics with simplify, expand and combine.
  5. Another large number of micro developments for quantum mechanics.
  6. New options in Physics:-Setup to redefine sum as Physics:-Library:-Add, and with that have access to multiindex summation directly from sum, for instance as in sum(f(i, j), i + j <= n), including related typesetting copy & paste.

As usual the latest version of the package is available for download in the Maplesoft Physics: Research & Development webpage  and in the zip there is a worksheet illustrating all these developments. Below I'm copying the section related to the new redefinesum option of Physics:-Setup and multiindex summation.

Thanks to everyone who provided feedback, it has been of great value and at the root of this new round of developments.

December 4

 
• 

New option in Setup: redefinesum, so that the sum command is redefined in such a way that
    a) the sum arguments are processed in a way avoiding premature evaluation and related unexpected results or error interruptions
    b) the sum command includes new functionality present in Physics:-Library:-Add to perform sum over integer values of many indices, as in

"(&sum;)S(i,j)"     or  "(&sum;)S(i,j)" 

restart; with(Physics); Setup(notation = true)

`* Partial match of  'notation' against keyword 'mathematicalnotation'`

 

[mathematicalnotation = true]

(1.1)

New option: redefine sum so that its arguments are processed by the more modern Physics:-Library:-Add and so that it can perform multiindice summation.

 

Example:

By default, the sum command is not redefined, so the value of redefinesum is

Setup(redefinesum)

[redefinesum = false]

(1.2)

Consider this multiindex summation functionality of the Physics:-Library:-Add command

Library:-Add(f[i, j], 1 <= i+j and i+j <= n)

Physics:-Library:-Add(f[i, j], i+j <= n, lowerbound = 1)

(1.3)

For instance, for n = 2,

eval(Physics[Library]:-Add(f[i, j], i+j <= n, lowerbound = 1), n = 2)

f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0]

(1.4)

This functionality can be plugged directly into the sum command. For that purpose, set redefinesum to true

Setup(redefinesum = true)

[redefinesum = true]

(1.5)

You can now compute directly with sum. The left-hand side is inert while the right-hand side is computed

(%sum = sum)(f[i, j], i+j <= 2)

%sum(f[i, j], i+j <= 2) = f[0, 0]+f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0]

(1.6)

(%sum = sum)(f[i, j], 1 <= i+j and i+j <= 2)

%sum(f[i, j], 1 <= i+j and i+j <= 2) = f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0]

(1.7)

value(%sum(f[i, j], 1 <= i+j and i+j <= 2) = f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0])

f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0] = f[0, 1]+f[1, 0]+f[0, 2]+f[1, 1]+f[2, 0]

(1.8)

The formula for the integer power of a sum

(a+b+c)^n = sum(factorial(n)*a^p*b^q*c^r/(factorial(p)*factorial(q)*factorial(r)), p+q+r = n)

(a+b+c)^n = sum(Physics:-`*`(Physics:-`*`(Physics:-`*`(Physics:-`*`(factorial(n), Physics:-`*`(1, Physics:-`^`(Physics:-`*`(Physics:-`*`(factorial(p), factorial(q)), factorial(r)), -1))), Physics:-`^`(a, p)), Physics:-`^`(b, q)), Physics:-`^`(c, r)), p+q+r = n)

(1.9)

eval((a+b+c)^n = sum(Physics[`*`](Physics[`*`](Physics[`*`](Physics[`*`](factorial(n), Physics[`*`](1, Physics[`^`](Physics[`*`](Physics[`*`](factorial(p), factorial(q)), factorial(r)), -1))), Physics[`^`](a, p)), Physics[`^`](b, q)), Physics[`^`](c, r)), p+q+r = n), n = 2)

(a+b+c)^2 = a^2+2*a*b+2*a*c+b^2+2*b*c+c^2

(1.10)

eval((a+b+c)^n = sum(Physics[`*`](Physics[`*`](Physics[`*`](Physics[`*`](factorial(n), Physics[`*`](1, Physics[`^`](Physics[`*`](Physics[`*`](factorial(p), factorial(q)), factorial(r)), -1))), Physics[`^`](a, p)), Physics[`^`](b, q)), Physics[`^`](c, r)), p+q+r = n), n = 3)

(a+b+c)^3 = a^3+3*a^2*b+3*a^2*c+3*a*b^2+6*a*b*c+3*a*c^2+b^3+3*b^2*c+3*b*c^2+c^3

(1.11)

Verify whether this equation is true

(`@`(evalb, expand))((a+b+c)^3 = a^3+3*a^2*b+3*a^2*c+3*a*b^2+6*a*b*c+3*a*c^2+b^3+3*b^2*c+3*b*c^2+c^3)

true

(1.12)

Besides this new functionality, the redefined sum does a more modern handling of its arguments, consider a typical problem posted in Maple primes

a := 1; b := 2; j := 3

1

 

2

 

3

(1.13)

In the following summation, j is a dummy summation index, so the value just assigned, j := 3, is not expected to interfer with the summation. This is the case with the redefined sum

sum(f(j), j = a .. b)

f(1)+f(2)

(1.14)

while without redefining sum the input above is interrupted with an error message. Likely, in this other case also reported in Mapleprimes

g := proc (j) options operator, arrow; if j::odd then G[j] else 0 end if end proc

proc (j) options operator, arrow; if j::odd then G[j] else 0 end if end proc

(1.15)

the following two summations can be performed after having redefining sum:

sum(g(i), i = 1 .. f)

sum(g(i), i = 1 .. f)

(1.16)

For the summation above, without redefining sum, it returns 0 instead of unevaluated, because of a premature evaluation of the function g(i) with an unassigned index i before performing the summation. Returning unevaluated as (1.16) permits evaluate the sum at a latter moment, for instance attributing a value to f

eval(sum(g(i), i = 1 .. f), f = 3)

G[1]+G[3]

(1.17)

And this other sum where f is given from the begining also returns 0 without redefining sum

sum(g(i), i = 1 .. 3)

G[1]+G[3]

(1.18)

Problems like this other one reported in Mapleprimes here also get resolved with this redefinition of sum.

 

 

Download sum_in_physics.mw

Edgardo S. Cheb-Terrab
Physics, Maplesoft

 

Would really appreciate the help in doing this question!

Pi= infinity Σ n=0 ((120n^2+An+B)/(16^n(512n^4+1024n^3+712n^2+194n+15))) for some positive integers A,B.

Hint: Set A=0 to find B, then find A.

I'm so clueless as to how to do this. THANK YOU!

 

Hi, I want to print     t[n] / (-1)^n * sum   as following, but I don't know where the error is. Please help me.

Thank you very much.



``

convert 1/(1+z) to 

Summation(....  

Let n be any positive Integer :\displaystyle \sum_{k=0}^{n-1}(\sqrt{ak^3+bk^2+ck+1}-\sqrt{ak^3+bk^2+ck})^{\frac{1}{3} }=\sqrt{n}. Find

Dear all,

I'm trying to substitute a combination of variables in an equation that is partly covered in a summation.

For example consider the equation with two variables A and B, and two function W(t) and q(z):

eq1:=A*B*(sum(W[n](t)*q[n](z), n))

now I want to do the substitution:

How does one take the gradient of a expression involving sums in terms of a set of indexed variables.

I am trying to find the maxima for the satisfaction for a public good from a tax code. The sum represents the total revenue. The tax code is defined as a piecewise linear function of income and indexed variables. The indexed variables represent the points of the kinks and the marginal tax rate for each income bracket. (The set of indexed variables will vary...

Hi

I want to write the following summation but Maple give the following error


summation: 

Hi there,

I have

x[i]=sum(sin(theta[j](t)), j = 1 .. i-1)

x[i]=sum(sin(theta[j](t)), j = 1 .. i-1)

assuming i is integer and  i>=1 can Maple help me to differentiate with respect to time t ( for example diff(x[i],t) ) so

i am doing a Q Laplace and finally summation it

however, i find an AccurateQSummation which is not like Summation

Should i use it, if not, use SumTools' summation how to simplify it?

 

restart;
with(QDifferenceEquations):
qexp := QPochhammer(-(-p*t), q, infinity);
f:= qexp*t;
b := subs(t=q^n,f);
QSimplify((1-q)*AccurateQSummation(b*q^n,n=-infinity..infinity));

with(SumTools):
QSimplify((1-q)*Summation(b*q^n,n=-infinity..infinity));

How to laplace transform for hypergeometric form in maple

if rsolve is solving difference equation for L(x) in summation(L*z^n, n=0..infinity)

can i use double encapsulation to solve for summation(L*z^n/n!, n=0..finity)

step 1 use rsolved result of a given classic difference equation times z^n/n! * t^n

step 2 then summation step 1 and use celine method to change into difference equation again

step 3 solve this new difference equation

then i imagine L should be L*z^n/n!

but i am not sure...

1 2 Page 1 of 2