View full-text article in PMC Sensors (Basel). 2019 May 16;19(10):2276. doi: 10.3390/s19102276 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2019 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 4. Multiple shooting MHE gradient calculation Define: R*=(R⋅R)−1; Q*=(Q⋅Q)−1; E=eye(n) Define: i1(i):= 1+(i−k+M)n:(i−k+M+1)n ∇g1:n=(Ik−M++(Ik−M+)T)(xk−M−x^k−M+) −2∂h(xk−M)∂xk−MTR*(yk−Mm−h(xk−M)) fori=k−M+1 to k do ∇gi1(i)=∂g(ξk)∂xi=2Q*(xi−xint,i)−2∂h(xi)T∂xiR*(yim−h(xi)) if version == V3 then ∇gi1(i)−=(12⋅Ts⋅∂fi∂xi)T⋅2⋅QMS⋅(xi−xint,iL) end if end for Define: j1(j):=1+(j−k+M)n:(j−k+M+1)n forj=k−M to k−1 do ∇gj1(j)+=∂g(ξk)∂xj switch(version) case V1: ∇gj1(j)+=−∂fj∂xj⋅2⋅QMS⋅(xj+1−xint,j+1L) case V2: ∇gj1(j)+=−(12⋅Ts⋅∂fj∂xj)T⋅2⋅QMS⋅(xj+1−xint,j+1L) case V3: ∇gj1(j)−=(E+12⋅Ts⋅∂fj∂xj)T⋅2⋅QMS⋅(xj+1−xint,j+1L) end switch end for