OpenLLM-France/wikimedia huggingface dataset:
# Healthy eating habits/Increasing calcium and Vitamin D intake

Calcium is one of the most essential minerals recommended for dietary as it is involved various roles and processes within the human body. As well as the imperative role that calcium holds in bone and teeth mineralization, promoting strong & prosperous bones, calcium is also required for the maintenance of cell membranes, enzyme systems and hormone actions. Also, due to its role in nerve function activity and transmission, calcium is a responsible component of muscle contraction, such as that of the heart. Calcium also aids in the lowering cholesterol.
To function correctly and be utilised properly, calcium also requires Vitamin D. The two work in tandem and have similar functions. Vitamin D is important as it not only a vitamin but also a hormone involved in the absorption and metabolism of calcium and other micro nutrients. Vitamin D, like calcium, helps with bone and teeth formation, maintains a stable nervous system and a healthy heart plus immunity. It is also linked with regulating blood pressure.

## The Role Of Calcium

Calcium plays an essential role in bone structure and maintenance, providing the body with its framework. Around 99 per cent of the body’s calcium is stored in bones and teeth and the remaining 1 per cent can be found circulating in the blood and in cells. The calcium existing in the blood is tightly controlled and the bones provide a readily available source of calcium when body is in need. This means that when blood-calcium levels drop, the blood ‘borrows’ calcium from the bones to restore it to an appropriate level. When blood-calcium levels increase, the blood will ‘return’ any excess calcium back to the bones. Therefore, when calcium intake is consistently inadequate, calcium stores in the bone become depleted. This results in weaker bones which are susceptible to osteoporosis. It is extremely important to consume adequate amounts of calcium-containing foods to ensure strong and healthy bones.

## Interactions And Interferences

Some aren’t absorbed as well if taken with calcium. Calcium can reduce the ability of iron absorption by as much as 50 percent. However, calcium only interferes with non-heme iron, which comes from plant-based foods, not with heme iron, found in meat. This interplay between calcium and iron is really only important if you suffer from anemia, because although short-term iron absorption is reduced by calcium, studies have found that iron stored in the blood is not. When it comes to calcium, fiber also binds to the mineral, reducing its absorption. Studies have found that wheat fiber reduces calcium absorption by about half. If you're the type of person who aims to get a jump-start on fulfilling their recommended daily intake of fiber and calcium with your bowl of breakfast cereal, choose cereals primarily oats or other grains since they don't seem to block the calcium.
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/Frobenius Norm
## Frobenius Norm

Consider $A\in \mathbb {R} ^{n\times m}$ and $\gamma \in \mathbb {R}$$_{>0}$
The Frobenius norm of $A$ is $||A||$$_F$ =${\sqrt {tr(A^{T}A)}}={\sqrt {tr(AA^{T})}}$
The Frobenius norm is less than or equal to $\gamma$ if and only if any of the following equivalent conditions are satisfied.
1.There exists $S\in \mathbb {R} ^{n}$ such that
       ${\begin{bmatrix}Z&A^{T}\\*&1\\\end{bmatrix}}\geq 0,$
    ${\begin{aligned}\qquad tr(Z)\leq \gamma ^{\text{2}}.\qquad \\\end{aligned}}$
2.There exists $S\in \mathbb {R} ^{m}$ such that
       ${\begin{bmatrix}Z&A\\*&1\\\end{bmatrix}}\geq 0,$
    ${\begin{aligned}\qquad tr(Z)\leq \gamma ^{\text{2}}.\qquad \\\end{aligned}}$

## External Links

* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/Deduced LMI Conditions for Hinf Index

H-infinity Index Deduced LMI
Although the KYP Lemma, also known as the Bounded Real Lemma, is a basic condition to evaluate an upper bound on the H$_∞$, the verification of the bound on the H$_∞$-gain of the system can be done via the deduced condition.

## The System

A state-space representation of a linear system as given below:
    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+Bw(t)\\y(t)&=Cx(t)+Dw(t)\end{aligned}}$
where $x(t)\in \mathbb {R} ^{n}$, $y(t)\in \mathbb {R} ^{m}$ and $w(t)\in \mathbb {R} ^{r}$ are the system state, output, and the disturbance vector respectively. The transfer function of such a system can be evaluated as:
    ${\begin{aligned}G(s)=C(sI-A)^{-1}B+D\end{aligned}}$

## The Data

Number of states n, number of outputs m and number of external noise channels r need to be known. Moreover, the system matrices A,B,C,D are also required to be known.

## The Feasibility LMI

For an arbitrary $\gamma$, the transfer function G(s) satisfies
    $\left\|G(s)\right\|_{\infty }<\gamma$
if and only if there exists a symmetric matrix X > 0 and a matrix $\Omega .$ such that:
       ${\begin{aligned}{\text{Find}}\;X,\Omega :&\\\Theta +\Phi ^{\top }\Omega \Psi +\Psi ^{\top }\Omega ^{\top }\Phi <0\end{aligned}}$
where:
       ${\begin{aligned}\Theta &={\begin{bmatrix}0&X&0&0&0\\X&-X&0&0&0\\0&0&-\gamma I_{m}&0&0\\0&0&0&-X&0\\0&0&0&0&\gamma I_{r}\end{bmatrix}}\\\Phi &={\begin{bmatrix}-I_{n}&A^{\top }&C^{\top }&I_{n}&0\\0&B^{\top }&D^{\top }&0&-\gamma I_{r}\end{bmatrix}}\\\Psi &={\begin{bmatrix}I_{n}&0&0&0&0\\0&0&0&0&I_{r}\end{bmatrix}}\end{aligned}}$
The above LMI can be combined with the bisection method to find minimum $\gamma$ to find the minimum upper bound on the H$_∞$ gain of $G(s)$.

## Conclusion:

If there is a feasible solution to the aforementioned LMI, then the $\gamma$ upper bounds the infinity norm of the system G(s).

## 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/Deduced_hinf_example.m

## Related LMIs

Bounded Real Lemma

## 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 5.2.2 pp. 153–156.
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/Dualization Lemma
## Dualization Lemma

Consider $P_{i}\in {\text{S}}^{n}$ and the subspaces $U,V$, where $P$ is invertible and $U+V={\text{R}}^{n}$. The following are equivalent.
$X^{T}PX<0$ for all $X\in {\text{U}}$\$\left\{0\right\}$ and $X^{T}PX\geq 0$ for all $X\in {\text{V}}$.
$X^{T}P^{-1}X>0$ for all $X\in {\text{U}}^{\bot }$\$\left\{0\right\}$ and $X^{T}P^{-1}X\leq 0$ for all $X\in {\text{V}}^{\bot }$.

## Example

Consider the matrices $Q\in {\text{S}}^{n},S\in {\text{R}}^{n\times m},R\in {\text{S}}^{m},M\in {\text{R}}^{m\times n}$ where $R\geq 0,$ which define the quadratic matrix inequality
${\begin{aligned}\qquad {\begin{bmatrix}1&M\\\end{bmatrix}}{\begin{bmatrix}Q&S\\S^{T}&R\\\end{bmatrix}}{\begin{bmatrix}1\\M\\\end{bmatrix}}<0.\qquad (1)\end{aligned}}$
Define ${\begin{aligned}P={\begin{bmatrix}Q&S\\S^{T}&R\\\end{bmatrix}},U=R({\begin{bmatrix}0\\1\\\end{bmatrix}})\end{aligned}}$ where $U+V=R^{n+m}$. Notice that $(1)$ is equivalent to $X^{T}PX<0$ for all $X\in {\text{U}}$\$\left\{0\right\}$.Additionally, $X^{T}PX<0\geq$ for all $X\in {\text{V}}$ is euaivalent to
${\begin{aligned}\qquad {\begin{bmatrix}0&1\\\end{bmatrix}}{\begin{bmatrix}Q&S\\S^{T}&R\\\end{bmatrix}}{\begin{bmatrix}0\\1\\\end{bmatrix}}=R\geq 0,\end{aligned}}$
which is satisfied based on the definition of $R$ . By the dualization lemma, $(1)$ is satisfied with $R\geq 0$ if and only if
${\begin{aligned}\qquad {\begin{bmatrix}-M^{T}&1\\\end{bmatrix}}{\begin{bmatrix}{\tilde {Q}}&{\tilde {S}}\\{\tilde {S}}^{T}&{\tilde {R}}\\\end{bmatrix}}{\begin{bmatrix}-M^{T}\\1\\\end{bmatrix}}>0,\qquad {\tilde {Q}}\leq 0,\end{aligned}}$
where ${\begin{aligned}\qquad {\begin{bmatrix}{\tilde {Q}}&{\tilde {S}}\\{\tilde {S}}^{T}&{\tilde {R}}\\\end{bmatrix}}={\begin{bmatrix}Q&S\\S^{T}&R\\\end{bmatrix}}^{-1},U^{\bot }=N([1\quad M^{T}])=R({\begin{bmatrix}-M^{T}\\1\\\end{bmatrix}})\end{aligned}}$ , and ${\begin{aligned}V^{\bot }=N([0\quad 1])=R({\begin{bmatrix}1\\0\\\end{bmatrix}})\end{aligned}}$.

## 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.
* Norm-Preserving Dilations - Norm-preserving dilations and their applications to optimal error bounds (Davis, Kahan, Weinberger).
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/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}\geq 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

https://en.wikibooks.org/wiki/LMIs_in_Control
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/Finsler’s Lemma

LMIs in Control/Matrix and LMI Properties and Tools/Finsler's Lemma
This method It states equivalent ways to express the positive definiteness of a quadratic form Q constrained by a linear form L. It is equivalent to other lemmas used in optimization and control theory, such as Yakubovich's S-lemma, Finsler's lemma and it is wedely used in Linear Matrix Inequalities

## Theorem

Consider $\Psi \in \mathbb {S} ^{n},G\in \mathbb {R} ^{n\times m},H\in \mathbb {R} ^{n\times p}$. There exists $\mathrm {A} \in \mathbb {R} ^{m\times p}$ such that
$\Psi +G\mathrm {A} H^{T}+H\mathrm {A} ^{T}G^{T}<0,$
if and only if there exists $\sigma \in \mathbb {R}$ such that
$\Psi -\sigma GG^{T}<0$
$\Psi -\sigma HH^{T}<0$

## Alternative Forms of Finsler's Lemma

Consider $\Psi \in \mathbb {S} ^{n},Z\in \mathbb {R} ^{p\times n},x\in \mathbb {R} ^{n}$and $\sigma \in \mathbb {R} _{>0}$. If there exists $Z$ such that
$x^{T}\Psi x,0$
holds for all $x$ ≠ $0$ satisfying $Zx=0$, then there exists $\sigma$ such that
$\Psi -\sigma Z^{T}Z<0$

## Modified Finsler's Lemma

Consider $\Psi \in \mathbb {S} ^{n},G\in \mathbb {R} ^{n\times m},\mathrm {A} \in \mathbb {R} ^{m\times p},H\in \mathbb {R} ^{n\times p}$and $\epsilon \in \mathbb {R} _{>0}$, where $\mathrm {A} ^{T}\mathrm {A}$ is less that on equal to $\mathbb {R}$, and $R>0$. There exists $\mathrm {A}$ such that
$\Psi +G\mathrm {A} H^{T}+H\mathrm {A} ^{T}G^{T}{T}<0,$
there exists $\epsilon$ such that
$\Psi +\epsilon ^{-1}GG^{T}+\epsilon HRH^{T}<0.$

## Conclusion

In summary, a number of identical methods have been stated above to determine the positive definiteness of LMIs.

## 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.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
* LMI Properties and Applications in Systems, Stability, and Control Theory - A downloadable book on LMIs by Ryan James Caverly and James Richard Forbes.
# LMIs in Control/Click here to continue/Fundamentals of Matrix and LMIs/Deduced LMI Conditions for H2 Index

H$_2$ Index Deduced LMI
Although there are ways to evaluate an upper bound on the H$_2$, the verification of the bound on the H$_2$-gain of the system can be done via the deduced condition.

## The System

We consider the generalized Continuous-Time LTI system with the state space realization of $(A,B,C,D)$
    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+Bu(t)\\y(t)&=Cx(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 vectors respectively.
The transfer function of such a system can be evaluated as:
    ${\begin{aligned}G(s)=C(sI-A)^{-1}B+D\end{aligned}}$

## The Data

The system matrices $A,B,C$ are known.

## The Optimization Problem

For an arbitrary $\gamma >0$(a given scalar), the transfer function satisfies
    $\left\|C(sI-A)^{-1}B+D\right\|_{2}<\gamma$
The H$_2$-norm condition on Transfer function holds only when the matrix A is stable. And this can be conveniently converted to an LMI problem
if and only if 1. There exists a symmetric matrix $X>0$ such that:
$AX+XA^{T}+BB^{T}<0$, $trace(CXC^{T})<\gamma ^{2}$
2. There exists a symmetric matrix $Y>0$ such that:
$AY+YA^{T}+C^{T}C<0$, $trace(B^{T}YB)<\gamma ^{2}$

## The LMI - Deduced Conditions for H2-norm

These deduced condition can be derived from the above equations. According to this
For an arbitrary $\gamma >0$(a given scalar), the transfer function satisfies
    $\left\|G(s)\right\|_{2}<\gamma$
if and only if there exists symmetric matrices $Z$ and $P$; and a matrix $V$ such that
$trace(Z)<\gamma ^{2}$
${\begin{bmatrix}-Z&B^{T}\\B&-P\end{bmatrix}}$${\begin{aligned}<0\end{aligned}}$
${\begin{bmatrix}-(V+V^{T})&V^{T}A^{T}+P&V^{T}C^{T}&V^{T}\\AV+P&-P&0&0\\CV&0&-I&0\\V&0&0&-P\end{bmatrix}}$${\begin{aligned}<0\end{aligned}}$
The above LMI can be combined with the bisection method to find minimum $\gamma$ to find the minimum upper bound on the H$_2$ gain of $G(s)$.

## Conclusion:

If there is a feasible solution to the aforementioned LMI, then the $\gamma$ upper bounds the norm of the system G(s).

## Implementation

To solve the feasibility LMI, YALMIP toolbox is required for setting up the problem, and SeDuMi or MOSEK is required to solve the problem. The following link showcases an example of the problem:
https://github.com/yashgvd/ygovada

## Related LMIs

Bounded Real Lemma
Deduced LMIs for H-infinity index

## External Links

A list of references documenting and validating the LMI.
* - LMI in Control Systems Analysis, Design and Applications
* 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 Control/Click here to continue/Fundamentals of Matrix and LMIs/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.
# HKDSE Geography/M7

Weather is the condition of the lowest part of the atmosphere over a short period of time, while climate is the average weather conditions over many years.
There are different evidences showing global warming is happening.
# HKDSE Geography/M7/Factors Affecting Insolation
## Latitude

As one can see here, energy decreases with latitude:
Why?

### Angle of the Sun

As one can see from the diagram below, if the sun strikes the ground at a small angle, the solar radiation will be spread across a large area. If the sun strikes the ground at a right angle, the solar radiation will be most intense (this is known as overhead sun):
Therefore, higher latitudes receive less intense insolation:
However, this difference in temperature varies with season because of the tilt of the earth's axis (at around 23.5°). When the earth revolves around, different areas will receive the largest angle of the sun:
* At spring equinox (21/22 Mar) and autumnal equinox (22/23 Sep), the overhead sun is at the equator. The equator is thus the hottest.
* At winter solstice (21/22 Dec), the overhead sun is on the Tropic of Capricorn. The Tropic of Capricorn is hottest. It is winter in the Northern Hemisphere and summer in the Southern Hemisphere.
* At summer solstice (21/22 Jun), the overhead sun is on the Tropic of Cancer. The Tropic of Cancer is hottest. It is summer in the Northern Hemisphere and winter in the Southern Hemisphere.

### Daylight Hours

The longer an area is exposed to solar radiation, the more isolation on it has.
* At summer solstice, the Southern Hemisphere receives longer hours of daylight, and the Northern Hemisphere receives shorter hours. The Arctic Circle has 24 hours of daylight and the Antarctic Circle has none.
* At winter solstice, the Northern Hemisphere receives longer hours of daylight, and the Southern Hemisphere receives shorter hours. The Antarctic Circle has 24 hours of daylight and the Arctic Circle has none.
* The equator receives around 12 hours throughout the year.

## Time of the Day

Since the earth rotates every day, different longitudes are exposed to the sunlight at different times of the day.
* The time when an area begins to be exposed to solar radiation is called sunrise.
* At noon, the amount of solar radiation is at its peak. This is the midday sun.
* After sunset, the area is no longer exposed to sunlight.

## Atmosphere
### Atmosphere X Latitude

Let's look again at the diagram we saw above:
Radiation at higher latitudes need to go through a longer distance in the atmosphere before striking the ground. Thus they lose more energy in the transfer process.

### Cloud Cover

Areas with dense cloud cover have more reflection and scattering by clouds. Thus they have less insolation.

### Aerosols

Aerosols are small particles in the atmosphere that reflect and scatter insolation. Areas with aerosols, which can be released by human activities or volcanic eruptions.
# HKDSE Geography/M7/Climate Change

Several climatic changes will result.

## Poleward Shift of Climatic Regions

All climatic regions have been shifting polewards. Vegetation belts in the Northern Hemisphere have shifted to the North, while those in the Southern Hemisphere have shifted to the South. Tropical regions extend to warm temperate; warm temperate extents to cool temperate; cool temperate extends into polar regions.

## Ice Thawing

Permafrost has been thawing at a fast rate. This releases methane to further accelerate global warming by intensifying the greenhouse effect.
Glaciers, ice caps, icebergs and other large masses of ice are expected to thaw more because of the rise in average global temperature. In the polar regions, the melting of polar ice will decrease the albedo of the region, which means more radiation is absorbed, further accelerating warming in the area.

## Extreme Climate

The quantity and intensity of tropical cyclones will increase.
As climatic regions change, evaporation and precipitation patterns will also be altered. There will be severe droughts in some regions and floods in others. Sea level change will also cause flooding.
El Nino conditions will lead to a decrease in fish yields along the coast of Peru and cause violent rainstorms there, where Australia and Southeast Asia suffer from severe droughts and fires.