Skip to main content
4-Participant
April 1, 2024
Solved

Loop Conversion from MathCAD15 to Prime9 Variable Issue

  • April 1, 2024
  • 1 reply
  • 1577 views

When I ran the conversion tool it converted mathcad15 statement

GregH_0-1711982895273.png

to Prime 9 Statement

 

GregH_1-1711982963850.png

which only works if a precede it with an additional variable definition 

GregH_2-1711983031175.png

where NPS1 is already defined.

Any ideas why this additional variable statement is required for Prime9 but not Mathcad15?

 

 

Best answer by LucMeekes

What you are trying to do is equivalent to:

LucMeekes_0-1711992211298.png

At the time of creation of the vector, it's element values are unknown.

I guess Prime was built as an even more lazy machine than Mathcad, although, in Mathcad this doesn't work either:

LucMeekes_1-1711992364374.png

 

Success!
Luc

1 reply

LucMeekes23-Emerald IVAnswer
23-Emerald IV
April 1, 2024

What you are trying to do is equivalent to:

LucMeekes_0-1711992211298.png

At the time of creation of the vector, it's element values are unknown.

I guess Prime was built as an even more lazy machine than Mathcad, although, in Mathcad this doesn't work either:

LucMeekes_1-1711992364374.png

 

Success!
Luc

GregH4-ParticipantAuthor
4-Participant
April 2, 2024

Hello Luc, thanks for the review and explanation. It makes sense to me that the vector creation was the issue. They must of handled it differently in MC15 with the if/otherwise statement. When Prime 9 did the conversion it changed this throughout the program to the new if/else format.

 

GregH_0-1712020727870.png

 

13-Aquamarine
April 2, 2024

If I recall correctly, Mathcad 15 first checks the condition and then calculates the appropriate fork. The other fork is not handled at all and thus the error didn't happen. Prime checks both forks and sees the error.