#include
int main() {
/* given G1=1/(s+1), G2=1/s, G3=2 */
double num1[1] = {1}, den1[2] = {1, 1};
class CControl sysG1;
sysG1.model("tf", num1, den1);
double num2[1] = {1}, den2[2] = {1, 0};
class CControl sysG2;
sysG2.model("tf", num2, den2);
double num3[1] = {2}, den3[1] = {1};
class CControl sysG3;
sysG3.model("tf", num3, den3);
/* series connection for G1 and G2 */
class CControl *sysG1G2;
sysG1G2 = sysG1.series(&sysG2);
/* unit feedback */
double numf[1] = {1}, denf[1] = {1};
class CControl sysF;
sysF.model("tf", numf, denf);
class CControl *sysG1G2F;
/* or sysG1G2F = sysG1G2->feedback(&sysF, -1);*/
sysG1G2F = sysG1G2->feedback(&sysF);
/* parallel connection */
class CControl *sysT;
sysT = sysG1G2F->parallel(&sysG3);
sysT->printtf();
return 0;
}