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

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

"This variable is undefined error when using Given/Find function", i cant find the issue

Mauro
3-Visitor

"This variable is undefined error when using Given/Find function", i cant find the issue

Hi to all, i have been using mathcad for a while, but every now and then i get this issue even tho i make the same process every time, so i have a hard time finding my mistake.

If somebody can help me out i will be greatly appreciated, thank you!

 

Mauricio B.

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:Mauro)

"Variable not defined" is an irritating error message of a solve block and can mean many different things.

You can find out more details when you right  click the erroneous expression and chose "Trace Error" and then "First".

I your case you will see a "Divide by zero" error. D1 is highlighted red, which is not correct, but your expressions on the right side sure will result in a division by zero because of the guess value 0 for f1-3 and V1-3.

If you change those guesses, lets say to 1, the solve block still fails. This time the error message is "no solution found".

The reason is, that all your solutions are non-real!! A numeric solve block will only yield non-real complex results if at least one of the guess values has an imaginary part different from zero. So if you set, lets say f1:=1j you will see a set of complex, non-real  solutions.

Interestingly you get a completely different set of (still non-real) solutions if you evaluate the Find command symbolically (the guess values are not used here).

You may want to check your values and your equations if you expected real solutions.

B1.png

-----------------

B2.png

 

EDIT: I just noticed that if one of the f1-3 is set to -1, the solve block still returns the non-real numbers even though no guess value is non-real.

View solution in original post

2 REPLIES 2
Werner_E
24-Ruby V
(To:Mauro)

"Variable not defined" is an irritating error message of a solve block and can mean many different things.

You can find out more details when you right  click the erroneous expression and chose "Trace Error" and then "First".

I your case you will see a "Divide by zero" error. D1 is highlighted red, which is not correct, but your expressions on the right side sure will result in a division by zero because of the guess value 0 for f1-3 and V1-3.

If you change those guesses, lets say to 1, the solve block still fails. This time the error message is "no solution found".

The reason is, that all your solutions are non-real!! A numeric solve block will only yield non-real complex results if at least one of the guess values has an imaginary part different from zero. So if you set, lets say f1:=1j you will see a set of complex, non-real  solutions.

Interestingly you get a completely different set of (still non-real) solutions if you evaluate the Find command symbolically (the guess values are not used here).

You may want to check your values and your equations if you expected real solutions.

B1.png

-----------------

B2.png

 

EDIT: I just noticed that if one of the f1-3 is set to -1, the solve block still returns the non-real numbers even though no guess value is non-real.

Mauro
3-Visitor
(To:Werner_E)

Thank you so much for your effort and time invested in helping me, i followed your same steps and got the same result, i will take a look to my values and see what went wrong. Again, thank you very much!

Top Tags