Optimization problem, how to limit the individual values in the control vector to a certain range
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
I am doing an trajectory optimization problem with fmincon. I have a running and minimizing problem. However, I am tweaking the solution a bit. The most optimal solution rides the constraint at some points. As a consequence, my control variable rapidly changes between its upper and lower limit to stay on this most optimal constrained path (similar to bang-bang control behaviour).
I now want to smoothen out this behaviour of my control variable (as it is not realistic) by saying that the next value in my control vector can only differ from the previous value by lets say 20%. (so 0.8 < u(i+1)/u(i) < 1.2, 0.8 < u(i+2)/u(i+1) < 1.2, 0.8 < u(i+3)/u(i+2) < 1.2 etc.)
However I am struggling to implement this because the length of my control vector is variable.
Any advice or ideas would be highly appreciated.
Toon
0 commentaires
Réponses (1)
Matt J
le 4 Avr 2021
Modifié(e) : Matt J
le 4 Avr 2021
Assuming the u(i) are non-negative, the condition can be written as a linear constraint.
u=optimvar('u',[10,1], 'LowerBound',0);
con.lower=u(2:end)>=u(1:end-1)*0.8;
con.upper=u(2:end)<=u(1:end-1)*1.2;
prob=prob2matrices({u},'Constraints',con) %https://www.mathworks.com/matlabcentral/fileexchange/74481-prob2matrices-a-selective-version-of-prob2struct
prob =
struct with fields:
intcon: []
lb: [10×1 double]
ub: [10×1 double]
Aineq: [18×10 double]
bineq: [18×1 double]
Aeq: []
beq: []
0 commentaires
Voir également
Catégories
En savoir plus sur Surrogate Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!