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

Very different error

JR_10083483
3-Newcomer

Very different error

I am getting very strange error in Mathcad Prime Has anyone seen it. If yes how to solve this and where I am doing wrong 

2 REPLIES 2
Werner_E
25-Diamond I
(To:JR_10083483)

Evaluation will go back to the definition. In case of the evaluation of Functions(X,Y) it will go back to

Werner_E_0-1637618695004.png

and I guess you can imagine what happens if you call the function with x=0 (one of the values in your vector X) and if beta is greater than alpha (which will be the case with the nested loops you defined) --> division by zero (or as Prime states "a magnitude greater 10^307").

Workaround is a redefinition with a symbolic evaluation:

Werner_E_1-1637618912377.png

 

But there is another fault, too: you have to vectorize the function call, as otherwise expression like x*y will be taken as the vector product of X and Y and give a scalar.

Werner_E_2-1637619127898.png

Werner_E_3-1637619178331.png

 

 

Werner_E
25-Diamond I
(To:Werner_E)

Here is an alternative definition for the vector of functions which does not need a redefinition with symbolic evaluation.

Vectorization is still needed of course.

Werner_E_4-1637619960019.png

With some slight modifications we can also use your way to defined that vector without running in the division by zero:

Werner_E_6-1637620430489.png

 

 

Announcements

Top Tags