#include <control.h> int main() { array double num2[4] = {4, 8.4, 30.8, 60}, den2[5] = {1, 4.12, 17.4, 30.8, 60}; class CControl sys2; sys2.model("tf", num2, den2); // create a tf model printf("\nThe system is created with TF model\n"); printf("System matrices obtained by printss() member function.\n"); sys2.printss(); printf("\n\n"); int nx2, ny2, nu2; nx2 = sys2.size('x'); // obtain the number of states of the system ny2 = sys2.size('y'); // obtain the number of outputs of the system nu2 = sys2.size('u'); // obtain the number of inputs of the system array double A2[nx2][nx2], B2[nx2][nu2], C2[ny2][nx2], D2[ny2][nu2]; sys2.ssdata(A2, B2, C2, D2); printf("System matrices obtained by ssdata() member function.\n"); printf("A = \n%f\nB = \n%f\nC = \n%f\nD = \n%f\n", A2, B2, C2, D2); printf("ZPK information obtained by printzpk() member function.\n"); sys2.printzpk(); printf("\n\n"); int nz2, np2; double k2; nz2 = sys2.size('z'); np2 = sys2.size('p'); array double complex z2[nz2], p2[np2]; sys2.zpkdata(z2, p2, &k2); printf("ZPK information obtained by zpkdata() member function.\n"); printf("z2 = %f\n p2 = %f\n k2 = %f\n", z2, p2, k2); return 0; }