α=1.5; a=200; b = 50; θ = 0.08; β = 0.2; c1 = 600; c2 = 0.9; c3 = 2.0;
H = 4; m := 8; s[0] := 0; s[m] := H;
f11 := c1/H;
A1 = (α - 1)*((((a/θ) - (b/θ^2))*r) + ((b*(r)^2)/(2*θ)) + (((a/(\θ^2)) - (b/(θ^3)))*((E^(-θ*r)) - 1)));
B1 = (((b/(θ^3)) - ((a + b*(H - r))/(θ^2)))*(1 - (E^(θ*(H - r))))) + (((b/(θ^2)) - a)*(H - r)) - ((b*((H - r)^2))/2);
Z1 = Sum[(((((a + (b*s[i]))/θ) - (b/(θ^2)))*((E^(θ*(s[i] - t[i]))) - (1/θ))) - (((a/θ) - (b/(θ^2)))*(s[i] - t[i])) + ((b*((s[i])^2 - (t[i])^2))/(2*θ))), {i, 1, m}];
f21[m_] := (c2*(A1 + B1 - Z1))/H;
G1 = Sum[(((2*b*((E^(-β*(t[i] - s[i - 1]))) - 1))/(β^3)) + ((a + b*t[i])/(β^2)) + ((b*(E^(-β*(t[i] - s[i - 1])))*(t[i] - s[i - 1]))/(β^2)) - ((a + b*s[i - 1])*(E^(-β*(t[i] - s[i - 1])))*((1/(β^2)) + ((t[i] - s[i - 1])/β)))), {i, 1, m}];
L1 = α*((a*r) + ((b*(r)^2)/2));
P1 = Sum[(((E^(-θ* t[i]))*((((a + b*s[i])*(E^(θ*s[i]))) - ((a + b*t[i])*(E^(θ*t[i]))))/θ) - ((b*((E^(θ*s[i])) - (E^(θ*t[i]))))/(θ^2)))), {i, 1, m}];
P2 = Sum[((a + b*t[i] - ((a + b*s[i - 1])*(E^(-β*(t[i] - s[i - 1])))))/β) - ((b*(1 - (E^(-β*(t[i] - s[i - 1])))))/(β^2)), {i, 1, m}];
f31[m_] := (c3*(L1 - P1 - P2))/H;
w1[m_] := f11 + f21 + f31;
NMinimize[
{w1[m], s[i] - t[i] > 0, t[i + 1] - s[i] > 0,
{i, 1, m - 1} && t[1] > 0 && t[m] < H && r > 0 && r < H},
Join[
Flatten @ {Table[t[i], {i, 1, m}]},
Flatten {Table[s[i], {i, 1, m - 1}]},
{r}]]
I have to find s[i]
where i = 1, 2, 3, ..., m-1
and t[i]
where i = 1, 2, 3, ..., m
and r
such that w1[m]
to be minimized.
But it results in the following error
NMinimize::bcons: The following constraints are not valid: {s[i]-t[i]>0,-s[i]+t[1+i]>0,i,1,7,t[1]>0,t[8]<4,r>0,r<4}. Constraints should be equalities, inequalities, or domain specifications involving the variables.
Why shouldn't it give me the output?
Table
so the symbolic items will not be recognized as variables, $\endgroup$