diff options
author | Yuan Xu <yuanxu@student.ethz.ch> | 2023-05-24 17:35:46 +0200 |
---|---|---|
committer | Yuan Xu <yuanxu@student.ethz.ch> | 2023-05-24 17:35:46 +0200 |
commit | a23ba49056a36aff221d0c23e228b981222c3576 (patch) | |
tree | 742c18cbe13c1603909b55ee82188ce6360e8fa0 /Submission files/compute_tightening.m | |
parent | ADD: declaration of originality (diff) | |
download | mpc_pe-a23ba49056a36aff221d0c23e228b981222c3576.tar.gz mpc_pe-a23ba49056a36aff221d0c23e228b981222c3576.zip |
add submission zipsubmission
Diffstat (limited to '')
-rw-r--r-- | Submission files/compute_tightening.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Submission files/compute_tightening.m b/Submission files/compute_tightening.m new file mode 100644 index 0000000..7095f9c --- /dev/null +++ b/Submission files/compute_tightening.m @@ -0,0 +1,29 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Copyright (c) 2023, Amon Lahr, Simon Muntwiler, Antoine Leeman & Fabian Flürenbrock Institute for Dynamic Systems and Control, ETH Zurich. +% +% All rights reserved. +% +% Please see the LICENSE file that has been included as part of this package. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +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(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 |