Skip to content

Commit

Permalink
Merge pull request #733 from SciML/ChrisRackauckas-patch-2
Browse files Browse the repository at this point in the history
Fix some depwarns
  • Loading branch information
ChrisRackauckas committed Jul 18, 2024
2 parents 63cbc97 + e35f40a commit f76fb4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- {user: SciML, repo: DelayDiffEq.jl, group: Integrators}
- {user: SciML, repo: DelayDiffEq.jl, group: Regression}
- {user: SciML, repo: DiffEqBase.jl, group: Core}
- {user: SciML, repo: DiffEqDevTools.jl, group: Core}
- {user: SciML, repo: DiffEqBase.jl, group: Downstream}
- {user: SciML, repo: DiffEqBase.jl, group: Downstream2}
- {user: SciML, repo: DiffEqFlux.jl, group: DiffEqFlux}
Expand Down
8 changes: 4 additions & 4 deletions src/ensemble/ensemble_solutions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ function calculate_ensemble_errors(u; elapsedTime = 0.0, converged = false,
# Now Calculate Weak Errors
weak_errors = Dict{Symbol, eltype(u[1].u[1])}()
# Final
m_final = mean([s[end] for s in u])
m_final = mean([s.u[end] for s in u])
m_final_analytic = mean([s.u_analytic[end] for s in u])
res = norm(m_final - m_final_analytic)
weak_errors[:weak_final] = res
if weak_timeseries_errors
ts_weak_errors = [mean([u[j][i] - u[j].u_analytic[i] for j in 1:length(u)])
ts_weak_errors = [mean([u.u[j][i] - u[j].u_analytic[i] for j in 1:length(u)])
for i in 1:length(u[1])]
ts_l2_errors = [sqrt.(sum(abs2, err) / length(err)) for err in ts_weak_errors]
l2_tmp = sqrt(sum(abs2, ts_l2_errors) / length(ts_l2_errors))
Expand All @@ -111,11 +111,11 @@ function calculate_ensemble_errors(u; elapsedTime = 0.0, converged = false,
weak_errors[:weak_l∞] = max_tmp
end
if weak_dense_errors
densetimes = collect(range(u[1].t[1], stop = u[1].t[end], length = 100))
densetimes = collect(range(u.u[1].t[1], stop = u[1].t[end], length = 100))
u_analytic = [[sol.prob.f.analytic(sol.prob.u0, sol.prob.p, densetimes[i],
sol.W(densetimes[i])[1])
for i in eachindex(densetimes)] for sol in u]
udense = [u[j](densetimes) for j in 1:length(u)]
udense = [u.u[j](densetimes) for j in 1:length(u)]
dense_weak_errors = [mean([udense[j][i] - u_analytic[j][i] for j in 1:length(u)])
for i in eachindex(densetimes)]
dense_L2_errors = [sqrt.(sum(abs2, err) / length(err)) for err in dense_weak_errors]
Expand Down

0 comments on commit f76fb4a

Please sign in to comment.