Skip to main content
1-Visitor
August 17, 2012
Question

"This variable is undefined" result from solve block

  • August 17, 2012
  • 6 replies
  • 4629 views

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

24-Ruby IV
August 17, 2012

minerr.png

24-Ruby IV
August 17, 2012

minerr-2.png

12-Amethyst
August 17, 2012

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

1-Visitor
August 17, 2012

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

19-Tanzanite
August 18, 2012

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.