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', [1 1 -3 0]);
map_plant= set(map_plant,'optimparams', []);

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

map_ctrl= taksug('ctrl',2,1);
map_ctrl= add_rules(map_ctrl,9);
map_ctrl= set(map_ctrl,'centers', [ -1  -1  -1  0  0  0  1  1  1 ; ...
		                    -1   0   1 -1  0  1 -1  0  1 ] );
for i=1:9,
  map_ctrl= set(map_ctrl,'ivariance', {i eye(2,2)});
end
map_ctrl= set(map_ctrl,'optimparams', [55:81]);

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

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

params1
toy1




