Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Constraint definition is not valid: WHY?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131358] Constraint definition is not valid: WHY?
  • From: aless.bolli at gmail.com
  • Date: Mon, 1 Jul 2013 05:48:38 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net

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

Alex



  • Prev by Date: Re: Finding a function within an arbitrary expression
  • Next by Date: Re: Grids
  • Previous by thread: Re: Cashflow and TimeValue Question
  • Next by thread: Re: Constraint definition is not valid: WHY?