Skip to main content
1-Visitor
August 24, 2020
Question

How to use summation operator in mathcad prime

  • August 24, 2020
  • 3 replies
  • 7545 views

Hi,

I am not able to use summation operator in Mathcad prime. Please find attached the mathcad file.

TIA

    3 replies

    23-Emerald I
    August 24, 2020

    There are two kinds of subscripts:

    • literal subscripts ("cntrl -") that give you a variable name with a subscript, and
    • an index subscript ("[") that gives you a referenced element in a vector or array

    You assigned literal subscripts, then attempted to address them as elements in vectors.

     

    See attached, watch for highlighted expressions.

    1-Visitor
    August 24, 2020

    Thanks Fred

    23-Emerald IV
    August 24, 2020

    You are using literal subscripts (Created with CTRL-_) instead of indexes (created with [ ).

    So your Ei is undefined, and E is defined, but a scalar, not a vector. You cannot use the summation operator like that  on a scalar.

     

    Success!

    Luc

    25-Diamond I
    August 24, 2020

    OK, I see that my first two concerns here

    https://community.ptc.com/t5/PTC-Mathcad/How-to-sum-a-range-variable/m-p/683865/highlight/true#M191531

    obviously were justified. Thanks to my crystal ball ;-).

     

    As you were already told you have to use the vector/matrix index (either from the menu ribbon or via the shortcut [) to create a vector with indexed elements.

    And you did not change the system variable ORIGIN. By default this variable is set to zero which means, that the first element of a vector has the index 0 (so you would have to sum from 0 up to 2). Setting ORIGIN to 1 (via the ribbon menu or simply like an ordinary variable at the top of the sheet) enables you to write the summation the same way as in your inserted pictures.

    Werner_E_1-1598284405203.png

     

    Another way (independent of the value of ORIGIN) to do the sum without a range variable (as shown in the other thread) and without a summation index is shown below. Because two vector elements (E and t^3) are multiplied, we have to use vectorization (The arrow over the expression) as otherwise Prime would calculate the scalar product of the two vectors.
    Werner_E_0-1598284380312.png

     

    The latter would be an ever shorter way to calculate that value without an explicit sum:

    Werner_E_2-1598284551911.png

    Nonetheless I wouldn't suggest doing so as its absolutely unclear and not universally usable.