cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Summation of the table values

Sergey
15-Moonstone

Summation of the table values

Hello!

 

How can I sum all the values given in a table by using the Summation operator? Each row is n=1, n=2 and so on.

Please, take a look at the attached file.

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Sergey)

Its not clear to me what you are looking for or what result you expect

Is it something like this:

Werner_E_0-1668898669139.png

or do you expect a vector of values as result?

Werner_E_1-1668898776461.png

 

You should also know that the first index of a vector is by default 0, not 1. This behaviour can be changed by setting ORIGIN to a value other than zero.

What you calculated simply was 

Werner_E_2-1668898973223.png

Note that du.1*du.1 is a scalar vector product!

 

 

View solution in original post

5 REPLIES 5
Werner_E
25-Diamond I
(To:Sergey)

Its not clear to me what you are looking for or what result you expect

Is it something like this:

Werner_E_0-1668898669139.png

or do you expect a vector of values as result?

Werner_E_1-1668898776461.png

 

You should also know that the first index of a vector is by default 0, not 1. This behaviour can be changed by setting ORIGIN to a value other than zero.

What you calculated simply was 

Werner_E_2-1668898973223.png

Note that du.1*du.1 is a scalar vector product!

 

 

Sergey
15-Moonstone
(To:Werner_E)

Hello.

I was expecting the first result you listed.

Thank you.

Sergey
15-Moonstone
(To:Werner_E)

Did you compute this in Prime or in Mathcad 15?

I do not get the right result in Prime (should be 12)

Sergey_0-1668901756853.png

 

Werner_E
25-Diamond I
(To:Sergey)


@Sergey wrote:

Did you compute this in Prime or in Mathcad 15?

 


No, it was done in Prime.

leave away the "n=1" and upper limit "6". Leave the placeholders simply empty.

 

du.1^2 is squaring a vector, Actually this is an invalid operation and Prime could (should?) throw an error. Instead it applied implicit vectorization, doing the squaring element by element and the result is a vector. The sum (without lower and upper limit) simply sums up the elements of this vector.

What you wrote add this vector six times and the result again is a vector. To can use this running index from 1 to 6 but first you would have to set ORIGIN to 1 and then you would have to use a vector index du.1[n.

Werner_E_0-1668905306325.png

 

 

Doing it the way I showed is easier, though.

 

Sergey
15-Moonstone
(To:Werner_E)

Thanks a lot. A very usefull technique.

Announcements

Top Tags