#include
#define NUMX 4 // number of states
#define NUMU 1 // number of inputs
#define NUMY 1 // number of outputs
int main() {
double A[NUMX][NUMX] = { 0, 1, 0, 0,
1, 0, 0, 0,
0, 0, 0, 1,
-0.5, 0, 0, 0};
double B[NUMX][NUMU] = { 0, 1, 0, -1};
array double K[NUMX];
double complex p[NUMX] = {-1.5, 0, complex(-1,1), complex(-1,-1)};
class CControl sys0;
sys0.model("ss", A, B, NULL, NULL);
sys0.acker(K, p);
printf("K obtained by acker function = %f\n", K);
sys0.place(K, p);
printf("K obtained by place function = %f\n", K);
return 0;
}