About cv_wgt_start for CVs with quite different delays

Viewed 42

We are trying to control tclab with man made big delay. We followed suggestions in url. The
cv_wgt_start worked very well. See pic. I set CV_wgt_delay as double relay time(fopdt).

But my question is as cv_mgt_start is the global option, how can we deal with two CVS with quite different delays?

1 Answers

One option to have a different delay is to define a custom objective function with a parameter p that is a step function where the penalty starts. In this example, there are 10 time steps in the control / prediction horizon. The penalty (5) starts at step 7 for T1 and step 3 for T2.

from gekko import gekko
import numpy as np

p1 = np.zeros(11)
p1[6:] = 5
p1 = m.Param(p1)

p2 = np.zeros(11)
p2[2:] = 5
p2 = m.Param(p2)

m.Minimize(p1*(T1-55)**2)
m.Minimize(p2*(T2-35)**2)

Another option is to use m.CV_TYPE=3 as a derivative form of the reference trajectory. This is especially suited for systems with time delay.

Related