summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-11 15:19:21 +0200
committerYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-11 15:19:21 +0200
commitd1de80f7885f67b38f19e5bd6ebbc5765b7fc650 (patch)
treeba5f3ae0c83c865433715c183bad16ee48c83596 /templates
parentMerge remote-tracking branch 'origin/yanzhen' into yanzhen (diff)
downloadmpc_pe-d1de80f7885f67b38f19e5bd6ebbc5765b7fc650.tar.gz
mpc_pe-d1de80f7885f67b38f19e5bd6ebbc5765b7fc650.zip
ADD: 29 raw
Diffstat (limited to 'templates')
-rw-r--r--templates/compute_tightening.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/templates/compute_tightening.m b/templates/compute_tightening.m
index 8919d12..2bf06a4 100644
--- a/templates/compute_tightening.m
+++ b/templates/compute_tightening.m
@@ -8,4 +8,21 @@
function params = compute_tightening(K_tube,H_tube,h_tube,params)
% YOUR CODE HERE
+ Hx = params.constraints.StateMatrix;
+ hx = params.constraints.StateRHS;
+
+ Hu = params.constraints.InputMatrix;
+ hu = params.constraints.InputRHS;
+
+ Pxz = Polyhedron('A',Hx,'b',hx);
+ Puz = Polyhedron('A',Hu,'b',hu);
+ % Ptube = Polyhedron('A',H_tube,'b',h_tube);
+
+ Px_tube = Pxz.minus(Polyhedron('A',H_tube,'b',h_tube));
+ params.constraints.StateMatrix = Px_tube.A;
+ params.constraints.StateRHS = Px_tube.b;
+
+ Pu_tube = Puz.minus(Polyhedron('A',H_tube*K_tube,'b',h_tube));
+ params.constraints.InputMatrix = Pu_tube.A;
+ params.constraints.InputRHS = Pu_tube.b;
end \ No newline at end of file