DeePC

Controle Baseado em Dados

Prof. Dr. Raphael Teixeira

Universidade Federal do Pará

O que é DeePC?

Data-Enabled Predictive Control: controle preditivo formulado direto sobre uma trajetória de dados, sem identificar um modelo de estado da planta.

Motivação

  • Identificar um modelo é uma etapa separada, com custo e erro próprios;
  • O DeePC substitui o modelo por uma trajetória de dados persistentemente excitante, coletada uma única vez;
  • Identificação e controle viram uma única otimização.

Excitação Persistente

Seja \(w_d=(u_d,y_d)\) uma trajetória de comprimento \(T\) de um sistema LTI controlável de ordem \(n\). Sua matriz de Hankel de profundidade \(L\):

\[ H_L(w_d) = \begin{bmatrix} w_d(1) & \cdots & w_d(T-L+1) \\ \vdots & \ddots & \vdots \\ w_d(L) & \cdots & w_d(T) \end{bmatrix} \]

\(u_d\) é persistentemente excitante de ordem \(L\) se \(H_L(u_d)\) tem posto linha completo — na prática, um PRBS longo o suficiente basta.

Lema Fundamental de Willems

Se \(u_d\) é persistentemente excitante de ordem \(L+n\), toda trajetória \((u,y)\) de comprimento \(L\) é combinação linear das colunas de \(H_L(u_d), H_L(y_d)\): existe \(g\) tal que

\[ \begin{bmatrix} H_L(u_d) \\ H_L(y_d) \end{bmatrix} g = \begin{bmatrix} u \\ y \end{bmatrix} \]

(Willems et al., 2005).

A matriz de Hankel dos dados é um modelo implícito do sistema — a ponte entre a abordagem comportamental e o controle baseado em dados (Markovsky; Huang; Dörfler, 2023).

Formulação do DeePC

Particiona-se \(H_L(u_d), H_L(y_d)\) em blocos “passado” (\(T_{\text{ini}}\) linhas) e “futuro” (\(N\) linhas), \(L=T_{\text{ini}}+N\):

\[ \min_{g,\, u,\, y} \; \sum_{k=1}^{N} \|y_k - r_k\|_Q^2 + \|u_k\|_R^2 \quad \text{s.a.} \quad \begin{bmatrix} U_p \\ Y_p \\ U_f \\ Y_f \end{bmatrix} g = \begin{bmatrix} u_{\text{ini}} \\ y_{\text{ini}} \\ u \\ y \end{bmatrix} \]

\(U_p,Y_p\) fixam \(g\) ao passado recente (estimam o estado); \(U_f,Y_f\) predizem: \(y=Y_fg\), \(u=U_fg\) (Coulson; Lygeros; Dörfler, 2019a).

Horizonte Deslizante

  1. Atualiza-se \((u_{\text{ini}}, y_{\text{ini}})\) com as últimas medições;
  2. Resolve-se a otimização, obtendo \(u^\ast_{1:N}\);
  3. Aplica-se só \(u^\ast_1\) e repete-se.

Nota

\(T_{\text{ini}}\) precisa ser \(\geq\) à ordem do sistema, para fixar o estado inicial implícito.

Python — Dados

Sistema de 1ª ordem \(y_{k+1}=ay_k+bu_k\), usado só para gerar dados (o DeePC nunca vê \(a,b\)):

import numpy as np
rng = np.random.default_rng(0)
a, b = 0.8, 0.5

def simulate(u, y0=0.0):
    y = [y0]
    for uk in u: y.append(a*y[-1] + b*uk)
    return np.array(y[1:])

u_d = rng.choice([-1.0, 1.0], size=200)  # PRBS
y_d = simulate(u_d)

Python — Matrizes de Hankel

def hankel(x, L):
    T = len(x) - L + 1
    return np.array([x[i:i+T] for i in range(L)])

Tini, N = 2, 10
Hu, Hy = hankel(u_d, Tini+N), hankel(y_d, Tini+N)
Up, Uf = Hu[:Tini], Hu[Tini:]
Yp, Yf = Hy[:Tini], Hy[Tini:]

Up/Yp: passado (\(T_{\text{ini}}\) amostras); Uf/Yf: futuro (\(N\) amostras).

Python — Resolver e Predizer

Nova condição inicial e um degrau futuro — a partir daqui, a, b não são usados:

u_ini = rng.choice([-1.0, 1.0], size=Tini)
y_ini = simulate(u_ini)
u_fut = np.ones(N)

A = np.vstack([Up, Yp, Uf])
r = np.concatenate([u_ini, y_ini, u_fut])
g, *_ = np.linalg.lstsq(A, r, rcond=None)
y_pred = Yf @ g
y_true = simulate(u_fut, y0=y_ini[-1])

Python — Resultado

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
_ = ax.plot(y_true, "o-", label="planta real")
_ = ax.plot(y_pred, "x--", label="predição DeePC")
_ = ax.legend()
plt.tight_layout(); plt.show()

Interpretação

As curvas coincidem: o Lema Fundamental garante que Yf @ g reproduz a planta exatamente, sem nunca estimar \(a\) e \(b\).

Regularização

Com ruído, \(g\) fica mal-condicionado. Solução: penalidades (Coulson; Lygeros; Dörfler, 2019b)

\[ \min_{g,\, u,\, y} \; \sum_{k=1}^{N} \|y_k - r_k\|_Q^2 + \|u_k\|_R^2 \;+\; \lambda_g \|g\|_2^2 \;+\; \lambda_y \|\sigma_y\|_1 \]

  • \(\lambda_g\|g\|_2^2\): regulariza \(g\) (Tikhonov);
  • \(\sigma_y\): absorve ruído em \((u_{\text{ini}},y_{\text{ini}})\);
  • Validado em conversores de potência (Huang et al., 2021a).

Garantias Teóricas

DeePC vs. MPC Clássico

MPC clássico DeePC
Modelo Sim, \((A,B,C,D)\) Não
Identificação Separada Embutida na otimização
Ruído Modelo já filtra Exige regularização
Garantias Maduras Em consolidação (Li et al., 2025)

Aplicações

Referências

BERBERICH, Julian et al. Data-Driven Model Predictive Control with Stability and Robustness Guarantees. IEEE Transactions on Automatic Control, v. 66, n. 4, p. 1702–1717, 2021.
COULSON, Jeremy; LYGEROS, John; DÖRFLER, Florian. Data-Enabled Predictive Control: In the Shallows of the DeePC. In: IEEE, a2019.
COULSON, Jeremy; LYGEROS, John; DÖRFLER, Florian. Regularized and Distributionally Robust Data-Enabled Predictive Control. In: IEEE, b2019.
DÖRFLER, Florian; COULSON, Jeremy; MARKOVSKY, Ivan. Bridging Direct and Indirect Data-Driven Control Formulations via Regularizations and Relaxations. IEEE Transactions on Automatic Control, v. 68, n. 2, p. 883–897, 2023.
FIEDLER, Felix; LUCIA, Sergio. On the Relationship between Data-Enabled Predictive Control and Subspace Predictive Control. In: IEEE, 2021.
HUANG, Linbin et al. Data-Enabled Predictive Control for Grid-Connected Power Converters. In: IEEE, 2019. Disponível em: <https://arxiv.org/abs/1903.07339>
HUANG, Linbin et al. Quadratic Regularization of Data-Enabled Predictive Control: Theory and Application to Power Converter Experiments. IFAC-PapersOnLine, v. 54, n. 7, p. 192–197, a2021.
HUANG, Linbin et al. Decentralized Data-Enabled Predictive Control for Power System Oscillation Damping. IEEE Transactions on Control Systems Technology, v. 30, n. 3, p. 1065–1077, b2021.
LAZAR, Mircea. Neural Data-Enabled Predictive Control. arXiv preprint arXiv:2406.08003, 2024.
LI, Xiaojie et al. Efficient Data-Driven Predictive Control of Nonlinear Systems: A Review and Perspectives. Digital Chemical Engineering, v. 14, p. 100219, 2025.
MARKOVSKY, Ivan; HUANG, Linbin; DÖRFLER, Florian. Data-Driven Control Based on the Behavioral Approach: From Theory to Applications in Power Systems. IEEE Control Systems Magazine, v. 43, n. 5, p. 28–68, 2023.
WILLEMS, Jan C. et al. A Note on Persistency of Excitation. Systems & Control Letters, v. 54, n. 4, p. 325–329, 2005.

Encerramento

Prof. Dr. Raphael Teixeira

Universidade Federal do Pará

raphaelbt@ufpa.br