Loading...
Searching...
No Matches
Steady_State

Provides methods for detecting steady-state conditions based on t-test.

Examples

The following example demonstrates some of the methods found in the benchmark_steady_state module.

use benchmark_steady_state, only: ssd
use benchmark_workflow, only: workflow
use benchmark_options
use benchmark_method
use benchmark_timer, only: clock
use benchmark_statistics, only: stats
use benchmark_warning, only: display_maxcall_warning
use benchmark_string
use benchmark_kinds
use benchmark_output_unit
class(benchmark_run), intent(inout) :: step
!private
integer :: k
real(r8) :: start, finish
type(stats) :: s
real(r8), allocatable :: times(:)
real(r8) :: treshold
maxcall_reached = .false.
treshold = step%options%ssd_threshold
if (first_call) write (output_unit, '(A)') new_line('A'), step%header, new_line('A')
step%options%count = step%options%count + 1
allocate(times(step%options%sampling_window), source=0.0_r8)
block
integer :: icount, jcount, count
real(r8) :: crit, t
crit = 0.0_r8; icount = 0; jcount = 0; count = 0
call clock(start)
do while (crit <= (1.0_r8 - treshold))
call step%method%invoke(); call clock(finish)
t = finish - start
icount = icount + 1
if (t > step%options%mintime) then
times(1 + modulo(jcount, step%options%sampling_window)) = &
t / real(icount, r8)
jcount = jcount + 1
if (jcount >= step%options%sampling_window) crit = &
ssd(times, modulo(jcount, step%options%sampling_window), &
treshold)
icount = 0
call clock(start)
end if
count = count + 1
if (count >= step%options%maxcalls) then
maxcall_reached = .true.
exit
end if
end do
end block
call s%compute(times)
if (step%options%csv_unit /= 0) then
call summary(step, s, step%options%csv_unit)
else
call summary(step, s)
end if
deallocate(times)
nullify(step%method)
nullify(step%options)

Remarks

The steady-state detection algorithm is based on the work by J. D. Kelly and J. D. Hedengren, “A steady-state detection (SSD) algorithm to detect non-stationary drifts in processes,” J. Process Control, vol. 23, no. 3, pp. 326–331, 2013. The original algorithm has been altered to be used with dynamic real-time data.