From 640c7f642ccd859d9c801f6d85d17f37906b58ae Mon Sep 17 00:00:00 2001 From: Warisa Date: Tue, 9 Jul 2024 20:02:04 +0200 Subject: [PATCH] move comment regarding seed upwards --- ext/TrixiNLsolveExt.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ext/TrixiNLsolveExt.jl b/ext/TrixiNLsolveExt.jl index 571eb1377eb..74f3e442da0 100644 --- a/ext/TrixiNLsolveExt.jl +++ b/ext/TrixiNLsolveExt.jl @@ -40,13 +40,14 @@ function Trixi.solve_a_unknown!(a_unknown, num_stages, monomial_coeffs, c_s2, c; c_s2) end + # To ensure consistency and reproducibility of results across runs, we use + # a seeded random initial guess. seed!(5555) for _ in 1:max_iter # Due to the nature of the nonlinear solver, different initial guesses can lead to # small numerical differences in the solution. - # To ensure consistency and reproducibility of results across runs, we use - # a seeded random initial guess. + x0 = 0.1 .* rand(num_stages - 2) sol = nlsolve(objective_function, x0, method = :trust_region,