Message Boards Message Boards

0
|
3821 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Evaluate constraints with NMaximize?

I have the following problem with the optimization function(s): It seems that my function CDF[...] is not evaluated or the optimization function considers the starting point as infeasible or smth else ...

a = 1; b = 1; m = 2; A = 3; B = 1; a1 = {1 , 1, 1}; b1 = {1, 3, 4};

CDF[LogNormalDistribution[5, 2], D2[a, b, m, A, B, a1, b1]] - 
  CDF[LogNormalDistribution[5, 2], D1[a, b, m, A, B, a1, b1]] >= 0.01

Out[129]= True

In[130]:= FindMaximum[{z, {CDF[LogNormalDistribution[5, 2], 
       D2[x, y, z, A, B, a1, b1]] - 
      CDF[LogNormalDistribution[5, 2], D1[x, y, z, A, B, a1, b1]] >= 
     0.01 && x >= 0 && y >= 0 && z >= 0}}, {{x, a}, {y, b}, {z, m}}]

During evaluation of In[130]:= FindMaximum::eqineq: Constraints in {False} are not all equality or inequality constraints. With the exception of integer domain constraints for linear programming, domain constraints or constraints with Unequal (!=) are not supported.

Many thanks for any suggestion.

POSTED BY: Martin Branda
2 Replies

OK, these are the full definitions:

a = 1; b = 1; m = 2; A = 3; B = 1; a1 = {1 , 1, 1}; b1 = {1, 3, 4};
\[Lambda]1[a_, b_, m_, A_, B_] := 
  a + b/(B - 2*b )*(a - A - Sqrt[(a - A)^2 - 4 *m*(B - 2*b)]) /;  
   2*b > B;
\[Lambda]1[a_, b_, m_, A_, B_] := 
  a + B*m/(a - A) /;  2*b == B && a > A ;
\[Lambda]1[a_, b_, m_, A_, B_] := 
  a + b/(B - 2*b )*(a - A - Sqrt[(a - A)^2 - 4 *m*(B - 2*b)]) /;  
   2 b < B && a >= A + 2 Sqrt[m (B - 2*b)];
\[Lambda]1[a_, b_, m_, A_, B_] := Infinity;
\[Lambda]2[a_, b_, m_, A_, B_] := Infinity /;  2 b > B;
\[Lambda]2[a_, b_, m_, A_, B_] := Infinity /;  2*b == B && a > A ;
\[Lambda]2[a_, b_, m_, A_, B_] := 
  a + b/(B - 2*b )*(a - A + Sqrt[(a - A)^2 + -4 *m*(B - 2*b)]) /;  
   2 b < B && a >= A + 2 Sqrt[m (B - 2*b)];
\[Lambda]2[a_, b_, m_, A_, B_] := Infinity;
PosPart[x_] := x /;  x >= 0;
PosPart[x_] := 0;
D1[a_, b_, m_, A_, B_, a1_, b1_] := 
 Total[Map[PosPart, (\[Lambda]1[a, b, m, A, B] - a1)/(2*b1)]]
D2[a_, b_, m_, A_, B_, a1_, b1_] := 
 Total[Map[PosPart, (\[Lambda]2[a, b, m, A, B] - a1)/(2*b1)]]

And I apologize, of course "?" is missing in the title. Thank you.

POSTED BY: Martin Branda

It is impossible to diagnose without a full example, which requires definitions for D1 and D2.

Also the subject header does not quite match the details in the post (it's pretty clear at least to me how such a mistake can arise-- I do similar often enough as code details change).

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract