0
$\begingroup$

This is a follow up to this question: How do I tell FindMinimum to only work with positive, real numbers? Using a constraint for positive, real numbers, I have the following statement:

FindMinimum[{chiSquared[ber, btm, dsr, dcd], ber > 0 && btm > 0 && dsr > 0 && dcd > 0}, {{ber, 1.}, {btm, 10^10}, {dsr, 1.}, {dcd, 1000.}}]

Without going into the functions that are being called, I get this output:

FindMinimum::nrnum: The function value -3.67837*10^23-6.26338*10^14 I is not a real number at {ber,btm,dsr,dcd} = {-0.000112335,8.94475*10^7,1.2307,799.69}.

Why is ber going negative in the FindMinimum algorithm when I specifically told it that negative numbers won't work? I tried adding a constraint of Element[{ber, btm, dsr, dcd}, PositiveReals] and got the same message.

$\endgroup$
  • $\begingroup$ It is probably caused by the algorithm FindMinimum used to solve the problem. You can read more details about what FindMinimum actually does here and here $\endgroup$ – Marius Ladegård Meyer Apr 24 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.