From 1f12e47e6d1fe8b365806aa0b42de237970d53bf Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Wed, 24 May 2023 16:50:06 +0200 Subject: Take deliverables for Robust MPC from yanzhen According to table 12 - generate_disturbances - simulate_uncertain - compute_tube_contorller - compute_minRPI - compute_tightening - MPC_TUBE - MPC_TUBE/eval (contained in MPC_TUBE.m) - MPC_TUBE_script (and its output MPC_TUBE_params.mat) --- templates/compute_minRPI.m | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'templates/compute_minRPI.m') diff --git a/templates/compute_minRPI.m b/templates/compute_minRPI.m index 0b4ffdb..19df517 100644 --- a/templates/compute_minRPI.m +++ b/templates/compute_minRPI.m @@ -8,4 +8,32 @@ function [H_tube,h_tube,n_iter] = compute_minRPI(K_tube,params) % YOUR CODE HERE + A = params.model.A+params.model.B*K_tube; + % A = params.model.A; +% display(A) + nx = params.model.nx; + omega = Polyhedron('A',[eye(nx);-eye(nx)],'b',zeros(1,2*nx)'); + % display(omega.A) + % display(omega.b) + 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) + % A_last = omega.A; + % b_last = omega.b; + display(n_iter); + display(omega.b) + omega = omega.plus(A^(n_iter)*W); + + if eq(omega.minHRep(),omega_last.minHRep()) + % if eq(omega,omega_last) + break + end + n_iter = n_iter+1; + end + H_tube = omega.A; + h_tube = omega.b; end \ No newline at end of file -- cgit v1.2.1