122 for (
int t = 0; t < T; t++) {
123 demand[t] = 1.0 + 2.3 * Math.pow(1.015, t);
128 for (
int t = 0; t < T; t++) {
165 double[] objcoeff =
new double[T];
166 int[] objnlflag =
new int[T];
168 for (
int t = 0; t < T; ++t) {
169 objcoeff[t] = Math.pow(1.05, 1 - (t + 1));
176 for (
int t = 0; t < T; t++) {
181 int[] index = {vartd[t], varp[t]};
182 double[] value = {1.0, 0.13};
183 int[] nlflag = {0, 0};
189 int[] index = {vartd[t], vartd[t - 1], varp[t]};
190 double[] value = {1.0, -0.87, 0.13};
191 int[] nlflag = {0, 0, 0};
200 int[] index = {vars[t], varp[t], varcs[t]};
201 double[] value = {1.0, 0.0, 0.0};
202 int[] nlflag = {0, 1, 1};
208 int[] index = {vars[t], vars[t - 1], varp[t], varcs[t]};
209 double[] value = {1.0, -0.75, 0.0, 0.0};
210 int[] nlflag = {0, 0, 1, 1};
214 consmapping.putIfAbsent(considx,
new IntPair(CONS_SEQ, t));
219 int[] index = {varcs[t], vars[t]};
220 double[] value = {1.0, -1.0};
221 int[] nlflag = {0, 0};
227 int[] index = {varcs[t], varcs[t - 1], vars[t]};
228 double[] value = {1.0, -1.0, -1.0};
229 int[] nlflag = {0, 0, 0};
236 int[] index = {vard[t], vartd[t], vars[t]};
237 double[] value = {1.0, -1.0, 1.0};
238 int[] nlflag = {0, 0, 0};
245 int[] index = {varr[t], vard[t]};
246 double[] value = {1.0, 1.0};
247 int[] nlflag = {0, 0};
253 int[] index = {varr[t], varr[t - 1], vard[t]};
254 double[] value = {1.0, -1.0, 1.0};
255 int[] nlflag = {0, 0, 0};
262 int[] index = {varrev[t], vard[t], varp[t], varr[t]};
263 double[] value = {1.0, 0.0, 0.0, 0.0};
264 int[] nlflag = {0, 1, 1, 1};
267 consmapping.putIfAbsent(considx,
new IntPair(CONS_DREV, t));
310 assert x.length == jac.length;
312 IntPair conspair = consmapping.get(rowno);
313 if (conspair ==
null)
return;
315 int consset = conspair.
first();
316 int t = conspair.
second();
318 assert (consset == CONS_SEQ || consset == CONS_DREV);
320 if (consset == CONS_SEQ) {
324 h1 = (1.1 + 0.1 * x[varp[t]]);
325 h2 = Math.pow(1.02, -x[varcs[t]] / 7.0);
327 jac[varcs[t]] = h1 * h2 * Math.log(1.02) / 7.0;
328 jac[varp[t]] = -h2 * 0.1;
330 else if (consset == CONS_DREV) {
331 jac[vard[t]] = -(x[varp[t]] - 250. / x[varr[t]]);
332 jac[varr[t]] = -x[vard[t]] * 250. / Math.pow(x[varr[t]], 2);
333 jac[varp[t]] = -x[vard[t]];