Skip to content

tp complété#3

Open
dawutesse1 wants to merge 3 commits intodpo-mth8408:mainfrom
dawutesse1:test
Open

tp complété#3
dawutesse1 wants to merge 3 commits intodpo-mth8408:mainfrom
dawutesse1:test

Conversation

@dawutesse1
Copy link

No description provided.

@dpo dpo closed this Aug 17, 2025
@dpo dpo reopened this Aug 17, 2025
@github-actions
Copy link

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

f(x) + 0.5*ρ*‖c(x)‖², avec gradient et opérateur hessien augmentés.
"""
function quad_penalty_adnlp(nlp::ADNLPModel, ρ::Real)
pure_c(x) = (out = Vector{eltype(x)}(undef, nlp.meta.ncon);
Copy link
Contributor

Choose a reason for hiding this comment

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

appelle cons(nlp, x).

# Objectif pénalisé
fquad(x) = obj(nlp, x) + 0.5 * ρ * norm(pure_c(x))^2
# Gradient pénalisé
gradquad(x) = grad(nlp, x) + ρ * (pure_jac(x)' * pure_c(x))
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu évalues les contraintes deux fois.

gradquad(x) = grad(nlp, x) + ρ * (pure_jac(x)' * pure_c(x))

# Opérateur Hessien (matrix‑free)
function hessopquad(x)
Copy link
Contributor

Choose a reason for hiding this comment

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

Tu aurais pu écrire Hop + Jop' * Jop avec Jop = jac_op(nlp, x).

v -> Hop*v + ρ * (J' * (J*v)),
v -> Hop'*v + ρ * (J' * (J*v)))
end
# Hessien dense pour Newton modifiée (application de l'opérateur)
Copy link
Contributor

Choose a reason for hiding this comment

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

??? Newton modifiée n'a pas besoin d'une matrice dense, mais creuse.

statut = string(stats.status)
))
end
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Ton rapport fait 538 pages ...

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