Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging input constraint violation #37

Merged
merged 14 commits into from
Apr 4, 2019
Merged

Debugging input constraint violation #37

merged 14 commits into from
Apr 4, 2019

Conversation

avikde
Copy link
Owner

@avikde avikde commented Mar 28, 2019

Related to #36

  • simplify specification of experiment parameters using dicts
  • reduce eps_prim_inf instead of eps

@avikde
Copy link
Owner Author

avikde commented Mar 28, 2019

Pretty serious problems: getting

  • solved inaccurate
  • max iter reached

https://osqp.org/docs/interfaces/status_values.html

Don't really know how to solve this problem. :(

@avikde
Copy link
Owner Author

avikde commented Mar 28, 2019

Maybe fixing #38 first might help make the trajectories more stable?

@avikde
Copy link
Owner Author

avikde commented Apr 1, 2019

seems like the somersault and hover also doesn't work on master

@avikde
Copy link
Owner Author

avikde commented Apr 2, 2019

changing eps_prim_inf / dual seem to have no effect on the input constraint violations.

@avikde
Copy link
Owner Author

avikde commented Apr 2, 2019

  • use u - Ax to check the violation
  • print out the violation, and check the amount of violation. It must be less than eps_prim_inf

Some test results

  • assert (res.x[-self.N*self.m.nu:-(self.N-1)*self.m.nu] == (self.A @ res.x)[-self.N*self.m.nu:-(self.N-1)*self.m.nu]).all() does not trigger; so the A setup is correct pertaining to limits on u
  • np.amin(self.u - Ax), np.amin(Ax - self.l) are -0.00022063885292222807 -0.00159435525542619 (where u, l are the vectors of the same name provided to OSQP, Ax = A @ x), and the osqp settings are polish=False, scaling=0, eps_rel=1e-4, kdamping=0, eps_prim_inf=1e-6, eps_dual_inf=1e-6

@avikde
Copy link
Owner Author

avikde commented Apr 3, 2019

Created this issue: osqp/osqp#125

Code to save the arrays at the suspicious time in mpc.py

				np.savez('arrays.npz', q=q, l=self.l, u=self.u)
				sparse.save_npz('P.npz', self.P)
				sparse.save_npz('A.npz', self.A)

@avikde
Copy link
Owner Author

avikde commented Apr 3, 2019

Ok "solved inaccurate" basically means the solution is close but not quite there within the max number of iterations, so the problem can be removed by increasing max_iter. Now the problem is "primal infeasible" again. From inspecting inf_cert, it looks like u0 is infeasible? What does that mean?

TODO look at that row of A

@avikde avikde mentioned this pull request Apr 4, 2019
4 tasks
@avikde avikde merged commit 84cb462 into master Apr 4, 2019
@avikde avikde deleted the inp-constr branch April 4, 2019 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant