Skip to content

pénalité quadratique#1

Open
nicolaspoly wants to merge 2 commits intodpo-mth8408:mainfrom
nicolaspoly:test-branch
Open

pénalité quadratique#1
nicolaspoly wants to merge 2 commits intodpo-mth8408:mainfrom
nicolaspoly:test-branch

Conversation

@nicolaspoly
Copy link

No description provided.

@github-actions
Copy link

Status:
Success--Here-is-the-PDF


# Fonction pénalisée : f(x) + (ρ/2) * ‖c(x)‖²
f_quad(x) = begin
c_tmp = similar(x, m)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu alloues un nouveau tableau à chaque évaluation de $\phi(x; \rho)$.

if nlp.meta.ncon > 0
gradf = grad(nlp, x)
J = jac(nlp, x)
y = - (J * J') \ (J * gradf)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'où provient cette mise à jour ? Tu n'utilises pas ce vecteur y de toute façon ...

# Mise à jour des résidus duals (gradient du Lagrangien)
gradf = grad(nlp, x)
J = jac(nlp, x)
normdual = norm(gradf + J' * y)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu ne mets jamais y à jour...

nvar,
ncon,
round(kkt_init, sigdigits=3),
round(r.primal_feas, sigdigits=3),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu ne fais afficher que le résidu primal ... tu oublies la réalisabilité duale. Elle ne doit pas être bonne puisque tu ne mets pas y à jour.

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.

2 participants