Skip to content

version finale - #4

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

dawutesse1 wants to merge 3 commits into
dpo-mth8408:mainfrom
dawutesse1:test

Conversation

@dawutesse1

Copy link
Copy Markdown

No description provided.

@github-actions

Copy link
Copy Markdown

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

Comment thread rapport.qmd
Pkg.activate("labo3_env")
Pkg.add("LDLFactorizations")
Pkg.add("Metis")
Pkg.add("AMD")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tu n'utilises pas Metis, ni AMD...

Comment thread rapport.qmd
using LinearAlgebra
using Printf
using NLPModels
using ADNLPModels

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

déjà importés ...

Comment thread rapport.qmd
g = grad(model, x)
gnorm = norm(g, Inf)
println(@sprintf("%4d | %12.4e | %12.4e | - ", k, fval, gnorm))
if gnorm < max(eps_a, eps_r*norm(x,Inf))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pourquoi utiliser $\Vert x \Vert$ ici ?

Comment thread rapport.qmd

# 3) direction inexacte via CG de Krylov.jl
Hop = hess_op(model, x)
tol_cg = min(0.5, sqrt(gnorm)) * gnorm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread rapport.qmd
tol_cg = min(0.5, sqrt(gnorm)) * gnorm
# cg de Krylov : tol, maxiter, linesearch
p, history = Krylov.cg(Hop, -g;
atol = tol_cg,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tu peux mettre atol = 0.

Comment thread rapport.qmd
end

x .+= α*p
println(@sprintf("%4d | %12.4e | %12.4e | %8.4e", k, fval, gnorm, α))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tu affiches deux lignes par itération.

Comment thread rapport.qmd
itmax = n,
linesearch = true)

# 4) recherche linéaire Armijo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mettre Armijo dans une fonction.

Comment thread rapport.qmd
model = ADNLPModel(pb) # wrapping ADNLPModels
println("\n=== Problème : ", nom, " ===")
x_star = newton_modifiee(model)
println("Solution trouvée : ", x_star)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fval et ||g|| ne changent jamais... que se passe-t-il ?

Comment thread rapport.qmd

# 4) recherche linéaire Armijo
α = 1.0; ρ = 0.5; c = 1e-4
while obj(model, x + α*p) > fval + c * α * dot(g, p)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tu recalcules dot(g, p) à chaque passage ...

Comment thread rapport.qmd

À nouveau, chaque pas de Newton complet (α=1) suffit.

Newton inexacte converge en 6 itérations également :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

??? Elle prend 100 itérations et ne semble pas changer x une seule fois.

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