The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Constraint definition is not valid: WHY?
Replies: 1   Last Post: Jul 2, 2013 12:34 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2
Registered: 7/1/13
Constraint definition is not valid: WHY?
Posted: Jul 1, 2013 5:42 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I am tring to use Nmaximize in Mathematica This is How I proceeded:

1) define a list of parameters: Par = {a->1, b->3, etc};

2) define two functions: f1: v1=express./Par f2: v2=express./Par

After this the expression are numerical except for the variables:

V1=f(e1,x) and V2=f(e2,x)
The objective function to be maximized is V1/(e1+e2) I defined the constraint as constr=V1-V2;

then I used the Nmaximize:

NMaximize[{objopt > 0, constr == 0}, {e1, e2, x}, Method -> NelderMead]
I obtained the following error:

NMaximize::bcons: "The following constraints are not valid: "expression". Constraints should be equalities, inequalities, or domain specifications involving the variables"

I checked that only those variables are present in the constraint and objective function (other are numerical parameters) I do not understand why this error appears can someone help me?

Thank you


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.