map_plant= taksug('plant',3,1);
map_plant= add_rules(map_plant,1);
map_plant= set(map_plant,'centers', [0;0;0]);
map_plant= set(map_plant,'ivariances', eye(3,3));
map_plant= set(map_plant,'linears', [0.7 -0.1 0.4 0]);
map_plant= set(map_plant,'optimparams', []);

plant= external('plant',1,1);
plant= add_dynamics(plant,2,1,2);
plant= add_mapping(plant, map_plant);
plant= set(plant,'links',[1 1]);
clear map_plant

map_ctrl= taksug('ctrl',4,1);
map_ctrl= add_rules(map_ctrl,1);
map_ctrl= set(map_ctrl,'centers', [ 0;0;0;0 ]);
map_ctrl= set(map_ctrl,'ivariances', eye(4,4));
map_ctrl= set(map_ctrl,'optimparams', [21:25]);

ctrl= external('ctrl',2,1);
ctrl= add_dynamics(ctrl, 1, [1 2], [0 0]);
ctrl= add_mapping(ctrl, map_ctrl);
ctrl= set(ctrl,'links',[1 1]);
clear map_ctrl;

params2.sampTime=1;
params2.horizon=4;
params2.Q=ones(1,1,18);
params2.R=ones(1,1,18);
params2.etha=0.1;
params2.set_points=[1];
params2.x0=zeros(3,3);
params2.toDo=uint8(8);
params2.controller=ctrl;
params2.plant_model=plant;
clear ctrl;
clear plant;

params2
toy2
