OpenLLM-France/wikimedia huggingface dataset:
# LMIs in Control/pages/Discrete Time Stabilizability

Discrete-Time Stabilizability
A discrete time system operates on a discrete time signal input and produces a discrete time signal output. They are used in digital signal processing, such as digital filters for images or sound. The class of discrete time systems that are both linear and time invariant, known as discrete time LTI systems.
Discrete-Time LTI systems can be made stable using controller gain K, which can be found using LMI optimization, such that the close loop system is stable.

## The System

Discrete-Time LTI System with state space realization $(A_{d},B_{d},C_{d},D_{d})$ ${\begin{aligned}&A_{d}\in {\bf {{R^{n*n}},}}&B_{d}\in {\bf {{R^{n*m}},}}&C_{d}\in {\bf {{R^{p*n}},}}&D_{d}\in {\bf {{R^{p*m}}\;}}\\\end{aligned}}$

## The Data

The matrices: System $(A_{d},B_{d},C_{d},D_{d}),P,W$.

## The Optimization Problem

The following feasibility problem should be optimized:
Maximize P while obeying the LMI constraints. Then K is found.

## The LMI:

Discrete-Time Stabilizability
The LMI formulation
${\begin{aligned}P\in {S^{n}};W\in {R^{m*n}}\;\\&P>0\\{\begin{bmatrix}P&A_{d}P+B_{d}W\\*&P\end{bmatrix}}&>0,\\K_{d}=WP^{-1}\end{aligned}}$

## Conclusion:

The system is stabilizable iff there exits a $P$, such that $P>0$. The matrix $A_{d}+B_{d}K_{d}$ is Schur with $K_{d}=WP^{-1}$

## Implementation

A link to CodeOcean or other online implementation of the LMI MATLAB Code

## Related LMIs

- Continuous Time Stabilizability

## External Links

A list of references documenting and validating the LMI.
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# LMIs in Control/pages/Dissipativity of Systems

Dissipativity of Systems
The dissipativity of systems is associated with their supply function. In general, a linear system is dissipative if the accumulated sum (integration) of the supply function is non-negative over all the duration of $T\geq 0$.

## The System

A state-space representation of a linear system as given below:
    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+Bu(t)\\y(t)&=Cx(t)+Du(t)\end{aligned}}$
where $x(t)\in \mathbb {R} ^{n}$, $y(t)\in \mathbb {R} ^{m}$ and $u(t)\in \mathbb {R} ^{r}$ are the system state, output, and the input vector respectively. A, B, C and D are system coefficient matrices of appropriate dimensions. The control input u is restricted to be a piece-wise continuous vector function defined of $[0,\infty )$.
The transfer function of such a system can be evaluated as:
    ${\begin{aligned}G(s)=C(sI-A)^{-1}B+D\end{aligned}}$
For such a system, a general quadratic supply function is defined as:
       ${\begin{aligned}s(u,y)&={\begin{bmatrix}y&u\end{bmatrix}}Q{\begin{bmatrix}y\\u\end{bmatrix}}\end{aligned}}$
where Q is a real symmetric matrix of (m+r) dimensions. Q need not be either symmetric positive or negative definite.

## The Data

Number of states n, number of outputs m and number of control inputs r need to be known. Moreover, the system matrices A,B,C,D are also required to be known. The system should also be controllable.

## The Feasibility LMI

The system $G(s)$ defined can be evaluated to be dissipative with respect to a supply function $s(u,y)$ iff there exist $P\geq 0$ and a $Q$ (defining $s(u,y)$) such that the following is feasible:
       ${\begin{aligned}{\text{Find}}\;&P,Q:\\&P\geq 0\\{\begin{bmatrix}A^{\top }P+PA&PB\\B^{\top }P&0\end{bmatrix}}&-{\begin{bmatrix}C&D\\0&I\end{bmatrix}}^{\top }Q{\begin{bmatrix}C&D\\0&I\end{bmatrix}}\leq 0.\end{aligned}}$

## Conclusion:

