28 void tilde_to_bar (
const double sinA,
const double cosA,
double *state)
30 double tmp = cosA*state[0] + sinA*state[3];
31 state[3] = -sinA*state[0] + cosA*state[3];
42 void bar_to_tilde (
const double sinA,
const double cosA,
double *state)
44 double tmp = cosA*state[0] - sinA*state[3];
45 state[3] = sinA*state[0] + cosA*state[3];
58 state[0] = state[0] + h * state[2];
59 state[3] = state[3] + h * state[5];
70 state[0] = state[0] - h * state[2];
71 state[3] = state[3] - h * state[5];
83 void get_controls (
const int preview_window_size,
const double *X,
const int ind,
double *controls)
86 if (ind >= preview_window_size)
88 index = preview_window_size-1;
#define SMPC_NUM_STATE_VAR
Number of state variables.
void bar_to_tilde(const double sinA, const double cosA, double *state)
Converts state from X_tilde to X_bar.
void tilde_to_bar(const double sinA, const double cosA, double *state)
Converts state from X_tilde to X_bar.
Various operations on the vector of states.
#define SMPC_NUM_CONTROL_VAR
Number of control variables.
void orig_to_tilde(const double h, double *state)
Converts state from original variables to X_tilde.
void get_controls(const int preview_window_size, const double *X, const int ind, double *controls)
Returns the controls,that must be applied to reach the next state.
void tilde_to_orig(const double h, double *state)
Converts state from X_tilde to original variables.