[Python] Python constrained non-linear optimization

Discussão em 'Python' iniciado por Stack, Fevereiro 6, 2025.

  1. Stack

    Stack Membro Participativo

    What's the recommended package for constrained non-linear optimization in python ?

    The specific problem I'm trying to solve is this:

    I have an unknown X (Nx1), I have M (Nx1) u vectors and M (NxN) s matrices.

    max [5th percentile of (ui_T*X), i in 1 to M]
    st
    0<=X<=1 and
    [95th percentile of (X_T*si*X), i in 1 to M]<= constant


    When I started out the problem I only had one point estimate for u and s and I was able to solve the problem above with cvxpy.

    I realized that instead of one estimate for u and s, I had the entire distribution of values so I wanted to change my objective function so that I could use the entire distribution. The problem description above is my attempt to include that information in a meaningful way.

    cvxpy cannot be used to solve this, I've tried scipy.optimize.anneal, but I can't seem to set bounds on the unknown values. I've looked at pulp too but it doesnt allow nonlinear constraints.

    Continue reading...

Compartilhe esta Página