If there is a feasible solution to the aforementioned LMI, then there exists a supply function $s(u,y)$ for which the system $G(s)$ is dissipative. Since the assumption of the system being controllable is required for it to be dissipative, this check can be used of as a sufficient condition to check the controllability of the linear system, just like the feasibility for Lyapunov stability.

## Implementation

To solve the feasibility LMI, YALMIP toolbox is required for setting up the feasibility problem, and SeDuMi is required to solve the problem. The following link showcases an example of the feasibility problem:
https://github.com/smhassaan/LMI-Examples/blob/master/Dissipativity_example.m

## Related LMIs

Continuous_Time_Lyapunov_Inequality

## External Links

A list of references documenting and validating the LMI.
* LMIs in Control Systems: Analysis, Design and Applications - by Guang-Ren Duan and Hai-Hua Yu, CRC Press, Taylor & amp; Francis Group, 2013, Section 6.3 pp. 178–184.
# LMIs in Control/pages/Discrete Time Mixed H2-H∞ Optimal Full State Feedback Control

Discrete-Time Mixed H2-H∞-Optimal Full-State Feedback Control
A discrete time system operates on a discrete time signal input and produces a discrete time signal output. They are used in digital signal processing, such as digital filters for images or sound. The class of discrete time systems that are both linear and time invariant, known as discrete time LTI systems.
A full-state feedback controller $K=K_{d}\in {R^{n_{u}*n_{x}}}$ (i.e., $uk=K_{d}x_{k}$) is to be designed to minimize the H2 norm of the closed loop transfer matrix $T11(z)$ from the exogenous input $w_{1,k}$ to the performance output $z_{1,k}$ while ensuring the H∞ norm of the closed-loop transfer matrix $T22(z)$ from the exogenous input $w_{2,k}$ to the performance output $z_{2,k}$ is less than $\gamma _{d}$.

## The System

Discrete-Time LTI System with state space realization
${\begin{aligned}x_{k+1}&=A_{d}x_{k}+B_{d1,1}w_{1,k}+B_{d1,2}w_{2,k}+B_{d2}u_{k},\\{\begin{bmatrix}Z_{1,k}\\Z_{2,k}\end{bmatrix}}&={\begin{bmatrix}C_{d1,1}\\C_{d1,2}\end{bmatrix}}x_{k}+{\begin{bmatrix}0&D_{d11,12}\\D_{d11,21}&D_{d11,22}\end{bmatrix}}{\begin{bmatrix}w_{1,k}\\w_{2,k}\end{bmatrix}}+{\begin{bmatrix}D_{d12,1}\\D_{d12,2}\end{bmatrix}}u_{k}\\y_{k}&=x_{k}\\\end{aligned}}$

## The Data

The matrices: System $(A_{d},B_{d1,1},B_{d1,2},B_{d2},C_{d1,1},C_{d1,2},D_{d11,12},D_{d11,21},D_{d11,22},,D_{d12,1},D_{d12,2}),P,F_{d}$.

## The Optimization Problem

The following feasibility problem should be optimized:
Minimize the H2 norm of the closed loop transfer matrix $T11(z)$, while ensuring the H∞ norm of the closed-loop transfer matrix $T22(z)$ is less than $\gamma _{d}$, while obeying the LMI constraints.

## The LMI:

Discrete-Time Mixed H2-H∞-Optimal Full-State Feedback Controller is synthesized by solving for $P\in S^{n_{x}},Z\in S^{n_{w}},F_{d}\in R^{n_{u}*n_{x}}$, and $\mu \in R_{>0}$ that minimize $\mu$ subject to $P>0,Z>0$
The LMI formulation
H∞ norm < $\gamma _{d}$
H2 norm < $\mu$
${\begin{aligned}{\begin{bmatrix}P&A_{d}P-B_{d2}F_{d}&B_{d1,1}\\*&P&0\\*&*&1\end{bmatrix}}&>0\\{\begin{bmatrix}P&A_{d}P-B_{d2}F_{d}&B_{d1,2}&0\\*&P&0&PC_{d1,2}^{T}-F_{d}^{T}D_{d12,2}^{T}\\*&*&\gamma _{d}I&D_{d11,22}^{T}\\*&*&*&\gamma _{d}I\end{bmatrix}}&>0\\{\begin{bmatrix}Z&C_{d1,1}P-D_{d12,1}\\*&P\end{bmatrix}}&>0\\trace(Z)&<\mu ^{2}\end{aligned}}$

## Conclusion:

The H2-optimal full-state feedback controller gain is recovered by $K_{d}=F_{d}P^{-1}$

## Implementation

A link to CodeOcean or other online implementation of the LMI MATLAB Code

## Related LMIs

- Continuous Time Mixed H2-H∞ Optimal Full State Feedback Control

## External Links

A list of references documenting and validating the LMI.
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# LMIs in Control/pages/Entropy Bound for Affine Parametric Varying Systems
## The System

    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+B_{w}w(t),\\z(t)&=C_{z}(\theta )x(t)+D_{zw}(\theta )w(t),\end{aligned}}$
where $C_{z}$ and $D_{zw}$ depend affinely on parameter $\theta \in \mathbb {R} ^{p}$.

## The Data

The matrices $A,B_{w},C_{z}(.),D_{zw}(.)$.

## The Optimization Problem:

Solve the following semi-definite program
       ${\begin{aligned}&\min _{\{P\succ 0,\gamma ^{2},\lambda ,\theta \}}\gamma ^{2}\\&\quad s.t.\quad D_{zw}(\theta )=0,{\begin{bmatrix}A^{\top }P+PA&PB_{w}&C_{z}(\theta )^{\top }\\B_{w}^{\top }P&-\gamma ^{2}I&0\\C_{z}(\theta )&0&-I\end{bmatrix}}\preceq 0,\quad {\rm {{Tr}(B_{w}^{\top }PB_{w})\leq \lambda .}}\end{aligned}}$

## Implementation

https://github.com/mkhajenejad/Mohammad-Khajenejad/commit/02f31a2d7a22b2464dfe9212eb76409bda9439b1

## Conclusion

The value function of the above semi-definite program returns a bound for $\gamma$-entropy of the system, which is defined as
       ${\begin{aligned}I_{\gamma }(H_{\theta })\triangleq {\begin{cases}{\frac {-\gamma ^{2}}{2\pi }}\int _{-\infty }^{\infty }\log \det(I-\gamma ^{2}H_{\theta }(i\omega )H_{\theta }(i\omega )^{*})d\omega ,\quad {\text{if}}\ \|H_{\theta }\|_{\infty }<\gamma \\\infty ,\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad {\text{otherwise.}}\end{cases}}\end{aligned}}$

## Remark

When it is finite, $I_{\gamma }(H_{\theta })$ is given by ${\rm {{Tr}(B_{w}^{\top }PB_{w})}}$ where $P$, is asymmetric matrix with the smallest possible maximum singular value among all solutions of a Riccati equation.

## External Links

* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# LMIs in Control/pages/FDI Filter Design

FDI Filter Design For Systems With Sensor Faults: an LMI
Systems with faulty sensors are a very common type of systems. In many cases, redundancy is added in the form of additional sensors, but in certain cases it could be a costly solution. For general linear system models, the LMI in this section can be utilized to design state estimators which can detect and isolate faulty sensor readings in order to mitigate their effects.

## The System

    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+B_{1}w(t)+B_{2}u(t)\\y(t)&=Cx(t)+v(t)\end{aligned}}$
where $x(t)\in \mathbb {R} ^{n}$ is the state, $u(t)\in \mathbb {R} ^{m}$ is the control input, $w(t)\in \mathbb {R} ^{r}$ is the process noise, $y(t)\in \mathbb {R} ^{p}$ is the output and $v(t)\in \mathbb {R} ^{q}$ is the measurement noise.

## The Data

The state space matrices $(A,B_{1},B_{2},C)$ are required to be known.

## The Optimization LMI

The following LMI is used to design the Fault Detection and Isolation (FDI) filter:
       ${\begin{aligned}&{\text{min}}_{\Phi ,\Theta ,\gamma }\;\gamma ,\\&{\text{subj. to: }}\Phi >0,\\&\quad \quad {\begin{bmatrix}A^{\top }\Phi +\Phi A+C^{\top }\Theta ^{\top }+\Theta C&\Phi B_{1}&\Theta &I\\*&-\gamma I&0&0\\*&*&-\gamma I&0\\*&*&*&-\gamma I\end{bmatrix}}<0\\\end{aligned}}$
Then the filter is $K=\Phi ^{-1}\Theta$.

## Conclusion:

The LMI designed in this section is used to design filters that can work on systems that are prone to sensors getting damaged or faulty.

## Implementation

To solve the feasibility LMI, YALMIP toolbox is required for setting up the feasibility problem, and SeDuMi is required to solve the problem. The following link showcases an example of the feasibility problem:
https://github.com/smhassaan/LMI-Examples/blob/master/FDI_Filter_example.m

## Related LMIs

H-infinity Optimal Filter
H-infinity Optimal Observer

## External Links

A list of references documenting and validating the LMI.
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# LMIs in Control/pages/Ellipsoidal inequality
## Introduction

The simplex algorithm was the first algorithm proposed for linear programming, and although the algorithm is quite fast in practice, no variant of it is known to be polynomial time. The Ellipsoid algorithm is the first polynomial-time algorithm discovered for linear programming. The Ellipsoid algorithm was proposed by the Russian mathematician Shor in 1977 for general convex optimization problems and applied to linear programming by Khachyan in 1979.
The Ellipsoidal inequality constraints are a type of Lyapunov Function. They are important in process identification, parameter estimation, and statistics. Applications include the crystallization process, polymer film extrudes, and paper machines.

## The Data

Formulation of the inequality depends upon the coordinates of the ellipsoid $(x_{i})$ and the centre of the ellipsoid $(x_{c})$.

## The Ellipsoidal Inequality

An Ellipsoid is described by:
${\begin{aligned}\ (x-x_{c})^{T}P^{-1}(x-x_{c})<1,\\\ where,P=P^{T}>0\\\end{aligned}}$
It can be expressed as an LMI using the Schur complement lemma with $Q(x)=1,R(x)=P,andS(x)=(x-x_{c})^{T}:$
${\begin{bmatrix}1&&(x-x_{c})^{T}\\(x-x_{c})&&P\end{bmatrix}}$ ${\begin{aligned}>=0\end{aligned}}$

## Conclusion

Using this inequality, as the algorithm advances to the next step; if the value of P is positive; the volume will keep on shrinking until the LMI is fulfilled.

## Implementation

* https://github.com/Margav06/LMI-for-Ellipsoidal-Inequality

## External Links

A list of references documenting and validating the LMI.
* https://web.mit.edu/braatzgroup/33_A_tutorial_on_linear_and_bilinear_matrix_inequalities.pdf
* http://www-math.mit.edu/~goemans/18433S09/ellipsoid.pdf
Return to Main Page
# Human brain/Ear
## Anatomy

The parts of the ear are:
* Pinna
* Ear canal
* Eardrum
* Ossicles
** Hammer
** Anvil
** Stirrup
* Cochlea

## Function

When sound waves are made the pinna (auricle) gathers them up and then the sound waves move into the ear canal (external auditory meatus, EAM). The sound waves then vibrate the eardrum (tympanic membrane) which strikes the hammer (malleus) bone which moves the anvil (incus) bone and the stirrup (stapes) bone. The stapes vibrates the liquid that fills the cochlea. The hair cells at the bottom detect the highest sounds. The hair cells in the middle detect lower sounds. The hair cells at the top control the lowest sounds. This gets going to the auditory nerve and then into the brain where you hear the sound.

## Illustrations

* the pinna of the ear
* ear canal highlighted
* tympanic membrane
* ossicles
* cochlea
# Human brain/Nose
## Anatomy

The parts of the nose are:
* Nasion
* Root
* Bridge
* Ala
* Apex
* Nostril
* Columella
* Nasal cavity
** Vestibule
** Olfactory region
** Respiratory region

## Function

The air goes inside the nasal cavity. The nasal cavity warms the air and traps dust particles with tiny hairs and mucous. The smell of things in the air is caused by the olfactory tract which sends signals to the brain about the smell.
# Human brain/Oral cavity
## Tooth
### Anatomy

The teeth (singular: tooth) are made up of parts shown below.
* Crown
** Enamel
** Dentin
* Neck
** Gingiva
** Pulp cavity
** Pulp
* Root
** Cementum
** Root canal
** Periodontal ligament
** Nerves and blood vessels
** Alveolar bone
* Jaw
** Maxillae
** Mandible

### Function

The teeth function to chew food. The types of teeth are the incisors, canines, premolars, and molars. Incisors cut the food. The canines grip the food. The premolars and molars (from Latin: mola = grindstone) grind the food. A baby has 20 teeth, but they are not visible until they erupt through the gingiva (gums) and an adult has 32 teeth. Maxillary (upper) teeth and their associated periodontal ligament are innervated by the superior alveolar nerves, branches of the maxillary division, termed the posterior superior alveolar nerve, anterior superior alveolar nerve, and the variably present middle superior alveolar nerve. The teeth help us speak.

## Salivary gland
### Anatomy

The parotid, sublingual, and submandibular glands are major salivary glands. The other ones are minor salivary glands.

### Function

The salivary glands make saliva. Saliva travels through ducts and then into the mouth.

#### Saliva

Saliva has alpha-amylase which breaks down starch and lingual lipase which breaks lipids. Saliva also cleans the mouth.

## Lingua
### Anatomy

The lingua (tongue) is made up of the base (root), body, and apex.

### Function

The lingua helps in speech. Saliva helps taste the food. The chemicals from the food travel from the lingual papillae to the taste buds. The lingua and saliva from the food bolus. It gets sent down the pharynx.

## Air

The mouth is also a passage for air.
# Human brain/Cerebellum
## Anatomy

The cerebellum (Latin for little brain) is made up of the cerebrocerebellum, the spinocerebellum, and the vestibulocerebellum.

## Function

The cerebellum controls your posture and your balance.
# Human brain/Cerebrum
## Anatomy

The cerebrum is made up of 4 lobes:
* Frontal lobe
* Parietal lobe
* Occipital lobe
* Temporal lobe
The cerebrum is the largest part of the brain.

## Function

The cerebrum controls our thinking and our muscles. It stores all memories.
# Human brain/Dermis
## Anatomy

The dermis is made up of the papillary dermis and the reticular dermis. It consists of collagen, elastin, blood capillaries, lymph vessels, sweat glands, sebaceous glands, nerve endings, and hair follicles.

## Function

The dermis makes sweat and regulates the body’s temperature, it produces oil, it makes hair grow, feels things and if it is too hot or too cold, your body tells you to get away from it and the dermis also protects the body from harmful pathogens, keeping the skin in shape, and distributing blood so that it can feed the skin, removes toxins, and supplies the epidermis with blood.
# Human brain/Brainstem
## Anatomy

The brainstem is made up of the midbrain, the pons, and the medulla (medulla oblongata).

## Function

The brainstem controls your heart and lungs.
# Human brain/Epidermis
## Anatomy

The parts of the epidermis are:
* Stratum basale
* Stratum spinosum
* Stratum granulosum
* Stratum lucidum
* Stratum corneum

## Function

The epidermis prevents microbes from entering the body. The epidermis is also waterproof, preventing the ingress of liquids which would otherwise wreck havoc on the chemistry body. After all, how would you wash your hands if they were not waterproof?
# Human brain/Eye
## Anatomy

The parts of your eye are:
* Sclera
* Cornea
* Retina
* Anterior chamber
* Posterior chamber
* Iris
* Pupil
* Lens
* Vitreous body
* Optic nerve

## Function

Your eyes help you see color.

### Color

This is the advanced level. The different colors represent what each of the colors looks like.

## Primary

* Red
* Blue
* Yellow

## Secondary

* Green
* Orange
* Purple

## Tertiary

* Teal
* Violet
* Amber
* Magenta
* Chartreuse
* Vermilion

#### Light

Color is actually from sunlight. Without the sun, everything would be black, white, and grey.

### Sight

Now that we learned about color, we need to learn how we see. When light enter the pupil, and is focused through the cornea, lens, and iris. Then the image focuses on the retina. There are 2 types of cells in vision: Rods and cones. Rods see black, white, and grey. Cones see colors.
# LMIs in Control/Click here to continue/LMIs in system and stability Theory/Delay-Independent Condition

Stabilization of Time-Delay Systems - Delay Independent Case
Suppose, for instance, there was a system where a time-delay was introduced. In that instance, stabilization would have to be done in a different manner. The following example demonstrates how one can stabilize such a system independent of the delay.

## The System

For this particular problem, suppose that we were given the time-delayed system in the form of:
    ${\begin{aligned}{\begin{cases}{\dot {x}}(t)&=Ax(t)+A_{d}(t-d)+Bu(t),\\x(t)&=\phi (t),t\in [0,d],0<d\leq {\bar {d}},\\\end{cases}}\end{aligned}}$
where
    ${\begin{aligned}&A\,A_{d}\in \mathbb {R} ^{n\times n},B\in \mathbb {R} ^{nxr}{\text{ are the system coefficient matrices,}}\\&\phi (t){\text{ is the initial condition,}}\\&d{\text{ represents the time-delay, and}}\\&{\bar {d}}{\text{ is a known upper-bound of }}d\\\end{aligned}}$
Then the LMI for determining the Time-Delay System for the Delay-Independent case would be obtained as described below.

## The Data

In order to obtain the LMI, we need the following 3 matrices: $A,A_{d},$ and $B$.

## The Optimization Problem

Suppose - for the time-delayed system given above - we were asked to design a memoryless state-feedback control law where $u=Kx$ such that the closed-loop system:
    ${\begin{aligned}{\begin{cases}{\dot {x}}(t)&=(A+BK)x(t)+A_{d}(t-d),\\x(t)&=\phi (t),t\in [0,d],0<d\leq {\bar {d}},\\\end{cases}}\end{aligned}}$
is simultaneously both uniform and asymptotically stable, then the system would be stabilized as follows.

## The LMI: The Delay-Independent Stabilization of Time-Delay Systems

From the given pieces of information, it is clear that the optimization problem only has a solution if there exists a matrix$W\in \mathbb {R} ^{r\times n}$ and 2 symmetric matrices $X>0$ and $Y>0$ that satisfy the following:
       ${\begin{aligned}{\begin{bmatrix}X{A^{T}}+AX+BW+{W^{T}}{B^{T}}+Y&&{A_{d}}X\\X{A_{d}}^{T}&&-Y\end{bmatrix}}&<0\\\end{aligned}}$

## Conclusion:

Given the resulting feedback gain matrix $K=WX^{-1}$, it can be observed that the matrix is asymptotically stable while simultaneously ensuring that the solution is delay-independent from the time-delay system where this gain matrix was derived.

## Implementation

* Example Code - A GitHub link that contains code (titled "DelayIndependentTimeDelay.m") that demonstrates how this LMI can be implemented using MATLAB-YALMIP.

## Related LMIs

      * Delay Dependent Time-Delay Stabilization - Equivalent LMI for delay-dependent time-delay stabilization.

## External Links

A list of references documenting and validating the LMI.
* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A List of LMIs by Ryan Caverly and James Forbes.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
* LMIs in Control Systems: Analysis, Design and Applications - A book co-authored by Guang-Ren Duan and Hai-Hua Yu.