/* example3.ch */ #include int main() { double k = 1; array double complex p[3] = {complex(-1, 0), complex(-2, 0), complex(-3, 0)}; // selected pole from the root locus array double complex spole[1] = {complex(-0.8, 1.84)}; // output closed-loop poles array double complex clpole[3]; // output gain array double gain[1]; CControl sys; sys.model("zpk", NULL, p, k); sys.rlocfind(gain, clpole, spole); printf("gain: %f\n", gain); printf("closed-loop poles: %f\n", clpole); return 0; }