summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--templates/compute_minRPI.m3
-rw-r--r--templates/compute_tightening.m5
2 files changed, 5 insertions, 3 deletions
diff --git a/templates/compute_minRPI.m b/templates/compute_minRPI.m
index 37a6dbb..19df517 100644
--- a/templates/compute_minRPI.m
+++ b/templates/compute_minRPI.m
@@ -18,6 +18,7 @@ function [H_tube,h_tube,n_iter] = compute_minRPI(K_tube,params)
n_iter = 0;
Hw = params.constraints.DisturbanceMatrix;
hw = params.constraints.DisturbanceRHS;
+ W = Polyhedron('A',Hw,'b',hw);
while true
omega_last = copy(omega);
% display(n_iter)
@@ -25,7 +26,7 @@ function [H_tube,h_tube,n_iter] = compute_minRPI(K_tube,params)
% b_last = omega.b;
display(n_iter);
display(omega.b)
- omega = omega.plus(Polyhedron('A',Hw*inv(A^(n_iter+1)),'b',hw));
+ omega = omega.plus(A^(n_iter)*W);
if eq(omega.minHRep(),omega_last.minHRep())
% if eq(omega,omega_last)
diff --git a/templates/compute_tightening.m b/templates/compute_tightening.m
index 2bf06a4..7095f9c 100644
--- a/templates/compute_tightening.m
+++ b/templates/compute_tightening.m
@@ -21,8 +21,9 @@ function params = compute_tightening(K_tube,H_tube,h_tube,params)
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));
+
+ Pu_tube = Puz.minus(K_tube*Polyhedron('A',H_tube,'b',h_tube))
+% 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