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

Geometric and numerical aspects of redundancy #2

Closed
stephane-caron opened this issue Dec 9, 2022 · 0 comments
Closed

Geometric and numerical aspects of redundancy #2

stephane-caron opened this issue Dec 9, 2022 · 0 comments

Comments

@stephane-caron
Copy link
Member

stephane-caron commented Dec 9, 2022

I propose to add the following problem to the github_ffa test set.

The problem can be constructed as follows:

def get_problem(alpha: float):
    return Problem(
        P=np.eye(2),
        q=np.zeros(2),
        G=None,
        h=None,
        A=np.array([1.0, alpha]).reshape((1, 2)),
        b=np.array([1.0]),
        lb=None,
        ub=None,
        name=f"weds_{alpha=}",
        optimal_cost=0.5 / (1 + alpha ** 2),
    )

Motivation

This problem tries to minimize $x^2 + y^2$ while staying on the line $y = \frac{1}{\alpha} - \frac{x}{\alpha}$, which becomes more and more vertical as $\alpha \to 0$. Some solvers get to it exactly, some others with good precision, and some of them miss it completely:

In [1]: P, q, A, b = get_problem(1e-20) 
    ...: solve_qp(P, q, A=A, b=b, solver="quadprog")                                                                                                                          
Out[1]: array([1.e+00, 1.e-20])

In [2]: P, q, A, b = get_problem(1e-20) 
    ...: solve_qp(P, q, A=A, b=b, solver="proxqp")                                                                                                                            
Out[2]: array([9.99999003e-01, 9.99999003e-21])

In [3]: P, q, A, b = get_problem(1e-20) 
    ...: solve_qp(P, q, A=A, b=b, solver="qpoases")                                                                                                                           
Out[3]: array([1., 0.])

Solution

The solution $(x^*, y^*)$ is

$$ \begin{align} x^* & = \frac{1}{1 + \alpha^2} & y^* & = \frac{\alpha}{1 + \alpha^2} \end{align} $$

References

This problem is inspired from Geometric and numerical aspects of redundancy.

@stephane-caron stephane-caron reopened this Dec 9, 2022
@stephane-caron stephane-caron changed the title Geometric and numerical aspects of redundancy [GHFFA1] Geometric and numerical aspects of redundancy Dec 12, 2022
@stephane-caron stephane-caron changed the title [GHFFA1] Geometric and numerical aspects of redundancy [GHFFA01] Geometric and numerical aspects of redundancy Dec 12, 2022
@stephane-caron stephane-caron transferred this issue from qpsolvers/qpbenchmark Dec 14, 2023
@stephane-caron stephane-caron changed the title [GHFFA01] Geometric and numerical aspects of redundancy Geometric and numerical aspects of redundancy Dec 14, 2023
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

No branches or pull requests

1 participant