Periodicity Constraint

87 views
Skip to first unread message

Niko

unread,
Jul 3, 2019, 7:16:07 AM7/3/19
to YALMIP
Hello all,

I have some difficulties defining a periodicity constraint in YALMIP. My problem is schmatically:

q = sdpvar(4, N)
u = sdpvar(2, N-1)

Objective: J = sum_{k=1}^{N} q{k}’ Q q{k} + u{k}’ R u{k} ;
Dynamic constraint for k = 1...N : q{k+1} = A*q{k}+B*u{k} 

Suppose the state q{k} comprises two angles and two angular velocities 

q{k} = [phi1, phi2, omega_1, omega_2]. 

I am looking for a way to implement a 2pi-periodic constraints in the angles, something like 

q{N}(1:2) % 2*pi = q_end(1:2)  
The modulo operator does not seem to work with YALMIP decision variables.  I'm using IPOPT solver for my optimization problem.  Is there a possibility to define such a constraint in YALMIP?

Thank you in advance!

Johan Löfberg

unread,
Jul 3, 2019, 3:47:53 PM7/3/19
to YALMIP
mod works but it requires integer variables to be represented, so ipopt will not be applicable

>> sdpvar x;mod(x,pi)
Nonlinear scalar (real, 1 variable)
Coeffiecient range: 1 to 1


Niko

unread,
Jul 4, 2019, 3:04:45 AM7/4/19
to YALMIP
Dear Johan,

thank you for your fast reply!

Do you see any other alternative to define periodicity in yalmip? 
Perfect would be, if it is applicable with ipopt or any other nonlinear solver, as I have also a nonlinear constraint.

Thank you very much!

Johan Löfberg

unread,
Jul 4, 2019, 5:21:32 AM7/4/19
to YALMIP
I don't see any natural way to encode it beyond weird manual represention of effectively binary variables using nonlinear constraints or horrible nonsmooth functions. it's an intrinsically nonconvex pwa function

Perhaps you could could approximate the nonlinearities using pwa approximations, or simply use a MINLP solver instead.
Reply all
Reply to author
Forward
0 new messages