Skip to main content
. 2020 Apr 17;11:328. doi: 10.3389/fphys.2020.00328

Algorithm 1.

Heuristic approach

1:  Set initial value X0             ⊳ (Initialization)
2:  for iI\{0} do
3:     Xi=Xi-1+F(Xi-1,fPV,Δt)             ⊳ (Integration)
4:     if Xi, 3>X3,up: then             ⊳ (Check for violation)
5:        if iT: then             ⊳ (Treatment if allowed)
6:           Xi,3=Xi,3-VmaxVpat·Xi,3
7:        else             ⊳ (Shift treatment)
8:           Find largest i*T with i*+idwell<i and
9:           Set i = i*
10:           Xi,3=Xi,3-VmaxVpat·Xi,3