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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

3-Visitor

I can't seem to get the summation function to work properly in mathcad using pre-defined vectors.

Here is the issue, I've tried every which way to get this summation to work, but it keeps giving me an "undefined variable" error.  I tried adding the matrix vector operator "[" to indicate the "i" index, but that didn't seem to work either.

Can someone point me in the right direction here?

1 ACCEPTED SOLUTION

Accepted Solutions

1) You used the wrong equal sign when you tried to define alpha and lambda. You must use the assignment (:=) and not the boolean (the bold equal sign)

2) At least lambda must also be assigned the correct unit (1/s) as otherwise you get an error because the exponent lambda*t2 must be dimensionless. You may consider assigning alpha a correct unit, too, so the outcome Gamma.total can be shown with the correct unit.

Gamma normally will be shown in W. If you want MeV/s to be seen, you simply overwrite W by the unit you want to see and Prime adjusts the rest as needed.

8 REPLIES 8
21-Topaz I
(To:uninc4life2010)

Hi,

Matrix indexing is first element is numbered zero by default.  Your summation interval is 1 to 11.

Two options.

One change the indexing to 0 to 10

Two set the worksheet variable ORIGIN := 1

Cheers

Terry

21-Topaz I
(To:terryhendicott)

Hi,

You also need to add the indexing [i to each instance of alpha and lambda in the summations

Cheers

So, I added '[' index i's to all of the lambda and alpha terms and changed the summation bounds from i=0 to 10, but MATHCAD is still giving me the same error.

Your first approach can't work the way you had set it up but there might be a simples way doing it using vectorization

Your second approach should work if you have set ORIGIN to 1 and if you used the correct subscript (matrix index as you said you have done) and if the various P.. and t.. are defined above.

The error message you describe ("undefined variable") indicates that the problem is not a wrong ORIGIN setting but rather a problem with Prime's infamous auto-label feature. Check if all lambda and all alpha are labelled the same (either "variable" or "-").

It's hard to debug just a picture and so it would be a good idea if you attach your worksheet as well.

If you don't use the latest version of Prime you should also state which version you are using.

3-Visitor
(To:Werner_E)

I'm not really sure what you mean by "setting ORIGEN:=1."  I attached my worksheet and made corrections to the indexing range.  The problem starts on page #4.  I'm using Prime 5.0.

1) You used the wrong equal sign when you tried to define alpha and lambda. You must use the assignment (:=) and not the boolean (the bold equal sign)

2) At least lambda must also be assigned the correct unit (1/s) as otherwise you get an error because the exponent lambda*t2 must be dimensionless. You may consider assigning alpha a correct unit, too, so the outcome Gamma.total can be shown with the correct unit.

Gamma normally will be shown in W. If you want MeV/s to be seen, you simply overwrite W by the unit you want to see and Prime adjusts the rest as needed.

3-Visitor
(To:Werner_E)

That is exactly what the problem was.  I knew it had to have been something simple that I had overlooked.  Thank you for taking a look for me.

24-Ruby V
(To:Werner_E)