solve set of inequalities
1 view (last 30 days)
Show older comments
I am working in state space where I have a triangle in R² with vertices v1 =(−1, 0)' , v2 = (1, 1)', and v3 = (1, −1)'
The normal vectors on the three facets F1, F2, and F3 of the triangle are
n1 = (1;0) , n2 =(1/sqrt(5))*[-1;-2]; n3=(1/sqrt(5))*[-1;2] respectively.
On the triangle T we consider the system : xdot=A.x+Bu+a.
with state x ∈ T and scalar input −1 ≤ u ≤ 1. I want to construct an affine feedback law u = Fx + g such that the state of the closed-loop system can only leave the Triangle T through the facet F1, the vertical line segment between the vertices v2 and v3.
So I should find an input u1 at vertex v1 , u2 at vertex v2 and u3 at v3 which are satisfying set of inequalities:
for u1 the following inequalities should hold:
(1) n2'.B.u1 ≤ −n'2. (A.v1 + a)
(2) n3'. B.u1 ≤ −n3'.(A.v1 + a)
(3) n2'.B.u1 + n3'. B.u1 < −n2'. (A.v1 + a) − n3'.(A.v1 + a)
and, additionally, −1 ≤ u1 ≤ 1.
for u2 the following inequalities should hold:
(1) n2'.Bu2 > −n1' (Av2 + a)
(2) n3'. B.u2 ≤ −n3'.(A.v1 + a) with −1 ≤ u2 ≤ 1
for u3 the following inequalities should hold:
(1) n1' Bu3 > −n1'(Av3 + a)
(2) n2'Bu3 ≤ −n2' (Av3 + a)
with −1 ≤ u3 ≤ 1
and after that I should solve the system ui = Fvi + g to find F and g.
I tried to solve these inequalities to find u2 (By hand i become an interval for u2 : [−1 6 , 1]), but when i run my code in i got :
Empty sym: 0-by-1
I have another qst please: I need the value of u2 for next step how can I get allowable value from this interval ? there is a function to use ?
close all;
clc;
v1=[-1;0]; v2=[1;1];v3=[1;-1];
line([v1(1) v3(1)],[v1(2) v3(2)],'Color','k');
hold on
line([v1(1) v2(1)],[v1(2) v2(2)],'Color','k');
line([v2(1) v3(1)],[v2(2) v3(2)],'Color','k');
axis([-2 2 -2 2]);
% define the normal vectors
n1=[1;0]; n2=(1/sqrt(5))*[-1;-2]; n3=(1/sqrt(5))*[-1;2];
A=[-1 -1;-2 1];
B=[2;-2];
a=[3;1];
syms u2
const1=n1'*B*(u2)>-n1'*(A*v2+a);
const2=n3'*B*(u2)<=-n3'*(A*v2+a);
const3=u2 <= 1;
const4=u2 >= -1;
conds=[const1 const2 const3 const4];
sol=vpasolve(conds,u2)
3 Comments
Torsten
on 10 Nov 2022
Edited: Torsten
on 10 Nov 2022
Don't know if it helps:
Using
sol=solve(conds,u2);
instead of
sol=vpasolve(conds,u2);
gives
sol = 0
as one possible solution.
If you can set up your problem without using the symbolic toolbox, you can use "linprog" to get a feasible point for your system of inequalities.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!