Skip to content

Commit

Permalink
hardcode NLsolve parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
FHoltorf committed Sep 26, 2023
1 parent 0190764 commit 5f298e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ function trust_region_step!(cache::TrustRegionCache)
end

# trust region update
if r < cache.shrink_threshold # default 1 // 10
cache.trust_r *= cache.shrink_factor # default 1 // 2
elseif r >= cache.expand_threshold # default 9 // 10
cache.trust_r = cache.expand_factor * norm(cache.du) # default 2
elseif r >= cache.p1 # default 1 // 2
cache.trust_r = max(cache.trust_r, cache.expand_factor * norm(cache.du))
if r < 1//10 # cache.shrink_threshold
cache.trust_r *= 1//2 # cache.shrink_factor
elseif r >= 9//10 # cache.expand_threshold
cache.trust_r = 2 * norm(cache.du) # cache.expand_factor * norm(cache.du)
elseif r >= 1//2 # cache.p1
cache.trust_r = max(cache.trust_r, 2*norm(cache.du)) # cache.expand_factor * norm(cache.du))
end

# convergence test
Expand Down

0 comments on commit 5f298e3

Please sign in to comment.