Skip to content

Partially Converged NLP Solution in CasADi #3589

Answered by jgillis
cdhainaut asked this question in Q&A
Discussion options

You must be logged in to vote

It sounds like you want to be introducing slack variables with an L1 penalty in the objective.

slack =opti.variable(n)
opti.subject_to(slack>=0)
for...
   opti.subject_to(-slack[i] <= (g[i] <= slack[i]))

opti.minimize(sum1(slacks))

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cdhainaut
Comment options

Answer selected by cdhainaut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants