Skip to main content
. 2021 Oct 14;21(20):6845. doi: 10.3390/s21206845
Algorithm 1 The Pseudo Code of VST-MPC.
Step 1: Set the initial sampling time TS=0.2
Step 2: Set the MPC parameter and calculate the optimal input with MPC
Step 3: Predict Xa(K+1)=Aa·Xa(K)+Ba·u(K)
Step 4: Update Xpast = Xa (K + 1), upast = u(K)
Step 5: Calculate the next sampling time using the following equation.
TS(K+1)=TS(K)+sign(ZC)·min(Z, C)
where Z=λ·|TS(δ(K)··Vy(K)TS(K))|, C=0.01
Step 6: Set TS = TS(K+1)
Step 7: If     Ts > TS,maximum
TS = TS,maximum
else if   TS < TS,minimum
TS = TS,minimum
end
Step 8: Go to Step 2 until MPC iteration is over.