[Python] How to create constraints and its jacobian in pyslsqp

Discussão em 'Python' iniciado por Stack, Junho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I am working with pyslsqp. The objective function has been implemented through objects using matrices. The size of the matrices are variable and i am writing code for flexible dimensions. While the objectives has been calculated based on manipulation of matrices through physical models, the constraints have to be constructed based on matrices. pyslsqp requires constraints and the jacobian to be constructed. pyslsqp example in the documentation expresses constraints through "hard-coded" expression (as in np.array([x[0]+x[1]-1]))--either equality or inequality--and hard-coded jacobian (as in np.array([[1,1]])).

    Does anyone in the forum has any experiences in dealing with such a requirement.

    If i express the constraint in form of an array, how do i code to provide an array of expressions - as in the example provided.

    Continue reading...

Compartilhe esta Página