@@ -285,6 +285,7 @@ function WorkPrecision(prob::AbstractBVProblem, alg, abstols, reltols, dts = not
285
285
N = length (abstols)
286
286
errors = Vector {Float64} (undef, N)
287
287
times = Vector {Float64} (undef, N)
288
+ stats = Vector {Any} (undef, N)
288
289
if name === nothing
289
290
name = " WP-Alg"
290
291
end
@@ -312,6 +313,8 @@ function WorkPrecision(prob::AbstractBVProblem, alg, abstols, reltols, dts = not
312
313
dense_errors = dense_errors)
313
314
end
314
315
316
+ stats[i] = sol. stats
317
+
315
318
if haskey (kwargs, :prob_choice )
316
319
cur_appxsol = appxsol[kwargs[:prob_choice ]]
317
320
elseif prob isa AbstractArray
@@ -372,14 +375,15 @@ function WorkPrecision(prob::AbstractBVProblem, alg, abstols, reltols, dts = not
372
375
end
373
376
end
374
377
end
375
- return WorkPrecision (prob, abstols, reltols, errors, times, name, N)
378
+ return WorkPrecision (prob, abstols, reltols, errors, times, dts, stats, name, N)
376
379
end
377
380
378
381
# Work precision information for a nonlinear problem.
379
382
function WorkPrecision (prob:: NonlinearProblem , alg, abstols, reltols, dts = nothing ; name = nothing , appxsol = nothing , error_estimate = :l2 , numruns = 20 , seconds = 2 , kwargs... )
380
383
N = length (abstols)
381
384
errors = Vector {Float64} (undef, N)
382
385
times = Vector {Float64} (undef, N)
386
+ stats = Vector {Any} (undef, N)
383
387
if name === nothing
384
388
name = " WP-Alg"
385
389
end
@@ -396,9 +400,11 @@ function WorkPrecision(prob::NonlinearProblem, alg, abstols, reltols, dts = noth
396
400
for i in 1 : N
397
401
sol = solve (_prob, alg; kwargs... , abstol = abstols[i], reltol = reltols[i])
398
402
403
+ stats[i] = sol. stats
404
+
399
405
if error_estimate == :l2
400
406
if isnothing (appxsol)
401
- errors[i] = sqrt (sum (abs2, sol. resid))
407
+ errors[i] = sqrt (sum (abs2, sol. resid))
402
408
else
403
409
errors[i] = sqrt (sum (abs2, sol .- appxsol))
404
410
end
@@ -424,7 +430,7 @@ function WorkPrecision(prob::NonlinearProblem, alg, abstols, reltols, dts = noth
424
430
end
425
431
end
426
432
end
427
- return WorkPrecision (prob, abstols, reltols, errors, times, name, N)
433
+ return WorkPrecision (prob, abstols, reltols, errors, times, dts, stats, name, N)
428
434
end
429
435
430
436
function WorkPrecisionSet (prob,
0 commit comments