Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hello,
I recently updated from Mathcad 15 to Mathcad Prime (8.0) and am having a problem with certain worksheets that contain a specific type of program. Specifically, programs where the calculation is dependent upon elements from the output vector that should already have been calculated. ie
x[i = x[(i-1) + y[i
(sorry for the notation - can't work out how to get subscripts on this forum).
I have attached a simple example worksheet of the problem. Is this type of self-referential programming no longer possible. If so can anyone suggest a work-around?
Apologies if this question has been asked and answered already. I had a look using the search function but was not able to find anything obvious. Many thanks for any assistance.
Ian
Solved! Go to Solution.
I can confirm that the behaviour is different from the one in real Mathcad 15. You may consider reporting it to PTC as being a bug.
As a workaround you could do without the range i using a for-loop. So you could just copy the old program in place:
The initialization could also be done directly without the if-statement and in your case there is no need to distinguish between i=1 and i>1
In case you have an example where the second value (i=1) also differs from the rest. you initialize with the appropriate vector and start the loop with 2
If you really want to use a worksheet range, you would have to do the initialization explicitly first and use a range starting just from 1.
EDIT: Another option, which I won't recommend, could be to turn the existing program into a recursive function and call it using the range i
I don't have P8 installed so the attached sheet is in P9 format. But you should see all thats needed in the pics anyway.
I can confirm that the behaviour is different from the one in real Mathcad 15. You may consider reporting it to PTC as being a bug.
As a workaround you could do without the range i using a for-loop. So you could just copy the old program in place:
The initialization could also be done directly without the if-statement and in your case there is no need to distinguish between i=1 and i>1
In case you have an example where the second value (i=1) also differs from the rest. you initialize with the appropriate vector and start the loop with 2
If you really want to use a worksheet range, you would have to do the initialization explicitly first and use a range starting just from 1.
EDIT: Another option, which I won't recommend, could be to turn the existing program into a recursive function and call it using the range i
I don't have P8 installed so the attached sheet is in P9 format. But you should see all thats needed in the pics anyway.
Hi Werner,
Thanks so much for your extensive reply. I'm sure there is one of the options that you have presented that will work for our purposes. I'll report the issue as a bug to PTC.
Ian