Skip to content

Commit 4fb36eb

Browse files
add timeseries calculation fallback when no interp and t's line up
1 parent 59f6893 commit 4fb36eb

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test_solution.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ function appxtrue(sol::AbstractODESolution,sol2::TestSolution)
5151
end
5252
else
5353
timeseries_analytic = sol2.u
54+
if sol.t == sol2.t
55+
errors[:l∞] = maximum(vecvecapply((x)->abs.(x),sol-timeseries_analytic))
56+
errors[:l2] = sqrt(recursive_mean(vecvecapply((x)->float(x).^2,sol-timeseries_analytic)))
57+
end
5458
end
5559
build_solution(sol,timeseries_analytic,errors)
5660
end
@@ -82,6 +86,12 @@ function appxtrue(sol::AbstractODESolution,sol2::AbstractODESolution;timeseries_
8286
:L2=>sqrt(recursive_mean(vecvecapply((x)->float(x).^2,interp_u-interp_analytic))))
8387
errors = merge(errors,interp_errors)
8488
end
89+
else
90+
timeseries_analytic = sol2.u
91+
if sol.t == sol2.t
92+
errors[:l∞] = maximum(vecvecapply((x)->abs.(x),sol-timeseries_analytic))
93+
errors[:l2] = sqrt(recursive_mean(vecvecapply((x)->float(x).^2,sol-timeseries_analytic)))
94+
end
8595
end
8696
build_solution(sol,timeseries_analytic,errors)
8797
end

0 commit comments

Comments
 (0)