Explicit MPC of MIMO system using "solvemp"

86 views
Skip to first unread message

정준영

unread,
Sep 15, 2024, 7:35:52 AM9/15/24
to YALMIP
Dear Prof. Löfberg,
I'm trying to make an Explicit MPC controller using YALMIP.
There are 8 states and 2 inputs. and,
There are 2 logical constraints so, I used the "implies" function for modeling this..
But, sometimes the solver is stopped, or when I using the "isinside" function, there is no solution in states' range.
I think, there is a mistake using logical constraints with 'implies".
Could you give me an advice??
I posted the code,

N = 2;
U = sdpvar(2,N,'full');
W = sdpvar(2,N,'full');
x = sdpvar(8,N+1,'full');
d = binvar(4,N,'full');
C = [1 0 0 0 0 0 0 0;
0 1 0 0 0 0 0 0;
0 0 0 0 1 0 0 0;
0 0 0 0 0 1 0 0;];
objective = 0;
constraints = [];
for k = 1:N
constraints = [constraints, implies(d(1,k), [(x(7,k)-x(5,k)+a1*x(6,k)) >= 0, ...
1000*(x(7,k)-x(5,k)+a1*x(6,k)) <= U(1,k) <= 10000*(x(7,k)-x(5,k)+a1*x(6,k))])];
constraints = [constraints, implies(d(2,k), [(x(7,k)-x(5,k)+a1*x(6,k)) <= 0, ...
10000*(x(7,k)-x(5,k)+a1*x(6,k)) <= U(1,k) <= 1000*(x(7,k)-x(5,k)+a1*x(6,k))])];
constraints = [constraints, d(1,k) + d(2,k) == 1];

constraints = [constraints, implies(d(3,k), [(x(8,k)-x(5,k)-a2*x(6,k)) >= 0, ...
1000*(x(8,k)-x(5,k)-a2*x(6,k)) <= U(2,k) <= 10000*(x(8,k)-x(5,k)-a2*x(6,k))])];
constraints = [constraints, implies(d(4,k), [(x(8,k)-x(5,k)-a2*x(6,k)) <= 0, ...
10000*(x(8,k)-x(5,k)-a2*x(6,k)) <= U(2,k) <= 1000*(x(8,k)-x(5,k)-a2*x(6,k))])];
constraints = [constraints, d(3,k) + d(4,k) == 1];

constraints = [constraints, x(:,k+1) == Ad*x(:,k) + Bd*U(:,k)];

constraints = [constraints, -25000 <= U(:,k) <= 25000];
constraints = [constraints, -5 <= x(:,k) <= 5];
constraints = [constraints, -5 <= x(:,k+1) <=5];
objective = objective + (C*x(:,k+1))'*diag([1e10 1e11 1e7 1e7])*(C*x(:,k+1));
end
sol = solvemp(constraints, objective, sdpsettings('verbose',1,'showprogress',1),x(:,1),U(:,1));

Johan Löfberg

unread,
Sep 15, 2024, 9:11:08 AM9/15/24
to YALMIP
I woukd have absolutely no hope of the mpMILP solver to work on a problem in R^8

정준영

unread,
Sep 15, 2024, 9:17:30 AM9/15/24
to YALMIP
Thank you for your response!
So, could you tell me why..? and would you recommend another solver for this problem, please?

2024년 9월 15일 일요일 오후 10시 11분 8초 UTC+9에 Johan Löfberg님이 작성:

Johan Löfberg

unread,
Sep 15, 2024, 9:54:42 AM9/15/24
to YALMIP
multiparametric LPs are extremely hard, and can perhaps be solved somewhat consistently in R^2 and R^3, and grows exponentially harder with growing dimension. mixed-ionteger multiparametric programming is much harder, so...

I am not aware of any other solver capable of mpMILPs

정준영

unread,
Sep 15, 2024, 9:56:30 AM9/15/24
to YALMIP
Thank you very much prof.
Your answer was very helpful for me.

2024년 9월 15일 일요일 오후 10시 54분 42초 UTC+9에 Johan Löfberg님이 작성:
Reply all
Reply to author
Forward
0 new messages