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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

"This variable is undefined" result from solve block

ptc-2826169
1-Newbie

"This variable is undefined" result from solve block

Hi all,

I'm having a problem with the Minerr(x, var1,var2...) function within a Mathcad sheet. It performs well provided the function I'm try to minimize to is relatively simple.

for example; see file 1. In this sheet my constaint is met easily and a good fit is acquired.

However, when the complexity of the function is increased, no value will ever be returned and the solve block seems to break down.

Any way to combat this? Is there something I'm overlooking?

Any help will be appreciated,

Thanks.

6 REPLIES 6

minerr.png

minerr-2.png

Hi Neil,

2 problems that cause you equations to fail.

1. in the definition of H1 you have parameters a1, b1 c1 but use the values a, b & c which are constants carried over from the file 1 calculation.

More interesting is :

2.

Capture.PNG

Although the equations look identical there is a problem with the | ... |, delete & retype this & it all works.

(Another oddity for Valery to add to his ever increasing list)

Regards

Andy

Thanks Andy, it's nice to see a bit of progress can be made with this!

Also, the fit seems very good for this example, however, for my problem it still seems to be having a problem.

I'll try and upload the sheet that I'm having trouble with but it has some sensitive data so I'll have to lock a region so that just the relevant functions are visible.

Is there any reason you can think of why a Rayleigh distribution function may be causing Minerr a problem in particular?

Neil

RichardJ
19-Tanzanite
(To:ptc-2826169)

Is there any reason you can think of why a Rayleigh distribution function may be causing Minerr a problem in particular?

No. Minerr does not like discontinuous functions or functions with flat areas, but other than that it doesn't care.

One thing to bear in mind is that there is only ever one error message from a solve block: "this variable is undefined". You get this error regardless of what the actual problem is.

Although the equations look identical there is a problem with the | ... |, delete & retype this & it all works.

(Another oddity for Valery to add to his ever increasing list)

Right click on the operator and set it to "absolute value" (it somehow got set to "square matrix determinant").

Top Tags