#include int main() { CControl plant, comp, fb_sys, *ol_sys, *cl_sys; CPlot rlocus_plot, step_plot; double plant_k, comp_k, tr, ts, os; array double fb_num[] = {1}, fb_den[] = {1}; array double complex dominant_p[1], comp_p[1], comp_z[1]; int i, noz, nop; printf("\nValues inside brackets are default values.\n" "Press Enter to adopt default values or type in different values.\n"); printf("\nDefine the plant:\n"); printf(" number of zeros [0]: "); noz = getnum(NULL, 0); array double complex plant_z[noz]; double real_plant_z, imag_plant_z; if(noz > 0) { for(i=0; i 0 && nop != 2) { for(i=0; ifeedback(&fb_sys); cl_sys->stepinfo(&tr, &ts, &os, NULL, NULL, NULL, NULL, NULL); printf("\n\nCompensator:\n" " Pole: %f" " Zero: %f" " Gain: %f\n\n", real(comp_p), real(comp_z), comp_k); printf("Rise time: %f\n", tr); printf("Settling time: %f\n", ts); printf("Percent overshoot: %f\n\n", os); ol_sys->rlocus(&rlocus_plot, NULL, NULL); cl_sys->grid(1); cl_sys->step(&step_plot, NULL, NULL, NULL, ts*2); return 0; }