Items tagged with sum sum Tagged Items Feed

Hey all, I am new to the Maple software.

I have a question: how to find sum of all elements in a sequence?

For example , A:=[1,2,3,4]  the stupid way to find the sum is add them together by : A[1]+A[2]+A[3]+A[4]=10

Is there a better way to sum them together?

Surely this is a bug.

> 0^0;
                 1 
> sum( 0^m, m=0..infinity );
                 0

I'm trying to find the partial sum of the function. Now I need to plot the first couple partial sums onto 1 graph.

I'm not really sure how to input the plot function. I was able to graph it by inputting each partial sum function but I would prefer an easier solution.

The limit of

G := N -> sum(1/N*numtheory[sigma](k)/k,k=1..N ) 

as N -> infinity should be Pi^2/6. However

eval( G(N), N=infinity );

returns 0.

Can anyone explain this puzzling behaviour?

Hi,

This may be just my lack of maple syntax, however I cannot seem to find a way to add upper indicies in tensors (without first converting them to some other object, array, matrix etc)

In the physics package an example is just the metric tensor. 

I am trying to do something like this:

 

with(Physics);

add(g_[~mu,2], mu=1..2) 

Is there an easy way of summing upper indicies? Obviously lower indicies work, because the add/sum command recognizes the variable to iterate. 

Thanks in advance,

Age

 

Hi guys

 

I have an if statement inside a function. This function then get's called in a sum. However, the result is not correct as the if statement checks wether the argument equals 0, but since the sum passes only the summation index name, it doesn't work as intended.

How can I tell Maple, that it has to evaluate the index before passing it on? MWE appended.

 

Cheers

NOh

Comm := proc (n) options operator, arrow; `if`(n = 0, 1, 0) end proc;

proc (n) options operator, arrow; `if`(n = 0, 1, 0) end proc

(1)

Comm(0);

1

(2)

sum(Comm(j), j = 0 .. 0);

0

(3)

``

 

Download MWE.mwMWE.mw

Consider the following sum:


We know that if k is between 1 and N, the result will be



and otherwise the sum is zero.

How can I tell maple to compute this sum in each case without giving numerical values to the parameters "N" and "k"?

Thanks. :)

Hi Again

Assume that we have known matrix namely, Q, of order (m+1)*(m+1) and we want to construct following matrix

where 0(bar) is zero matrix of orde (m+1)*(m+1) and New matrix should be of order {N*(m+1)}*{N*(m+1)} where N is known constant.

thanks for any guide


Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department

I want to sum over several variables at once.

 

For example, something like

add(add(add(f(k1,k2,k3),k1=range1),k2=range2),k3=range3);

sums over 3 variables. But this can only be done if I know the number of variables in advance. I want to write a code that will sum over m variables, with m being supplied on demand.

 

Maple can do this for integrals. If I write

int(f(seq(k[i],i=1..m)),[seq(k[i]=range[i],i=1..m)]);

the integral is computed over m variables, for any m.

 

How can something like this be implemented for summation?

 

We know that sum can return an symbolic summation, for example,

 

But sometime the relation of parameters in series cannot be defined easily. And it seems that sum cannot correctly determine the symbolic summation of this kind of series:


Maybe it's due to the value of _C(infinite) is undefined. Does anyone have good idea to compute the symbolic summation of this series?

I'd appreciate any help on this topic. Thank a lot.

sum_cannot_return_symbolic_summation.mw

Hi everyone,

I wanted to plot the fourier series up to a given order of a step function using the code I attached, to change the order I used a sum with upper boundary M. When setting M to a particular value and plotting the function the result is obtained within a second, when on the otherhand using plot(subs(M=11,...),...) it takes close to a minute to produce a picture.

This might be a misuse of subs, in any case, I wanted to share my experience and maybe get an explanation about why this takes that much longer.

Cheers,

Sören

restart

f := proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

proc (t) options operator, arrow; sum(-4*sin((2*n+1)*t)/(Pi*(2*n+1)), n = 0 .. M) end proc

(1)

plot(subs(M = 11, f(t)), t = 0 .. 2*Pi)

 

M := 11; plot(f(t), t = 0 .. 2*Pi)

 

Download fourier_subs.mw

I have an expression like this:

Since it is linear I want Maple to rewrite it into this:

(with the benefit that Maple then can solve it at least up to a point). i have tried to conceive a rule to do that but got stuck relatively quickly. Does anybody have a way to do this (in some genrality)?

Thanks,

Mac Dude.

 

Hi,

Maybe someone can give me a nice answer without Maple.

I am given a fourier series:
ln|cosx|=Co - sum( (-1)^k/k * cos2kx,k=1..infinity)
and am asked what this tells me about the chevychev series for ln(u).

 

Thanks

Hi,

I have

Let

A:= sum(a[n]*phi(n)+b[n+1]*phi(n+2),n=0..N);

Please, I need to write this sum, using only phi(n), how can I use maple to get the solution.

Thank you very much for any idea.

 

 

 

 

 

 

 

f:=C->sum(x[cat(new,c)],c=1..C);

f(4) # does not give me what i want , which is

x[cat(new,1)]+x[cat(new,2)]+x[cat(new,3)]+x[cat(new,4)];

 

seq(x[cat(new,c)],c=1..4);
convert([%],`+`);

This works. But it's just a simple example to illustrate my problem.

 

Is there a way to fix this 'cat' problem in the procedure 'f'?

 

Thanks,

 

casper

1 2 3 4 5 6 7 Last Page 1 of 9