All Questions

Tagged with
Filter by
Sorted by
Tagged with
0
votes
1answer
27 views

How to calculate Sum of a function over a list

tlist = Table[i, {i, 1, 10}] tlist:{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} f = E^(-((2 t)/T)); ...
0
votes
0answers
28 views

How can I parallaize expresion that contains ParallelSum?

I have this code where the last part contains ParallelSum ...
0
votes
1answer
109 views

How can we speed up a matrix multiplication using ParallelTable and ParallelISum?

I do belive that Mathematica can work as fast as other packages, but it is really sensitive to the way we write the code. Here I would like to evaluate a trace resulted from a matrix multiplication at ...
0
votes
1answer
42 views

How can I use ParallelTable with ParallelSum effectively?

I have this expression (as an example) as a function of nc and nr (real one is more nasty) ...
8
votes
1answer
76 views

Local variables in sums and tables - best practices?

Stumbled on Local variables when defining function in Mathematica in math.SE and decided to ask it here. Apologies if it is a duplicate - the only really relevant question with a detailed answer I ...
2
votes
0answers
66 views

Unexpected result given by Sum [closed]

Consider the following (minimal?) working example: ...
1
vote
2answers
55 views

Sum up different arrays into a new array

I have a question regarding sums in arrays. So I have the following array: ...
4
votes
3answers
871 views

How to speed up large double sums in a table?

I am calculating a 3-by-3 matrix whose elements are given as follows: $$ M_{mn} = \frac{1}{N}\sum_{i=1}^N \sum_{j=1}^N (r^i_m - r^j_m)(r^i_n - r^j_n) \tag{1} $$ where $N$ is the total number of ...
0
votes
2answers
235 views

Create and manipulate list with variable length?

Is there a way to create and manipulate a function of a sum of arbitrary length? Specifically, I'd like to create a function like the following: ...
5
votes
2answers
242 views

Cumulative total of columns in a matrix or table

I have the following: matrix1 = {{a, b, c, d}, {e, f, g, h}, {i, j, k, l}, {m, n, o, p}} (Note that it's the data that matters, not the fact it's defined as a ...
1
vote
1answer
64 views

Summing results of a table

I have a simple table: example1 = Table[N[x^(x/r), 5], {r, 1, 10}, {x, 1, 10}] I want to create a new table ...
11
votes
2answers
212 views

How to correctly implement in a new function the scoping behavior of Table, Sum and other commands that use Block to localize iterators?

It is documented that "Block is automatically used to localize values of iterators in iteration constructs such as Do, Sum, and Table." Therefore the dummy index (iterator) in a Sum is shielded ...
0
votes
1answer
109 views

Accessing the elements in a table is slower than calculating each time?

This is a follow-up of How to accelerate combinations and sum calculations here? I have tried all tricks but when N reaches 35 the time is still intimidating in a 16-core server, which is far better ...
1
vote
0answers
39 views

Partial Sum of Binary Sequence not Working

I have the following code: ...
4
votes
1answer
516 views

How to increase the evaluation speed of this somewhat complicated table / matrix operation?

I'd like to calculate the following one-dimensional array: OneDimArray = Table[(Norm[Sum[ MatrixA[[i,j]]VectorB[[j]],{j,N}]])^2,{i,N}] However this takes a very ...
3
votes
5answers
129 views

tabulating summation series with restrictions

Trying to solve this question for a good 5 hours but remained stuck. My intuition tells me I am missing something trivial that I've overlooked or forgotten. I am restricted only to the function 'table'...
0
votes
1answer
159 views

Follow up: how to evaluate this double sum quickly

This question is a follow-up to my previous question. The code I use at the moment is the following: ...
1
vote
1answer
485 views

Summing terms in Table

I have a table that looks like Table[m, {k, 10}, {j, k}, {i, j}] where, m is a square matrix that depends on the indices $i, ...