Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Aug 26, 2018
05:39 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Aug 26, 2018
05:39 PM

"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.

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Aug 26, 2018
09:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Aug 26, 2018
09:01 PM

"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.

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

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.

2 REPLIES 2

Aug 26, 2018
09:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Aug 26, 2018
09:01 PM

"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.

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

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.

Aug 26, 2018
09:22 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Aug 26, 2018
09:22 PM

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!