TransWikia.com

Nmaximize error : The function value Indeterminate is not a number at

Mathematica Asked by natacha raffin on June 7, 2021

I have been looking on the StackExchange for solutions to my issue… but I can’t find. So I am asking for a solution to the following problem:

First I define some functions, the function to be maximized, V, the parameters and then the NMaximize function for given values of a parameter h and the constraints.
I get some results but also the following message :
Nmaximize error : The function value Indeterminate is not a number at {0.554465,1.91298,3.00862,4.06643*10^-6,0.}
The function value Indeterminate is not a number at {1.63675,0.,1.02183,0.167442,0.231841}
The function value Indeterminate is not a number at {0.0972852,1.26903,2.63931,1.6129,0.}
Further output of NMaximize:: nnum will be supressed during this calculation.

Could you help me with this program ? Am I doing something wrong ?

G[P_] := 0.1 + γ/(1 + γ P);
B[P_] := 0.125 - β/(1 + β P);
q = (2 n (1 - h))/Q;
A[P_] := B[P] + q;
L[s_] := n (1 - θ (1 - s))*(1 - h);
F[x_, y_] := x^ϵ y^(1 - ϵ);
Cons1[k_, s_, c_, d_] := F[k, L[s]] - n (c + d) - k;
Cons2[k_, P_, s_] := P - η/δ F[k, L[s]];
Cons3[s_, P_] := n*s - n*G[P]/A[P]; 

V[c_?NumericQ, d_?NumericQ, s_?NumericQ, k_?NumericQ, P_?NumericQ] := 
 n u[c, s] + ζ n u[d, s];

n = 40000; γ = 0.005; β = 0.005; Q = 150000; ϵ 
= 0.3; η = 0.1; δ = 0.05; ζ = 0.9; σ = 0.2;
θ = 0.1;


lockdown = {h, 0, 0.9, 0.05};

 
OutMax1 = 
  Table[Maximize[{Abs[V[c, d, s, k, P]]}, {c, d, s, k, P} ∈ 
     ImplicitRegion[{c >= 0 && d >= 0 && k >= 0 && P >= 0 && s >= 0 &&
         1 > s && Cons1[k, s, c, d] == 0 && Cons2[k, P, s] == 0 && 
        Cons3[s, P] == 0 }, {c, d, s, k, P}]], Evaluate[lockdown]];


Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP