LMIs in Control/KYP Lemmas/KYP lemma for continous time QSR dissipative system

The System
Consider a contiuous-time LTI system, $$\mathcal{G} : \mathcal{L}_{2e} \rightarrow \mathcal{L}_{2e}$$, with minimal state-space realization (A, B, C, D), where $$\mathcal{A} \in \mathcal{R}^{n\times n}, \mathcal{B} \in \mathcal{R}^{n\times m}, \mathcal{C} \in \mathcal{R}^{p\times n},$$ and $$\mathcal{D} \in \mathcal{R}^{p\times m} $$.



\begin{align} \dot x(t)&=Ax(t)+Bu(t),\\ y(t)&=Cx(t)+Du(t)\\ \end{align}$$

The Data
The matrices $$ A,B,C $$ and $$D $$

The Optimization Problem
The system $$\mathcal{G}$$ is QSR disipative if


 * $$\int_0^T (y^T(t)Qy(t) + 2y^TSu(t) + u^T(t)Ru(t))\,dt \ge 0, \forall u \in \mathcal{L}_{2e}, \forall T \ge 0 $$

where $$u(t)$$ is the input to $$\mathcal{G}, y(t)$$ is the output of $$\mathcal{G}, Q \in \mathcal{S}^{p}, S \in \mathcal{R}^{p\times m},$$ and $$\mathcal{R} \in \mathcal{S}^{m}$$.

LMI : KYP Lemma for QSR Dissipative Systems
The system $$\mathcal{G}$$ is also QSR dissipative if and only if there exists $$ P \in \mathcal{S}^{n},$$ where $$ P > 0,$$ such that


 * $$\begin{bmatrix}

PA + A^{T}P - C^{T}QC & PB - C^{T}S - C^{T}QD \\ (PB - C^{T}S - C^{T}QD)^{T} &  -D^{T}QD - (D^{T}S + S^{T}D) - R \end{bmatrix}\le 0.$$

Conclusion:
If there exist a positive definite $$P$$ for the the selected Q,S and R matrices then the system $$\mathcal{G}$$ is QSR dissipative.

Implementation
Code for implementation of this LMI using MATLAB. https://github.com/VJanand25/LMI