Here's my code , I did like you told me
Module[
{
\[Alpha] = 100,
\[Beta] = 10,
c = 10,
b = 0.05,
e = 100,
k = 500,
a = 10000,
t = 0.01 *Range[5],
m,
f
},
(*m=(a+ \[Alpha] p[[n-1]]- \[Alpha] c - (Length[t]-n) \
a)/(\[Alpha](b+(Length[t]-n+1)t[n]- Sum[t[[i]],{i,n+1, Length[t]}]));*)
f[x0_, pList_] := (pList[[1]] -
c - (b + t[[1]]) x0) (a - \[Alpha] pList[[1]]) +
Sum[ (pList[[i]] -
c - (b + t[[i]]) x0) (a - \[Beta] pList[[
i]] + \[Beta] pList[[i - 1]] - \[Alpha] pList[[1]]), {i, 2,
Length[t]}] - k (e - x0)^2;
Maximize[
{
f[\[FormalX], Array[\[FormalP], Length[t]]],
And @@ Thread[Array[\[FormalP], Length[t]] > 0] &&
And @@ Table[
a - \[Beta] (p[i] + p[i - 1]) - \[Alpha] p[1] > 0, {i, 2,
Length[t]}]
},
Flatten[{\[FormalX], Array[\[FormalP], Length[t]]}]
]
]
and i have this output :
Maximize[{-500 (100 - \[FormalX])^2 + (10000 -
100 \[FormalP][1]) (-10 -
0.06 \[FormalX] + \[FormalP][1]) + (10000 - 90 \[FormalP][1] -
10 \[FormalP][2]) (-10 -
0.07 \[FormalX] + \[FormalP][2]) + (10000 - 100 \[FormalP][1] +
10 \[FormalP][2] - 10 \[FormalP][3]) (-10 -
0.08 \[FormalX] + \[FormalP][3]) + (10000 - 100 \[FormalP][1] +
10 \[FormalP][3] - 10 \[FormalP][4]) (-10 -
0.09 \[FormalX] + \[FormalP][4]) + (10000 - 100 \[FormalP][1] +
10 \[FormalP][4] - 10 \[FormalP][5]) (-10 -
0.1 \[FormalX] + \[FormalP][5]), \[FormalP][1] >
0 && \[FormalP][2] > 0 && \[FormalP][3] > 0 && \[FormalP][4] >
0 && \[FormalP][5] > 0 &&
10000 - 100 p[1] - 10 (p[1] + p[2]) > 0 &&
10000 - 100 p[1] - 10 (p[2] + p[3]) > 0 &&
10000 - 100 p[1] - 10 (p[3] + p[4]) > 0 &&
10000 - 100 p[1] - 10 (p[4] + p[5]) > 0}, {\[FormalX], \[FormalP][
1], \[FormalP][2], \[FormalP][3], \[FormalP][4], \[FormalP][5]}]