I have to run a numerical study. As part of it I have to solve:
A = 1*10^6 ; b = 1/4; delta = 0;
K[x_] = 0.9772498680518208` +
x (1.186104449210508`*^-10 +
x (-1.4649246311182838`*^-19 +
x (3.0214683712038235`*^-28 +
x (-2.6422357409090615`*^-37 +
x (-5.8010340178270696`*^-46 +
x (-2.6339819094686574`*^-55 +
x (-3.7463204038553128`*^-65 + \
(6.191585769652652`*^-77 + 6.879539744126434`*^-87 x) x))))))) //
FullSimplify;
F[x_] = Piecewise[{{0, -10^10 < x < -2.2*10^9}, {K[x], .2*10^9 >=
x >= -2.5*10^9}, {1, .2*10^9 < x}}];
H1[a_, i_, j_] :=
NMaximize[{(A - a p) (p - w) + (1 -
F[-(A - a p) (w - i)]) (A - a j)^2/(4 a) +
F[-(A - a p) (w - i)] ( (A - a i)^2/(8 a) - b (A - a p) (p - w)),
i <= w <= A/a, 0 < p <= A/a}, {w, p}]
H2[a_, i_, j_] :=
Maximize[{(A - a p) (p - w) + (1 -
F[-(A - a p) (w - i)]) (A - a j)^2/(4 a) +
F[-(A - a p) (w - i)] ( (A - a i)^2/(8 a) - b (A - a p) (p - w)),
i <= w <= A/a, 0 < p <= A/a}, {w, p}]
H3[a_, i_, j_] :=
FindMaximum[{(A - a p) (p - w) + (1 -
F[-(A - a p) (w - i)]) (A - a j)^2/(4 a) +
F[-(A - a p) (w - i)] ( (A - a i)^2/(8 a) - b (A - a p) (p - w)),
i <= w <= A/a, 0 < p <= A/a}, {w, p}]
H1[50, 5000, 6500]
H2[50, 5000, 6500]
H3[50, 5000, 6500]
H1[50, 5000, 5000]
H2[50, 5000, 5000]
H3[50, 5000, 5000]
Sry for the long functions, but perhaps this is important to identify the error.
When I run this code, the first two H1 and H2 find in the first case a smaller maximum than H3, in the second case a higher maximum. I would like to always get the "real", that is, the higher maximum.
Any suggestions?
Best regards Andreas