43 res[0] = -(stp.
cos * xc[0] - stp.
sin * xc[3]) + stp.
B[0] * control[0];
44 res[1] = -xc[1] + stp.
B[1] * control[0];
45 res[2] = -xc[2] + stp.
B[2] * control[0];
46 res[3] = -(stp.
sin * xc[0] + stp.
cos * xc[3]) + stp.
B[0] * control[1];
47 res[4] = -xc[4] + stp.
B[1] * control[1];
48 res[5] = -xc[5] + stp.
B[2] * control[1];
51 for (
int i = 1; i < ppar.
N; i++)
55 const double cosA = ppar.
spar[i-1].
cos;
56 const double sinA = ppar.
spar[i-1].
sin;
63 res[0] = cosA * xc[0] + stp.
A3 * xc[1] + stp.
A6 * xc[2] - sinA * xc[3] - (stp.
cos * xc[6] - stp.
sin * xc[9]) + stp.
B[0] * control[0];
64 res[1] = xc[1] + stp.
A3 * xc[2] - xc[7] + stp.
B[1] * control[0];
65 res[2] = xc[2] - xc[8] + stp.
B[2] * control[0];
66 res[3] = cosA * xc[3] + stp.
A3 * xc[4] + stp.
A6 * xc[5] + sinA * xc[0] - (stp.
sin * xc[6] + stp.
cos * xc[9]) + stp.
B[0] * control[1];
67 res[4] = xc[4] + stp.
A3 * xc[5] - xc[10] + stp.
B[1] * control[1];
68 res[5] = xc[5] - xc[11] + stp.
B[2] * control[1];
93 for (i = 0; i < ppar.
N-1; i++)
96 const double A3 = ppar.
spar[i+1].
A3;
97 const double A6 = ppar.
spar[i+1].
A6;
105 res[0] = -(stp.
cos * xc[0] + stp.
sin * xc[3]) + stp.
cos * xc[6] + stp.
sin * xc[9];
106 res[1] = -xc[1] + A3 * xc[6] + xc[7];
107 res[2] = -xc[2] + A6 * xc[6] + A3 * xc[7] + xc[8];
108 res[3] = -(- stp.
sin * xc[0] + stp.
cos * xc[3]) - stp.
sin * xc[6] + stp.
cos * xc[9];
109 res[4] = -xc[4] + A3 * xc[9] + xc[10];
110 res[5] = -xc[5] + A6 * xc[9] + A3 * xc[10] + xc[11];
114 control_res[0] = stp.
B[0] * xc[0] + stp.
B[1] * xc[1] + stp.
B[2] * xc[2];
115 control_res[1] = stp.
B[0] * xc[3] + stp.
B[1] * xc[4] + stp.
B[2] * xc[5];
132 res[0] = -(stp.
cos * xc[0] + stp.
sin * xc[3]);
135 res[3] = -(- stp.
sin * xc[0] + stp.
cos * xc[3]);
140 control_res[0] = stp.
B[0] * xc[0] + stp.
B[1] * xc[1] + stp.
B[2] * xc[2];
141 control_res[1] = stp.
B[0] * xc[3] + stp.
B[1] * xc[4] + stp.
B[2] * xc[5];
#define SMPC_NUM_STATE_VAR
Number of state variables.
A set of problem parameters.
#define SMPC_NUM_CONTROL_VAR
Number of control variables.
void form_Ex(const problem_parameters &, const double *, double *)
Forms E*x.
void form_ETx(const problem_parameters &, const double *, double *)
Forms E' * x.