Fail to solve full-state feedback H2 control problem


(Shao-Chen Hsu) #1

I’m trying to solve a basic H2 control with full-state feedback and I want to minimize trace(W). The code is as follows:

cvx_begin sdp
    variable X(nx,nx) symmetric
    variable W(nz,nz) symmetric
    variable Z(nu,nx)
    [A Bu]*[X;Z] + [X Z']*[A';Bu'] + Bw*Bw' < 0
    [W (Cz*X + Du*Z); (Cz*X + Du*Z)' X] > 0
    minimize trace(W)
cvx_end

But the result showed failed as following detail:

Calling SDPT3 4.0: 498 variables, 222 equality constraints
------------------------------------------------------------

 num. of constraints = 222
 dim. of sdp    var  = 36,   num. of sdp  blk  =  2
 dim. of free   var  = 120 *** convert ublk to lblk
*******************************************************************
   SDPT3: Infeasible path-following algorithms
*******************************************************************
 version  predcorr  gam  expon  scale_data
   HKM      1      0.000   1        0    
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
 0|0.000|0.000|4.4e+01|8.3e+02|1.8e+07| 3.031889e+03  0.000000e+00| 0:0:00| chol  1  1 
 1|0.903|0.796|4.3e+00|1.7e+02|8.0e+05| 3.690438e+03  5.103907e+01| 0:0:00| chol  1  1 
 2|1.000|0.923|1.4e-05|1.3e+01|1.8e+04| 1.805466e+03  1.887894e+01| 0:0:00| chol  1  1 
 3|0.959|0.925|4.8e-06|1.0e+00|7.0e+02| 1.436071e+02  1.141568e+00| 0:0:00| chol  1  1 
 4|0.891|0.866|1.4e-06|1.5e-01|8.9e+01| 2.084952e+01  1.910550e-01| 0:0:00| chol  1  1 
 5|0.780|0.762|3.3e-07|3.9e-02|2.6e+01| 8.145588e+00  7.372940e-02| 0:0:00| chol  1  1 
 6|0.653|0.565|1.2e-07|1.7e-02|1.1e+01| 3.323806e+00  6.153861e-02| 0:0:00| chol  1  1 
 7|0.398|0.326|7.2e-08|1.2e-02|6.5e+00| 1.913723e+00  7.473178e-02| 0:0:00| chol  1  1 
 8|0.637|0.459|2.7e-08|6.5e-03|3.2e+00| 8.607731e-01  6.581134e-02| 0:0:00| chol  1  1 
 9|0.929|0.611|2.9e-09|2.5e-03|1.1e+00| 2.234376e-01  6.846246e-02| 0:0:00| chol  1  1 
10|0.556|0.295|2.4e-09|1.8e-03|7.1e-01| 1.643040e-01  6.722418e-02| 0:0:00| chol  1  1 
11|1.000|0.374|9.0e-10|1.1e-03|4.0e-01| 1.013514e-01  6.752608e-02| 0:0:00| chol  1  1 
12|1.000|0.504|3.1e-10|5.6e-04|1.8e-01| 8.280661e-02  6.849400e-02| 0:0:00| chol  1  1 
13|1.000|0.247|1.0e-10|4.2e-04|1.3e-01| 7.715741e-02  6.876742e-02| 0:0:00| chol  1  1 
14|1.000|0.469|2.8e-11|2.2e-04|6.6e-02| 7.258526e-02  6.931814e-02| 0:0:00| chol  1  1 
15|1.000|0.550|8.7e-12|1.0e-04|2.8e-02| 6.997686e-02  6.960917e-02| 0:0:00| chol  1  1 
16|1.000|0.182|2.9e-12|8.2e-05|2.4e-02| 6.913047e-02  6.951672e-02| 0:0:00| chol  1  1 
17|1.000|0.314|1.1e-12|1.4e-04|1.8e-02| 6.848998e-02  6.926522e-02| 0:0:00| chol  1  1 
18|0.837|0.774|5.8e-13|1.1e-04|5.4e-03| 6.801536e-02  6.834304e-02| 0:0:00| chol  1  1 
19|0.611|0.505|3.4e-13|3.3e-05|2.2e-03| 6.754263e-02  6.786897e-02| 0:0:00| chol  1  1 
20|0.434|0.431|2.8e-13|1.4e-05|1.2e-03| 6.716776e-02  6.750292e-02| 0:0:00| chol  1  1 
21|0.317|0.428|3.4e-13|7.8e-06|7.9e-04| 6.687502e-02  6.715515e-02| 0:0:00| chol  1  1 
22|0.274|0.404|4.1e-13|5.2e-06|5.4e-04| 6.657433e-02  6.686096e-02| 0:0:00| chol  1  1 
23|0.266|0.284|5.9e-13|3.6e-06|4.3e-04| 6.630411e-02  6.666722e-02| 0:0:00| chol  1  1 
24|0.467|0.496|8.8e-13|2.8e-06|2.7e-04| 6.601401e-02  6.633461e-02| 0:0:00| chol  1  1 
25|0.243|0.493|1.5e-12|1.8e-06|1.8e-04| 6.581955e-02  6.604683e-02| 0:0:01| chol  1  1 
26|0.207|0.408|2.1e-12|1.2e-06|1.4e-04| 6.561867e-02  6.584711e-02| 0:0:01| chol  1  1 
27|0.090|0.264|2.2e-12|9.4e-07|1.5e-04| 6.550835e-02  6.571906e-02| 0:0:01| chol  1  1 
28|0.143|0.262|2.8e-12|9.5e-07|1.6e-04| 6.542601e-02  6.560485e-02| 0:0:01|
  stop: progress is bad
-------------------------------------------------------------------
 number of iterations   = 28
 primal objective value =  6.56186716e-02
 dual   objective value =  6.58471075e-02
 gap := trace(XZ)       = 1.39e-04
 relative gap           = 1.22e-04
 actual relative gap    = -2.02e-04
 rel. primal infeas (scaled problem)   = 2.08e-12
 rel. dual     "        "       "      = 1.23e-06
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 2.3e+04, 4.0e+00, 5.3e+00
 norm(A), norm(b), norm(C) = 2.6e+01, 1.5e+01, 4.5e+00
 Total CPU time (secs)  = 0.55  
 CPU time per iteration = 0.02  
 termination code       = -5
 DIMACS: 2.9e-12  0.0e+00  2.7e-06  0.0e+00  -2.0e-04  1.2e-04
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Failed
Optimal value (cvx_optval): NaN

Then I remove the minimization and change it to trace(W)<0.08, where 0.08 can be other numbers that is smaller than 1. And the problem is solved.

Calling SDPT3 4.0: 499 variables, 223 equality constraints
------------------------------------------------------------

 num. of constraints = 223
 dim. of sdp    var  = 36,   num. of sdp  blk  =  2
 dim. of linear var  =  1
 dim. of free   var  = 120 *** convert ublk to lblk
*******************************************************************
   SDPT3: Infeasible path-following algorithms
*******************************************************************
 version  predcorr  gam  expon  scale_data
   HKM      1      0.000   1        0    
it pstep dstep pinfeas dinfeas  gap      prim-obj      dual-obj    cputime
-------------------------------------------------------------------
 0|0.000|0.000|2.1e+02|3.7e+03|1.8e+07| 0.000000e+00  0.000000e+00| 0:0:00| chol  1  1 
 1|0.832|0.848|3.6e+01|5.6e+02|6.0e+05| 0.000000e+00  6.254044e+01| 0:0:00| chol  1  1 
 2|0.427|0.597|2.1e+01|2.3e+02|8.3e+04| 0.000000e+00  7.135003e+01| 0:0:00| chol  1  1 
 3|0.889|0.877|2.3e+00|2.8e+01|5.7e+03| 0.000000e+00  1.012993e+01| 0:0:00| chol  1  1 
 4|0.715|0.760|6.5e-01|6.7e+00|1.2e+03| 0.000000e+00  8.985129e-01| 0:0:00| chol  1  1 
 5|0.610|0.506|2.5e-01|3.3e+00|5.7e+02| 0.000000e+00 -5.607196e-01| 0:0:00| chol  1  1 
 6|0.374|0.273|1.6e-01|2.4e+00|3.8e+02| 0.000000e+00 -2.971750e-01| 0:0:00| chol  1  1 
 7|0.691|0.668|4.9e-02|8.0e-01|1.3e+02| 0.000000e+00 -1.108649e+00| 0:0:00| chol  1  1 
 8|0.622|0.257|1.9e-02|6.0e-01|7.9e+01| 0.000000e+00 -1.137038e+00| 0:0:00| chol  1  1 
 9|0.638|0.382|6.7e-03|3.7e-01|4.4e+01| 0.000000e+00 -1.176212e+00| 0:0:00| chol  1  1 
10|0.698|0.396|2.0e-03|2.2e-01|2.4e+01| 0.000000e+00 -1.071168e+00| 0:0:00| chol  1  1 
11|0.842|0.275|3.2e-04|1.6e-01|1.6e+01| 0.000000e+00 -1.030138e+00| 0:0:00| chol  1  1 
12|1.000|0.738|2.8e-07|4.2e-02|3.9e+00| 0.000000e+00 -4.598663e-01| 0:0:00| chol  1  1 
13|1.000|0.986|2.4e-07|6.0e-04|5.6e-02| 0.000000e+00 -6.418407e-03| 0:0:00| chol  1  1 
14|1.000|0.950|2.6e-09|3.1e-05|3.6e-03| 0.000000e+00 -2.901036e-04| 0:0:00| chol  1  1 
15|0.211|0.019|2.1e-09|9.1e-05|3.1e-03| 0.000000e+00 -2.883252e-04| 0:0:00| chol  1  1 
16|1.000|0.927|3.1e-11|7.8e-05|7.6e-04| 0.000000e+00 -2.907042e-05| 0:0:00| chol  1  1 
17|1.000|0.929|1.7e-12|1.9e-05|1.5e-04| 0.000000e+00 -6.387268e-06| 0:0:00| chol  1  1 
18|1.000|0.893|3.0e-13|3.8e-06|3.2e-05| 0.000000e+00 -5.349118e-06| 0:0:00| chol  1  1 
19|1.000|0.984|6.0e-12|8.1e-07|4.4e-06| 0.000000e+00 -1.643094e-07| 0:0:00| chol  1  1 
20|1.000|0.979|1.2e-12|1.1e-07|5.6e-07| 0.000000e+00 -8.559101e-09| 0:0:00| chol  1  1 
21|1.000|0.961|5.6e-12|1.4e-08|7.2e-08| 0.000000e+00 -8.604930e-10| 0:0:00| chol  1  1 
22|1.000|0.941|3.0e-12|1.8e-09|9.8e-09| 0.000000e+00 -1.362904e-10| 0:0:00|
  stop: max(relative gap, infeasibilities) < 1.49e-08
-------------------------------------------------------------------
 number of iterations   = 22
 primal objective value =  0.00000000e+00
 dual   objective value = -1.36290420e-10
 gap := trace(XZ)       = 9.78e-09
 relative gap           = 9.78e-09
 actual relative gap    = 1.36e-10
 rel. primal infeas (scaled problem)   = 2.97e-12
 rel. dual     "        "       "      = 1.82e-09
 rel. primal infeas (unscaled problem) = 0.00e+00
 rel. dual     "        "       "      = 0.00e+00
 norm(X), norm(y), norm(Z) = 2.5e+03, 4.3e-08, 5.7e-08
 norm(A), norm(b), norm(C) = 2.6e+01, 1.5e+01, 1.0e+00
 Total CPU time (secs)  = 0.31  
 CPU time per iteration = 0.01  
 termination code       =  0
 DIMACS: 4.1e-12  0.0e+00  1.8e-09  0.0e+00  1.4e-10  9.8e-09
-------------------------------------------------------------------
 
------------------------------------------------------------
Status: Solved
Optimal value (cvx_optval): +0

I have no idea why the minimization problem is failed but solving LMIs is working.

Please help me with this issue. Thank you.


(Mark L. Stone) #2

Apparently, your problem is numerically challenging for SDPT3. Have you tried another solver, such as SeDuMi? If you have it available, Mosek may be the most numerically robust solver option you could use.

Perhaps your problem is poorly scaled (for instance, having non-zero matrix elements of vastly differing magnitudes), which could cause numerical challenges for the solver. But you haven’t provided a reproducible problem, so readers may be limited in what they can conclude.