no solution found !!

32 views
Skip to first unread message

Mohamed Soliman

unread,
Sep 22, 2021, 1:55:02 PM9/22/21
to YALMIP
Hello Johan,
In the attached code I want to implement a car (with linear dynamics) equipped with lidar senor. The optimizer should predict only one step ahead within the field of view (which I assume it as a box) . The optimizer can predict in the current field of view or in the previous lidar reading. According to the objective function which is minimizing a goal point, a point from the current lidar measurement should be selected. 
When I code the mathematical formulation, the optimizer does not give me any sol
BR 
M.Soliman
planner2.m

Johan Löfberg

unread,
Sep 22, 2021, 2:21:37 PM9/22/21
to YALMIP
https://yalmip.github.io/debugginginfeasible

and then as always, you don't use optimizer until you actually know code works with optimize, and you never turn off display (as you have now) until things work

Mohamed Soliman

unread,
Sep 22, 2021, 2:39:18 PM9/22/21
to YALMIP
I follow the link you sent and use optimize(constraints,[],sdpsettings('solver','gurobi'))
yalmipversion: '20200930'
    matlabversion: '9.9.0.1467703 (R2020b)'
       yalmiptime: 0.21704
       solvertime: 0.10496
             info: 'Successfully solved (GUROBI-GUROBI)'
          problem: 0

how I turn on display?
Thanks

Mohamed Soliman

unread,
Sep 22, 2021, 2:41:07 PM9/22/21
to YALMIP
Also when I use optimize(constraints,objective,sdpsettings('solver','gurobi')) it gives me 
yalmipversion: '20200930'
    matlabversion: '9.9.0.1467703 (R2020b)'
       yalmiptime: 0.45011
       solvertime: 0.23052
             info: 'Successfully solved (GUROBI-GUROBI)'
          problem: 0
>> 

On Wednesday, September 22, 2021 at 8:21:37 PM UTC+2 Johan Löfberg wrote:

Mohamed Soliman

unread,
Sep 22, 2021, 2:46:49 PM9/22/21
to YALMIP
optimize(constraints,objective,sdpsettings('solver','gurobi','verbose',1))

Gurobi Optimizer version 9.1.2 build v9.1.2rc0 (linux64)
Thread count: 4 physical cores, 8 logical processors, using up to 8 threads
Optimize a model with 17 rows, 16 columns and 28 nonzeros
Model fingerprint: 0xb72e5dd0
Model has 14 quadratic objective terms
Variable types: 14 continuous, 2 integer (2 binary)
Coefficient statistics:
  Matrix range     [5e-03, 1e+00]
  Objective range  [0e+00, 0e+00]
  QObjective range [2e+00, 4e+00]
  Bounds range     [1e+00, 1e+00]
  RHS range        [1e+00, 1e+02]
Presolve removed 16 rows and 11 columns
Presolve time: 0.00s
Presolved: 1 rows, 5 columns, 4 nonzeros
Presolved model has 6 quadratic objective terms
Variable types: 5 continuous, 0 integer (0 binary)
Presolve time: 0.09s
Presolved: 1 rows, 5 columns, 4 nonzeros
Presolved model has 6 quadratic objective terms
Root barrier log...

Ordering time: 0.00s

Barrier statistics:
 Free vars  : 5
 AA' NZ     : 3.000e+00
 Factor NZ  : 6.000e+00
 Factor Ops : 1.400e+01 (less than 1 second per iteration)
 Threads    : 1

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   7.68935161e-10 -6.26562500e+03  1.00e+03 5.87e-07  1.00e+06     0s
   1   1.07864430e-05 -6.22677209e+03  9.99e-01 7.47e-05  2.55e+03     0s
   2   1.24907040e-03 -3.92732195e+02  9.99e-07 5.28e-08  9.82e+01     0s
   3   1.24786283e-03 -4.54656566e-01  1.61e-10 2.91e-11  1.14e-01     0s
   4   6.62152250e-04 -1.15421266e-03  4.01e-12 1.37e-08  4.54e-04     0s
   5   9.50951799e-05 -1.53060889e-04  3.77e-12 1.20e-08  6.23e-05     0s
   6   1.37609883e-05 -1.58619848e-05  3.62e-12 2.47e-09  7.42e-06     0s
   7   1.95758040e-06 -2.28425785e-06  3.95e-11 8.62e-10  1.06e-06     0s
   8   2.78661554e-07 -3.17947441e-07  6.68e-11 3.14e-10  1.49e-07     0s
   9   4.02136123e-08 -4.43417732e-08  2.63e-10 1.17e-10  2.12e-08     0s
  10   6.36654596e-09 -5.62340864e-09  1.10e-10 4.39e-11  3.00e-09     0s
  11   1.56272418e-09 -1.37868858e-10  1.04e-09 9.71e-12  4.26e-10     0s

Barrier solved model in 11 iterations and 0.14 seconds
Optimal objective 1.56272418e-09


Root relaxation: objective 1.562724e-09, 0 iterations, 0.06 seconds

    Nodes    |    Current Node    |     Objective Bounds      |     Work
 Expl Unexpl |  Obj  Depth IntInf | Incumbent    BestBd   Gap | It/Node Time

*    0     0               0       0.0000000    0.00000  0.00%     -    0s

Explored 0 nodes (0 simplex iterations) in 0.16 seconds
Thread count was 8 (of 8 available processors)

Solution count 1: 1.56342e-09 

Optimal solution found (tolerance 1.00e-04)
Best objective 1.566149876453e-09, best bound 1.562724178396e-09, gap 0.0000%
ans = 
  struct with fields:

    yalmipversion: '20200930'
    matlabversion: '9.9.0.1467703 (R2020b)'
       yalmiptime: 0.20439
       solvertime: 0.2011
             info: 'Successfully solved (GUROBI-GUROBI)'
          problem: 0

Johan Löfberg

unread,
Sep 22, 2021, 2:58:11 PM9/22/21
to YALMIP
So no problems then (assuming you have added constraints on initial conditons etc to actually solve the problem you want)

verbosity is controlled with the verbose option. to ensure it displays when using optimizer, you will have to increase it to 2, as it by default drops the verbosity level by 1 level

Johan Löfberg

unread,
Sep 22, 2021, 3:08:09 PM9/22/21
to YALMIP
and why are you using the horzcat function instead of just concatenating as usual


onsdag 22 september 2021 kl. 20:39:18 UTC+2 skrev mosoli...@gmail.com:
Reply all
Reply to author
Forward
0 new messages