Skip to content

Commit

Permalink
move comment regarding seed upwards
Browse files Browse the repository at this point in the history
  • Loading branch information
warisa-r committed Jul 9, 2024
1 parent 995107b commit 640c7f6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/TrixiNLsolveExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 640c7f6

Please sign in to comment.