Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a model optimization problem: maximize rent, ri, through signals, si and sj, given someone's initial social position, SPi and SPj. Signals have a cost of 1, so the constraint is that D[ri, si] == 1 and D[ri, sj] == 1.

I get the error message

NArgMax::bcons: The following constraints are not valid:

....the whole equation for the constraint here...

Constraints should be equalities, inequalities, or domain specifications involving the variables. >>

I guess my questions are:

  • Is the problem simply due to my parameters no allowing a solution within the constraint?

  • Can I use the defined variables in the NArgMax inside signalFunc? (should they be defined as functions?)

Is NArgMax the right solution here?

α = 1000;
β = 0.03;
γ = 0.02;
m = 4000;
ω = 1;

ti = (α SPj (β sj - γ ((sj - si)/(sj + sj))^2 + 1)) + 
     (α SPi (β si - γ ((si - sj)/(si + sj))^2 + 1));
ri = ω (-(tr^2) + 2 m tr) /. tr -> ti

dsi = FullSimplify[D[ri, si], 
   Assumptions -> {Element[{si, sj}, Reals]}];
dsj = FullSimplify[D[ri, sj], 
   Assumptions -> {Element[{si, sj}, Reals]}];

signalFunc[{SPi_, SPj_}] :=
  NArgMax[{ri, dsi == 1, dsj == 1}, {si, sj}];

signalFunc[{0.8, 1.5}];
share|improve this question
It's some form of evaluation semantics mishmosh. Can do it either as signalFunc[{SPi1_, SPj1_}] := NArgMax[{ri, dsi == 1, dsj == 1} /. {SPi -> SPi1, SPj -> SPj1}, {si, sj}] or signalFunc[{SPi1_, SPj1_}] := Block[{SPi = SPi1, SPj = SPj1}, NArgMax[{ri, dsi == 1, dsj == 1}, {si, sj}]]. Note that this will be difficult; I get a warning that the constraints are not satisfied. – Daniel Lichtblau Dec 20 '12 at 0:26
Do you think the equations need to be written in full inside the NArgMax? I still get an error there – Cameron Murray Dec 20 '12 at 1:09
If either SPi or SPj do not have values, then NArgMax is being asked to optimize a symbolic expression, which it cannot do. – whuber Dec 20 '12 at 2:44
The function takes SPi and SPj as arguments - is that not sufficient? I think that is Daniel's point. If I put the full equations inside NArgMax' I get the error >NArgMax::nosat: Obtained solution does not satisfy the following constraints within Tolerance -> 0.001: – Cameron Murray Dec 20 '12 at 3:32
D is a predefined MMA function to compute the derivative, so that expressions like D[ri, si] == 1 are (at best) meaningless. – whuber Mar 16 at 3:40

closed as too localized by whuber, Verbeia Mar 16 at 10:31

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.