How to deal with discrete time system in GEKKO?

Viewed 271

I am dealing with a discrete time system with sampling time of 300s.

My question is that how to express the state equation or output eqatuin like

x(k+1)=A*x(k)+B*u(k)
y(k)=C*x(k)

where x(k) is the state and y(k) is the output. I have all the value of A, B, C matrix.

I found some information about discrete time system on webpage https://apmonitor.com/wiki/index.php/Apps/DiscreteStateSpace

I want to know whether there is another way to express state equation other than

x,y,u = m.state_space(A,B,C,D=None,discrete=True)
1 Answers

The discrete state space model is the preferred way to pose your model. You could also convert your equations to a discrete time series form or to a continuous state space form. These all are equivalent forms. Another way to write your model is to use IMODE=2 (algebraic equations) but this is much more complicated. Here is an example of MIMO identification where we estimate ARX parameters with IMODE=2. I recommend the m.state_space model and to use it with IMODE>=4.

Here is a pendulum state space model example.

pendulum state space

and a flight control state space model.

flight control

These both use continuous state space models but the methods are similar to what is needed for your application.

Related