36 const double *xcp = NULL;
42 res[0] = -xc[0] + stp.
B[0] * control[0];
43 res[1] = -xc[1] + stp.
B[1] * control[0];
44 res[2] = -xc[2] + stp.
B[2] * control[0];
45 res[3] = -xc[3] + stp.
B[0] * control[1];
46 res[4] = -xc[4] + stp.
B[1] * control[1];
47 res[5] = -xc[5] + stp.
B[2] * control[1];
50 for (
int i = 1; i < ppar.
N; i++)
61 res[0] = -xc[0] + stp.
B[0] * control[0] + xcp[0] + stp.
A3 * xcp[1] + stp.
A6 * xcp[2];
62 res[1] = -xc[1] + stp.
B[1] * control[0] + xcp[1] + stp.
A3 * xcp[2];
63 res[2] = -xc[2] + stp.
B[2] * control[0] + xcp[2];
64 res[3] = -xc[3] + stp.
B[0] * control[1] + xcp[3] + stp.
A3 * xcp[4] + stp.
A6 * xcp[5];
65 res[4] = -xc[4] + stp.
B[1] * control[1] + xcp[4] + stp.
A3 * xcp[5];
66 res[5] = -xc[5] + stp.
B[2] * control[1] + xcp[5];
80 double i2Q[3] = {ppar.
i2Q[0], ppar.
i2Q[1], ppar.
i2Q[2]};
90 for (i = 0; i < ppar.
N-1; i++)
92 double A3 = ppar.
spar[i+1].
A3;
93 double A6 = ppar.
spar[i+1].
A6;
97 res[0] = -i2Q[0] * (-xc[0] + xcn[0]);
98 res[1] = -i2Q[1] * (-xc[1] + A3 * xcn[0] + xcn[1]);
99 res[2] = -i2Q[2] * (-xc[2] + A6 * xcn[0] + A3 * xcn[1] + xcn[2]);
100 res[3] = -i2Q[0] * (-xc[3] + xcn[3]);
101 res[4] = -i2Q[1] * (-xc[4] + A3 * xcn[3] + xcn[4]);
102 res[5] = -i2Q[2] * (-xc[5] + A6 * xcn[3] + A3 * xcn[4] + xcn[5]);
107 control_res[0] = -ppar.
i2P * (stp.B[0] * xc[0] + stp.B[1] * xc[1] + stp.B[2] * xc[2]);
108 control_res[1] = -ppar.
i2P * (stp.B[0] * xc[3] + stp.B[1] * xc[4] + stp.B[2] * xc[5]);
119 res[0] = -(-i2Q[0] * xc[0]);
120 res[1] = -(-i2Q[1] * xc[1]);
121 res[2] = -(-i2Q[2] * xc[2]);
122 res[3] = -(-i2Q[0] * xc[3]);
123 res[4] = -(-i2Q[1] * xc[4]);
124 res[5] = -(-i2Q[2] * xc[5]);
129 control_res[0] = -ppar.
i2P * (stp.
B[0] * xc[0] + stp.
B[1] * xc[1] + stp.
B[2] * xc[2]);
130 control_res[1] = -ppar.
i2P * (stp.
B[0] * xc[3] + stp.
B[1] * xc[4] + stp.
B[2] * xc[5]);
#define SMPC_NUM_STATE_VAR
Number of state variables.
void form_i2HETx(const problem_parameters &, const double *, double *)
Forms i2H * E' * x.
void form_Ex(const problem_parameters &, const double *, double *)
Forms E*x.
A set of problem parameters.
#define SMPC_NUM_CONTROL_VAR
Number of control variables.