Model predictive controllers rely on dynamic models of the process, most often linear empirical models obtained by system identification. APMonitor and GEKKO support continuous or discrete state space and autoregressive exogenous (ARX) input models. The delay function implements dead-time and is a simplified ARX model that includes a single input and output with a delay structure specified by the number of integer time steps.

  Usage: delay(u,y,steps=1)
u = delay input
y = delay output
steps = integer number of steps (default=1)
Description: Build a delay with number of time steps between
input (u) and output (y) with a time series model.


The following is an example of implementing a discrete time series model for an input delay of 60 seconds. The sample time for this model is 15 seconds with 4 steps of delay. The model is implemented in Gekko with the delay function. import numpy as np
from gekko import GEKKO
import matplotlib.pyplot as plt

# Create GEKKO model
m = GEKKO()

cv = m.Var()
mv = m.Param()

m.delay(mv,cv,4)

m.time = np.linspace(0,120,9)
mv.value = np.zeros(9)
mv.value[3:9] = 1
m.options.imode = 4
m.options.nodes = 2

m.solve() # (GUI=True)

# also create a Python plot
import matplotlib.pyplot as plt

plt.subplot(2,1,1)
plt.plot(m.time,mv.value,'r-',label=r'MV')
plt.legend()
plt.subplot(2,1,2)
plt.plot(m.time,cv.value,'b--',label=r'$CV$')
plt.legend()
plt.show()

Also see
{"ft_lang_label":"__label__en","ft_lang_prob":0.8739547,"math_prob":0.9975524,"size":887,"snap":"2022-05-2022-21","text_gpt3_token_len":188,"char_repetition_ratio":0.14722537,"word_repetition_ratio":0.0,"special_character_ratio":0.20293123,"punctuation_ratio":0.07453416,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9989753,"pos_list":[0,1,2],"im_url_duplicate_count":[null,9,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-26T18:03:03Z\",\"WARC-Record-ID\":\"<urn:uuid:4470cc66-6262-4ee7-b926-1971fa0346e7>\",\"Content-Length\":\"10902\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ec57cfca-d270-4c1e-b3f6-12a57f3a9b0a>\",\"WARC-Concurrent-To\":\"<urn:uuid:739647f8-bf3d-4114-be11-0cb303157187>\",\"WARC-IP-Address\":\"128.187.56.207\",\"WARC-Target-URI\":\"https://apmonitor.com/wiki/index.php/Apps/TimeDelay?action=print\",\"WARC-Payload-Digest\":\"sha1:T67T3P7QWKOQJJK6AMFRVZSUMIE4DFWK\",\"WARC-Block-Digest\":\"sha1:GQMHMSOC3DED2ARGCNK4CF6Y2WWV5LLR\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662619221.81_warc_CC-MAIN-20220526162749-20220526192749-00347.warc.gz\"}"}