mpc optimization problem using yalmip

227 views
Skip to first unread message

陈海亮

unread,
Mar 24, 2017, 2:48:34 AM3/24/17
to YALMIP
hello,
Dear Dr Johan and all members:
i use yalmip to formulate a mpc problem in simulink just following the example,almost the same with this  -https://yalmip.github.io/YALMIP-and-simulink/ ,but the solved optimal input seems always small(close to zero) ,i can't find something wrong,i'm confused.
  the model and code are attached. (four state,two output,two reference)
hailiang
Thanks all
    
      
followingpath3.m
pathfollowingsetup.m
simulation2.mdl
followingpath3.m

陈海亮

unread,
Mar 24, 2017, 3:06:34 AM3/24/17
to YALMIP

sorry for repeated upload of     followingpath3.m

Johan Löfberg

unread,
Mar 24, 2017, 4:09:53 AM3/24/17
to YALMIP
Typical errors are bad tuning (control too penalized) or problems with sampling. When I run your code and look at t when the control is computed, it is not run at 50Hz, but at roughly .5Hz, so you need to set a fixed sample-time somewhere, or however this sync is done)


陈海亮

unread,
Mar 25, 2017, 10:07:48 PM3/25/17
to YALMIP

hi,dr.Johan

  thank you for your answers. But the frequency is 50Hz,(i use a to-workspace module to check the frequency)
  is it possible my model is complicated or time-comsuming that cause some delay ,or the parameters of my model are too large cause some problems?     thanks~~~


陈海亮

unread,
Mar 29, 2017, 4:48:21 AM3/29/17
to YALMIP
hi, dr.Johan
i keep all my sample time the same,but it still not works and change the weighting matrice does not work too.
 This really frustrates me,
is it possible my model is complicated or  the parameters of my model are too large cause some problems?
Appreciate your help

Johan Löfberg

unread,
Mar 29, 2017, 8:14:15 AM3/29/17
to YALMIP
Have you put a debug break at the point where u is computed, and looked at the value of t at those instances when simulating. When I ran your model, it happened at t=0, t=0.16, t = 0.31, t=0.47 etc

陈海亮

unread,
Mar 30, 2017, 4:33:27 AM3/30/17
to YALMIP
hi, dr Johan
 i have a little question.In your example https://yalmip.github.io/YALMIP-and-simulink/  , reference seems does not change in the N prediction horizon of MPC problem ,because r is confirmed by the current simulation time. Is is reasonable?

and I debug my code, i found it's  ok  and t is 0.02 ,0.04,0.06 ect, but output comes to positive infinity

And i found when i shield constraints of x(k+1)=Ax(K)+Bu(k),it still works. i think it's strange
Beg your help
hailiang

 

Johan Löfberg

unread,
Mar 30, 2017, 6:16:47 AM3/30/17
to YALMIP
Why would it not be reasonable to assume constant reference in the future? reference is generated externally (by a pilot for example), so your best guess is that it doesn't change

Don't understand your last question.

Johan Löfberg

unread,
Mar 30, 2017, 6:47:20 AM3/30/17
to YALMIP
you never discretize your model. You define a discrete-time model using the continuous-time data (i.e, Ac will be equal to Ad etc in your code)
Reply all
Reply to author
Forward
0 new messages