I may have disgressed from my question.
The first a few steps seem OK before the NaN appears.
Could you help me find out why it gives out NaN here ?
lambdaR =
1
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
Calling Gurobi 7.52: 6499 variables, 3100 equality constraints
Gurobi optimizer, licensed to CVX for CVX
Academic license - for non-commercial use only
Optimize a model with 3100 rows, 6499 columns and 14466 nonzeros
Model has 2199 quadratic constraints
Coefficient statistics:
Matrix range [2e-04, 8e+00]
QMatrix range [1e+00, 1e+00]
Objective range [3e-16, 1e+01]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 1e+00]
Presolve removed 100 rows and 1900 columns
Presolve time: 0.02s
Presolved: 3000 rows, 4599 columns, 14166 nonzeros
Presolved model has 1349 second-order cone constraints
Ordering time: 0.00s
Barrier statistics:
Free vars : 601
AA’ NZ : 2.015e+04
Factor NZ : 2.745e+04 (roughly 3 MBytes of memory)
Factor Ops : 5.378e+05 (less than 1 second per iteration)
Threads : 1
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 1.03191050e+03 -2.32929406e-04 2.88e+00 1.98e+01 6.25e+00 0s
1 2.10346823e+04 -8.92446763e+02 5.14e-01 6.68e+00 5.55e+00 0s
2 4.60164553e+03 -5.87567123e+02 1.49e-01 4.03e+00 1.82e+00 0s
3 1.70681069e+03 -3.61257117e+02 4.83e-02 2.21e+00 8.14e-01 0s
4 5.55949643e+02 -8.21485391e+01 1.36e-02 4.33e-01 2.19e-01 0s
5 1.52971925e+02 6.77146168e+00 3.15e-03 1.86e-03 3.90e-02 0s
6 4.93622565e+01 2.56034920e+01 5.30e-04 1.68e-04 6.34e-03 0s
7 3.69656859e+01 2.81950781e+01 2.07e-04 3.01e-05 2.35e-03 0s
8 3.21301535e+01 2.88491380e+01 7.68e-05 7.93e-06 8.78e-04 0s
9 3.02285246e+01 2.92261900e+01 2.29e-05 1.17e-06 2.68e-04 0s
10 2.96166584e+01 2.94750868e+01 3.13e-06 2.59e-08 3.77e-05 0s
11 2.95295742e+01 2.95220015e+01 8.50e-08 3.38e-08 1.93e-06 0s
12 2.95254205e+01 2.95251945e+01 3.96e-09 4.76e-09 5.91e-08 0s
13 2.95252568e+01 2.95252306e+01 5.55e-10 1.39e-09 6.85e-09 0s
14 2.95252358e+01 2.95252335e+01 6.48e-10 1.79e-09 5.67e-10 0s
15 2.95252349e+01 2.95252346e+01 2.33e-10 3.54e-09 7.25e-11 0s
Barrier solved model in 15 iterations and 0.15 seconds
Optimal objective 2.95252349e+01
Warning: to get QCP duals, please set parameter QCPDual to 1
Status: Solved
Optimal value (cvx_optval): +29.5252
33 betaR_k = betaR;
Using Pade approximation for exponential
cone with parameters m=3, k=3
Calling Gurobi 7.52: 6499 variables, 3100 equality constraints
Gurobi optimizer, licensed to CVX for CVX
Academic license - for non-commercial use only
Optimize a model with 3100 rows, 6499 columns and 14466 nonzeros
Model has 2199 quadratic constraints
Coefficient statistics:
Matrix range [2e-04, 8e+00]
QMatrix range [1e+00, 1e+00]
Objective range [3e-16, 2e+15]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 1e+00]
Warning: Model contains large objective coefficients
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 100 rows and 1900 columns
Presolve time: 0.04s
Presolved: 3000 rows, 4599 columns, 14166 nonzeros
Presolved model has 1349 second-order cone constraints
Ordering time: 0.00s
Barrier statistics:
Free vars : 601
AA’ NZ : 2.015e+04
Factor NZ : 2.745e+04 (roughly 3 MBytes of memory)
Factor Ops : 5.378e+05 (less than 1 second per iteration)
Threads : 1
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 3.01675108e+07 -2.32929406e-04 3.07e+00 4.96e+03 1.15e+04 0s
1 3.99042416e+04 -9.00007366e+05 3.36e-03 1.75e+02 3.20e+02 0s
2 3.95583531e+03 -2.26773242e+04 4.04e-05 4.97e+00 8.86e+00 0s
3 1.28578120e+03 -8.76126631e+03 4.42e-06 1.98e+00 3.22e+00 0s
4 5.75292234e+02 -3.41653370e+03 8.90e-08 7.48e-01 1.23e+00 0s
5 4.91224106e+02 -1.41769871e+03 6.59e-08 3.13e-01 5.72e-01 0s
6 1.81825724e+02 -2.40020054e+02 1.31e-08 4.68e-02 1.18e-01 0s
7 5.09913643e+01 5.15411533e+00 1.32e-09 2.74e-03 1.20e-02 0s
8 3.06866767e+01 2.42402012e+01 2.19e-10 2.44e-04 1.64e-03 0s
9 2.83382707e+01 2.56039630e+01 9.83e-11 8.63e-05 6.91e-04 0s
10 2.72413906e+01 2.61054361e+01 4.03e-11 3.41e-05 2.87e-04 0s
11 2.67068860e+01 2.63251921e+01 4.09e-11 1.19e-05 9.64e-05 0s
12 2.65526101e+01 2.64107810e+01 8.67e-11 3.79e-06 3.56e-05 0s
13 2.64766111e+01 2.64470015e+01 4.45e-10 5.99e-07 7.36e-06 0s
14 2.64563078e+01 2.64537354e+01 5.03e-11 2.31e-08 6.32e-07 0s
15 2.64541405e+01 2.64540920e+01 6.23e-11 1.86e-08 1.18e-08 0s
16 2.64541004e+01 2.64540971e+01 5.83e-10 8.55e-09 8.15e-10 0s
17 2.64540980e+01 2.64540975e+01 1.03e-09 2.24e-08 1.22e-10 0s
18 2.64540976e+01 2.64540975e+01 1.66e-08 6.72e-06 2.16e-11 0s
Barrier solved model in 18 iterations and 0.18 seconds
Optimal objective 2.64540976e+01
Warning: to get QCP duals, please set parameter QCPDual to 1
Status: Solved
Optimal value (cvx_optval): +26.4541
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
Calling Gurobi 7.52: 6499 variables, 3100 equality constraints
Gurobi optimizer, licensed to CVX for CVX
Academic license - for non-commercial use only
Optimize a model with 3100 rows, 6499 columns and 14466 nonzeros
Model has 2199 quadratic constraints
Coefficient statistics:
Matrix range [2e-04, 8e+00]
QMatrix range [1e+00, 1e+00]
Objective range [3e-16, 2e+15]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 1e+00]
Warning: Model contains large objective coefficients
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 100 rows and 1900 columns
Presolve time: 0.04s
Presolved: 3000 rows, 4599 columns, 14166 nonzeros
Presolved model has 1349 second-order cone constraints
Ordering time: 0.00s
Barrier statistics:
Free vars : 601
AA’ NZ : 2.015e+04
Factor NZ : 2.745e+04 (roughly 3 MBytes of memory)
Factor Ops : 5.378e+05 (less than 1 second per iteration)
Threads : 1
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 1.22672522e+13 -2.32929406e-04 3.07e+00 2.01e+09 4.66e+09 0s
1 1.46875123e+10 -3.64844414e+11 3.36e-03 7.30e+07 1.30e+08 0s
2 1.69482448e+07 -4.18129606e+08 3.70e-06 8.16e+04 1.48e+05 0s
3 1.10458176e+05 -4.75712632e+05 4.14e-09 9.27e+01 1.90e+02 0s
4 7.77828721e+03 -3.32768179e+04 1.59e-10 6.30e+00 1.30e+01 0s
5 1.05059866e+03 -9.25073945e+03 1.13e-10 1.90e+00 3.22e+00 0s
6 5.61022650e+02 -3.65813823e+03 2.64e-10 7.42e-01 1.29e+00 0s
7 3.42794619e+02 -1.17605916e+03 3.40e-10 2.46e-01 4.52e-01 0s
8 1.22015645e+02 -7.18947611e+01 1.31e-10 2.01e-02 5.34e-02 0s
9 4.18670431e+01 1.33759299e+01 3.45e-11 2.62e-03 7.69e-03 0s
10 3.00747191e+01 2.30240473e+01 4.04e-11 1.40e-03 1.81e-03 0s
11 2.74728648e+01 2.41341903e+01 2.07e-11 1.22e-04 8.46e-04 0s
12 2.60897173e+01 2.45178024e+01 1.04e-11 3.05e-04 3.97e-04 0s
13 2.51149706e+01 2.47913696e+01 2.06e-12 4.27e-04 8.08e-05 0s
14 2.48883051e+01 2.48536229e+01 2.30e-12 6.41e-04 8.60e-06 0s
15 2.48631450e+01 2.48594473e+01 2.03e-11 7.32e-04 9.23e-07 0s
16 2.48607260e+01 2.48605846e+01 1.55e-10 8.54e-04 3.45e-08 0s
17 2.48606141e+01 2.48606016e+01 3.88e-09 9.16e-04 3.05e-09 0s
18 2.48606035e+01 2.48606028e+01 3.73e-10 3.45e+10 1.63e-10 0s
19 2.48606067e+01 2.48606028e+01 7.23e-08 3.06e+13 3.35e-09 0s
20 2.48608615e+01 2.48606028e+01 1.21e-07 2.84e+13 1.74e-07 0s
21 2.48621294e+01 2.48606028e+01 1.43e-07 2.77e+13 4.66e-07 0s
22 2.48788597e+01 2.48606028e+01 1.21e-07 2.75e+13 9.51e-07 0s
23 2.54943573e+01 2.48606028e+01 1.63e-07 2.74e+13 4.98e-06 0s
24 4.38115224e+01 2.48606028e+01 1.78e-07 2.74e+13 6.75e-05 0s
25 1.85213789e+02 2.48606028e+01 2.81e-07 2.74e+13 3.09e-04 0s
26 4.57576920e+06 2.48606028e+01 4.20e-04 2.74e+13 4.75e+00 0s
27 1.69945066e+08 2.48606027e+01 1.11e-03 2.74e+13 9.68e+01 0s
28 5.17200147e+08 2.48606025e+01 1.14e-03 2.74e+13 1.62e+02 0s
29 6.72163892e+10 2.48606024e+01 1.09e-03 2.74e+13 1.16e+04 0s
30 1.32417785e+11 2.48606001e+01 1.09e-03 2.73e+13 1.26e+04 0s
31 1.18962504e+13 2.48605993e+01 1.09e-03 2.73e+13 6.20e+05 0s
32 2.94455042e+13 2.48605879e+01 1.09e-03 2.72e+13 8.44e+05 0s
33 1.49820472e+15 2.48605832e+01 1.09e-03 2.71e+13 2.36e+07 0s
34 4.93178428e+15 2.48605435e+01 1.09e-03 2.66e+13 4.28e+07 0s
35 1.45140120e+17 2.48605219e+01 1.09e-03 2.63e+13 6.92e+08 0s
36 6.68881092e+17 2.48604155e+01 1.09e-03 2.56e+13 1.76e+09 0s
37 1.15642490e+19 2.48603342e+01 1.09e-03 2.51e+13 1.67e+10 0s
38 8.29452506e+19 2.48600998e+01 1.09e-03 2.43e+13 6.58e+10 0s
Barrier performed 38 iterations in 0.41 seconds
Sub-optimal termination - objective 2.48607260e+01
Warning: to get QCP duals, please set parameter QCPDual to 1
Status: Inaccurate/Solved
Optimal value (cvx_optval): +24.8607
=====================================
Using Pade approximation for exponential
cone with parameters m=3, k=3
Calling Gurobi 7.52: 6499 variables, 3100 equality constraints
Gurobi optimizer, licensed to CVX for CVX
Academic license - for non-commercial use only
Optimize a model with 3100 rows, 6499 columns and 14466 nonzeros
Model has 2199 quadratic constraints
Coefficient statistics:
Matrix range [2e-04, 8e+00]
QMatrix range [1e+00, 1e+00]
Objective range [3e-16, 2e+15]
Bounds range [0e+00, 0e+00]
RHS range [1e+00, 1e+00]
Warning: Model contains large objective coefficients
Consider reformulating model or setting NumericFocus parameter
to avoid numerical issues.
Presolve removed 100 rows and 1900 columns
Presolve time: 0.04s
Presolved: 3000 rows, 4599 columns, 14166 nonzeros
Presolved model has 1349 second-order cone constraints
Ordering time: 0.00s
Barrier statistics:
Free vars : 601
AA’ NZ : 2.015e+04
Factor NZ : 2.745e+04 (roughly 3 MBytes of memory)
Factor Ops : 5.378e+05 (less than 1 second per iteration)
Threads : 1
Objective Residual
Iter Primal Dual Primal Dual Compl Time
0 1.01097710e+17 -2.32929406e-04 3.07e+00 1.66e+13 3.66e+13 0s
1 8.45779933e+14 -2.98656249e+15 2.41e-02 7.10e+11 1.25e+12 0s
2 8.00564662e+12 -3.49369089e+13 2.21e-04 7.30e+09 1.34e+10 0s
3 5.99406927e+10 -2.56784061e+11 1.62e-06 5.37e+07 9.89e+07 0s
4 6.90132878e+08 -2.40280978e+09 1.52e-08 5.02e+05 9.56e+05 0s
5 1.84737069e+06 -6.38325038e+06 4.03e-11 1.33e+03 2.54e+03 0s
6 7.70881756e+03 -2.28949595e+04 2.85e-13 9.00e+00 9.27e+00 0s
7 1.20554052e+03 -9.65465639e+03 1.41e-11 2.25e+00 3.30e+00 0s
8 5.43238328e+02 -4.00586845e+03 7.33e-11 2.00e+00 1.36e+00 0s
9 4.58936738e+02 -2.06794990e+03 5.35e-11 1.23e+13 7.46e-01 0s
10 2.09809483e+02 -2.00078648e+02 1.04e-11 1.85e+14 1.14e-01 0s
11 7.17021645e+01 3.77893798e+00 1.12e-11 3.18e+14 1.70e-02 0s
12 3.41955676e+01 2.20435900e+01 1.70e-11 5.66e+14 2.73e-03 0s
13 1.07964604e+04 2.26195200e+01 1.14e-11 1.17e+19 1.29e+03 0s
14 1.07576355e+04 2.22982459e+01 3.35e-11 1.17e+19 1.29e+03 0s
15 1.07727329e+04 2.05726771e+01 4.69e-11 1.17e+19 1.29e+03 0s
16 1.08220141e+04 1.56798087e+01 1.57e-10 1.17e+19 1.29e+03 0s
17 1.08877547e+04 -1.51215256e-01 2.57e-10 1.17e+19 1.29e+03 0s
18 1.10099408e+04 -2.56860870e+01 3.60e-10 1.17e+19 1.29e+03 0s
19 1.12972170e+04 -6.53383297e+01 3.60e-10 1.16e+19 1.28e+03 0s
20 2.91061541e+04 -6.54272998e+01 3.42e-10 1.16e+19 1.13e+03 0s
21 2.95252209e+07 -6.54324982e+01 2.43e-10 1.15e+19 9.80e+02 0s
22 2.59953059e+09 -6.55939240e+01 2.32e-10 1.15e+19 3.84e+03 0s
23 8.42141693e+11 -6.56462722e+01 2.24e-10 1.15e+19 5.17e+05 0s
24 2.79406211e+12 -1.61944458e+02 2.35e-10 1.15e+19 9.42e+05 0s
25 2.07768324e+13 -2.16985997e+02 2.46e-10 1.15e+19 3.85e+06 0s
26 1.27076575e+14 -2.85837821e+02 2.50e-10 1.15e+19 1.30e+07 0s
27 1.36698699e+15 -3.56428683e+02 2.46e-10 1.15e+19 7.66e+07 0s
28 6.48760442e+15 -4.84549061e+02 2.49e-10 1.15e+19 2.00e+08 0s
29 7.84744495e+16 -5.86068006e+02 2.22e-10 1.15e+19 1.33e+09 0s
30 3.53297467e+17 -7.92368596e+02 2.24e-10 1.15e+19 3.30e+09 0s
31 4.17623092e+18 -9.47203335e+02 2.36e-10 1.15e+19 2.14e+10 0s
32 1.94083314e+19 -1.25344687e+03 2.31e-10 1.15e+19 5.48e+10 0s
33 2.17192210e+20 -1.49052440e+03 2.31e-10 1.15e+19 3.37e+11 0s
34 1.05895697e+21 -1.93335921e+03 2.43e-10 1.15e+19 9.04e+11 0s
35 1.12803268e+22 -2.29284701e+03 2.36e-10 1.15e+19 5.29e+12 0s
36 5.72787043e+22 -2.93115173e+03 2.42e-10 1.15e+19 1.48e+13 0s
37 4.45286845e+19 -1.85962714e-02 2.00e+03 1.32e+15 4.77e+14 0s
38 4.38391136e+19 -7.63815829e+16 1.98e+03 1.04e+15 3.30e+16 0s
39 2.21274477e+18 -3.18436640e+17 1.69e+02 2.64e+13 1.15e+16 0s
40 2.56102477e+16 -2.34511177e+17 1.34e+01 2.68e+12 6.86e+14 0s
41 2.62087668e+15 -1.52524301e+16 4.09e-03 1.76e+10 5.01e+12 0s
42 8.55657542e+12 -4.96208988e+13 1.38e-05 5.74e+07 1.63e+10 0s
43 1.20708259e+10 -7.08891145e+10 1.61e-05 8.93e+04 2.31e+07 0s
44 6.72026101e+08 -5.25022398e+09 4.53e-06 6.64e+03 1.60e+06 0s
45 8.54720967e+07 -2.85509752e+09 8.16e-06 3.62e+03 7.36e+05 0s
46 7.49181745e+06 -1.54521776e+09 3.18e-06 1.97e+03 3.80e+05 0s
47 7.31697279e+06 -9.21955783e+08 2.33e-06 1.18e+03 2.27e+05 0s
48 6.26960744e+06 -6.92031615e+08 2.35e-06 8.92e+02 1.71e+05 0s
49 5.72723670e+06 -3.16018556e+08 1.71e-06 4.14e+02 7.88e+04 0s
50 2.42611765e+06 -1.77615530e+08 2.91e-06 2.39e+02 4.41e+04 0s
51 3.19016585e+05 -2.78871251e+05 2.35e-06 1.74e+01 1.43e+02 0s
52 4.03336100e+04 -9.35364179e+03 2.97e-07 4.73e+00 1.22e+01 0s
53 5.92566537e+03 -1.08969027e+03 4.31e-08 5.38e+00 1.71e+00 0s
54 9.91473755e+02 -1.54875099e+02 7.36e-09 6.04e+00 2.80e-01 0s
55 2.31824592e+02 -4.60931101e+01 1.68e-09 5.99e+00 6.79e-02 0s
56 6.21721160e+01 1.25524533e+01 3.25e-10 1.35e+14 1.16e-02 1s
57 4.12906389e+01 1.90893786e+01 1.51e-10 2.70e+14 4.84e-03 1s
58 3.32296949e+01 2.08293770e+01 8.40e-11 3.56e+14 2.61e-03 1s
59 2.93535387e+01 2.22253011e+01 8.85e-11 2.85e+14 1.40e-03 1s
60 2.87238337e+01 2.31392451e+01 8.32e-11 4.60e+17 3.21e-03 1s
61 3.97706949e+01 2.31392451e+01 8.32e-11 2.75e+19 3.21e-03 1s
62 6.88556364e+01 2.31392456e+01 2.36e-08 1.77e+19 3.71e-03 1s
63 7.01495855e+01 2.31392456e+01 2.36e-08 3.26e+19 3.71e-03 1s
64 8.14545787e+01 2.31392458e+01 2.27e-08 2.35e+19 3.20e-03 1s
65 8.19162358e+01 2.31392458e+01 2.27e-08 6.52e+19 3.20e-03 1s
66 1.57562032e+02 2.31392458e+01 2.26e-08 2.36e+19 3.15e-03 1s
67 1.57635316e+02 2.31392458e+01 2.26e-08 2.36e+19 3.15e-03 1s
68 3.72750639e+02 2.31392458e+01 2.26e-08 2.37e+19 2.88e-03 1s
69 3.72762489e+02 2.31392458e+01 2.26e-08 2.37e+19 2.88e-03 1s
70 3.97404539e+02 2.31392463e+01 2.26e-08 3.24e+19 2.85e-03 1s
71 3.97478519e+02 2.31392463e+01 2.26e-08 3.24e+19 2.85e-03 1s
72 4.18118663e+02 2.31392542e+01 2.30e-08 2.74e+20 3.45e-03 1s
73 4.19433937e+02 2.31392542e+01 2.30e-08 8.67e+20 3.45e-03 1s
74 4.21560753e+02 2.31392748e+01 2.31e-08 6.81e+22 8.01e-03 1s
75 4.28049899e+02 2.31392748e+01 2.31e-08 1.18e+24 8.01e-03 1s
76 2.84816501e+04 2.31392748e+01 2.31e-08 1.20e+23 1.57e+00 1s
77 2.84822044e+04 2.31392748e+01 2.31e-08 1.44e+23 1.57e+00 1s
78 2.84822044e+04 2.31392748e+01 2.31e-08 1.44e+23 1.57e+00 1s
Barrier performed 78 iterations in 0.73 seconds
Numerical trouble encountered
Status: Failed
Optimal value (cvx_optval): NaN