OpenLLM-France/wikimedia huggingface dataset:
# Norwegian/Useful Expressions

| English | Norsk |
| Good day | God dag |
| Hi | Hei [hæɪ̯] |
| Hello | Hallo [hɑ'luː] |
| Good bye (formal, old-fashioned) | Farvel [fɑɾ'ʋɛl] |
| Good bye (less formal) | Ha det bra [hɑːdə.bɾɑ] |
| Good bye (informal) | Ha det |
| Please | vær så snill ['ʋæːʃɔ.'snɪl] |
| Thank you | Takk [tʰɑk] |
| Thank you very much | Tusen takk |
| Excuse me, I'm sorry, or Pardon me | Unnskyld |
| Yes | Ja [jɑː] (sometimes Jo) |
| No | Nei [næɪ̯] |
| I don't know | Jeg vet ikke |
| I do not understand Norwegian | Jeg forstår ikke norsk |
| My name is... | Jeg heter... |
| I would like to... | Jeg vil gjerne... |
| I would rather... | Jeg vil heller... |
| Where is... | Hvor er... |
| Show me... | Vis meg... |
| I need... | Jeg trenger... |
| Painkillers | Smertestillende tabletter |
| Can you repeat? | Kan du gjenta? |
| What are you saying? | Hva sier du? |
| Where do I find? | Hvor finner jeg? |
| Can I have a coffee? | Kan jeg få en kaffe? |
| Do you speak English? | Snakker du engelsk? |
| Where can I take the bus? | Hvor kan jeg ta bussen? |
| Citizen | Statsborger |
| Norwegian | norsk ['nɔʃc] |
| English | engelsk ['ɛɲl̩sc] |
| Foreigner | utlending |
| That one | den [dɛn] or det [deː] |
| How much? | hvor mye? [ʋuɾ myːə] |
| Can I take your picture? | kan jeg ta bilde av deg? |
| Where is the bathroom? | hvor er badet/toalettet? |
| Where do you come from? | hvor kommer du fra? |
| Toast (Cheers!) | skål [skɒːɫ] |
| Where can I find a restaurant? | hvor kan jeg finne en restaurant? [ˌʋuɾ.kʰɑnjæˈfɪnːɛnˌɾɛstʉˈɾɑŋ] |
| Where is the nearest hospital? | hvor er det nærmeste sykehuset? |
# Norwegian/Months and Weekdays

The names of the months in Norwegian are rather similar to those in English, because both languages have taken the names from Latin. In Norwegian, however, the names of the months do not begin with a capital letter, except when the name comes first in a sentence (as it is for all words).
| Norwegian | English |
| januar | January |
| februar | February |
| mars | March |
| april | April |
| mai | May |
| juni | June |
| juli | July |
| august | August |
| september | September |
| oktober | October |
| november | November |
| desember | December |
The days of the week in Norwegian are as follows, and like the names of the months, do not begin with a capital letter:
| Norwegian | English |
| mandag | Monday |
| tirsdag | Tuesday |
| onsdag | Wednesday |
| torsdag | Thursday |
| fredag | Friday |
| lørdag | Saturday |
| søndag | Sunday |
# LMIs in Control/Click here to continue/Time-Delay Systems/LMI for Time-Delay system on delay Dependent Condition
## The System

The problem is to check the stability of the following linear time-delay system on a delay dependent condition
    ${\begin{aligned}{\begin{cases}{\dot {x}}(t)&=Ax(t)+A_{d}x(t-d)\\x(t)&=\phi (t),t\in [-d,0],0<d\leq {\bar {d}},\\\end{cases}}\end{aligned}}$
where
    ${\begin{aligned}{A,A_{d}}\in \mathbb {R} ^{n\times n},A\in \mathbb {R} ^{n\times r}{\text{ are the system coefficient matrices,}}\\\end{aligned}}$
$\phi (t)$ is the initial condition
$d$ represents the time-delay ${\bar {d}}$ is a known upper-bound of $d$
For the purpose of the delay dependent system we rewrite the system as
    ${\begin{cases}{\dot {x}}(t)&=Ax(t)+A_{d}x(t-d)\\{\dot {x}}(t)&=(A+A_{d})x(t)-A_{d}(x(t)-x(t-d)\end{cases}}$

## The Data

The matrices $A,A_{d}$ are known

## The LMI: The Time-Delay systems (Delay Dependent Condition)

From the given pieces of information, it is clear that the optimization problem only has a solution if there exists a symmetric positive definite matrix $X$ and a scalar $0<\beta <1$ such that
    ${\begin{bmatrix}\Phi (X)&{\bar {d}}XA^{T}&{\bar {d}}XA_{d}^{T}\\{\bar {d}}AX&-d\beta I&0\\{\bar {d}}A_{d}X&0&-{\bar {d}}(1-\beta )I\end{bmatrix}}$${\begin{aligned}<0\end{aligned}}$
Here $\Phi (X)=X)A+A_{d})^{T}+(A+A_{d})X+{\bar {d}}A_{d}A_{d}^{T}<0$
This LMI has been derived from the Lyapunov function for the system. It follows that the system is asymptotically stable if
$P(A+A_{d})+(A+A_{d})^{T}P+{\bar {d}}PA_{d}A_{d}^{T}P+{\frac {\bar {d}}{\beta }}A^{T}A+{\frac {\bar {d}}{1-\beta }}A_{d}^{T}A_{d}<0$
This is obtained by replacing $X$ with $P^{-1}$

## Conclusion:

We can now implement these LMIs to do stability analysis for a Time delay system on the delay dependent condition

## Implementation

The implementation of the above LMI can be seen here
https://github.com/yashgvd/LMI_wikibooks

## Related LMIs

Time Delay systems (Delay Independent Condition)

## External Links

* - 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.
* D. d. S. Madeira and J. Adamy, "Static output feedback: An LMI condition for stabilizability based on passivity indices," 2016 IEEE Conference on Control Applications (CCA), Buenos Aires, 2016, pp. 960-965.
# LMIs in Control/Controller Synthesis/Continuous Time/D-Stability

      * Continuous Time D-Stability Controller
# LMIs in Control/Controller Synthesis/Continuous Time/LQ Regulation via H2 control
## LQ Regulation via $H_{2}$ Control

The LQR design problem is to build an optimal state feedback controller $u=Kx$ for the system ${\dot {x}}=Ax+Bu,x(0)=x_{0}$ such that the following quadratic performance index.
    ${\begin{aligned}J(x,u)=\int _{0}^{\infty }(x^{T}Qx+u^{T}Ru)dt\end{aligned}}$
is minimized, where
    ${\begin{aligned}Q=Q^{T}\geq 0,R=R^{T}>0\end{aligned}}$
The following assumptions should hold for a traditional solution.
${\boldsymbol {A1}}.(A,B)$ is stabilizable.
${\boldsymbol {A2}}.(A,L)$ is observable, with $L=Q^{1/2}$.

## Relation to $H_{2}$ performance

For the system given above an auxiliary system is constructed
    ${\begin{aligned}{\dot {x}}=Ax+Bu+x_{0}\omega ,y=Cx+Du\end{aligned}}$
where
    ${\begin{aligned}C={\begin{bmatrix}Q^{1/2}\\0\end{bmatrix}},D={\begin{bmatrix}0\\R^{1/2}\end{bmatrix}}\end{aligned}}$
Where $\omega$ represents an impulse disturbance. Then with state feedback controller $u=Kx$ the closed loop transfer function from disturbance $\omega$ to output $y$ is
    ${\begin{aligned}G_{y\omega }(s)=(C+DK)[sI-(A+BK)]^{-1}x_{0}\end{aligned}}$
Then the LQ problem and the $H_{2}$ norm of $G_{y\omega }$ are related as
    ${\begin{aligned}J(x,u)=||G_{y\omega }(s)||_{2}^{2}\end{aligned}}$
Then $H_{2}$ norm minimization leads minimization of $J$.

## Data

The state-representation of the system is given and matrices $Q,R$ are chosen for the optimal LQ problem.

## The Problem Formulation:

Let assumptions $A1$ and $A2$ hold, then the state feedback control of the form $u=Kx$ exists such that $J(x,u)<\gamma$ if and only if there exist $X\in \mathbb {S} ^{n}$, $Y\in \mathbb {S} ^{r}$ and $W\in \mathbb {R} ^{rxn}$. Then $K$ can be obtained by the following LMI.

## The LMI:

$\min \gamma ::$
    ${\begin{aligned}(AX+BW)+(AX+BW)^{T}+x_{0}x_{0}^{T}<0\end{aligned}}$
    ${\begin{aligned}trace(Q^{1/2}X(Q^{1/2}))+trace(Y)<\gamma \end{aligned}}$
    ${\begin{aligned}{\begin{bmatrix}-Y&R^{1/2}W\\(R^{1/2}W)^{T}&-X\end{bmatrix}}<0\end{aligned}}$

## Conclusion:

In this case, a feedback control law is given as $K=WX^{-1}$.

## External Links

* LMIs in Control Systems Analysis, Design and Applications - Duan and Yu
* A course on LMIs in Control by Matthew Peet.
* LMIs in Systems and Control Theory - A downloadable book on LMIs by Stephen Boyd.
# LMIs in Control/Click here to continue/Time-Delay Systems/LMI for Time-Delay system on delay Independent Condition
## The System

The problem is to check the stability of the following linear time-delay system
    ${\begin{aligned}{\begin{cases}{\dot {x}}(t)&=Ax(t)+A_{d}x(t-d)\\x(t)&=\phi (t),t\in [-d,0],0<d\leq {\bar {d}},\\\end{cases}}\end{aligned}}$
where
    ${\begin{aligned}{A,A_{d}}\in \mathbb {R} ^{n\times n}{\text{, }}{A}\in \mathbb {R} ^{n\times r}{\text{ are the system coefficient matrices,}}\\\end{aligned}}$
$\phi (t)$ is the initial condition
$d$ represents the time-delay ${\bar {d}}$ is a known upper-bound of $d$

## The Data

The matrices $A,A_{d}$ are known

## The LMI: The Time-Delay systems (Delay Independent Condition)

From the given pieces of information, it is clear that the optimization problem only has a solution if there exists two symmetric matrices $P,S\in \mathbb {S} ^{n}$ such that
$P>0$
    ${\begin{bmatrix}A^{T}P+PA+S&PA_{d}\\A_{d}^{T}P&-S\end{bmatrix}}$${\begin{aligned}<0\end{aligned}}$
This LMI has been derived from the Lyapunov function for the system. By Schur Complement we can see that the above matrix inequality is equivalent to the Riccati inequality
$A^{T}P+PA+PA_{d}S^{-1}A_{d}^{T}P+S<0$

## Conclusion:

We can now implement these LMIs to do stability analysis for a Time delay system on the delay independent condition

## Implementation

The implementation of the above LMI can be seen here
https://github.com/yashgvd/LMI_wikibooks

## Related LMIs

Time Delay systems (Delay Dependent Condition)

## External Links

* - 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.
* D. d. S. Madeira and J. Adamy, "Static output feedback: An LMI condition for stabilizability based on passivity indices," 2016 IEEE Conference on Control Applications (CCA), Buenos Aires, 2016, pp. 960-965.
# LMIs in Control/Click here to continue/YALMIP

YALMIP
The tool mainly uses for this book. The chapter will provide some examples for using Yalmip with optimization problem.
YAMLIP's download link: . click "download" in the top and follows the instructions in the file. YALMIP can solve some easy problems without extra software support.
For a optimize problem, we need to define constraints, objective function, variables.
For example, in order to find a straight line to separate the two data in the plot with minimal implementation error.
# LMIs in Control/Controller Synthesis/Continuous Time/H-inf Optimal Quadratically Stabilizing Controllers with Parametric Norm-Bounded Uncertainty

LMIs in Control/Controller Synthesis/Continuous Time/H-inf Optimal Quadratically Stabilizing Controllers with Parametric Norm-Bounded Uncertainty
If there exists some $\mu \geq 0,P>0$, and $Z$ such that the LMI holds, then the system satisfies $\|y\|_{L_{2}}\leq \gamma \|u\|_{L_{2}}.$ There also exists a controller with $u(t)=Kx(t).$

## The System

    ${\begin{aligned}{\dot {x}}(t)&=Ax(t)+Bu(t)+Mp(t)+B_{2}w(t),&&p(t)=\Delta (t)q(t),\\q(t)&=Nx(t)+D_{12}u(t),&&\Delta \in \mathbf {\Delta } \;:=\{\Delta \in \mathbb {R} ^{n\times n}:\|\Delta \|\leq 1\}\\y(t)&=Cx(t)+D_{22}u(t)\\\end{aligned}}$

## The Data

The matrices $A,B,M,B_{2},N,D_{12},C,D_{22}$.

## The Optimization Problem

Minimize $\gamma$ subject to the LMI constraints below.

## The LMI:

       ${\begin{aligned}{\text{Find}}\;&P>0,\mu \geq 0,{\text{ and }}Z:\\{\begin{bmatrix}AP+BZ+PA^{T}+Z^{T}B^{T}+B_{2}B_{2}^{T}+\mu MM^{T}&(CP+D_{22}Z)^{T}&PN^{T}+Z^{T}D_{12}^{T}\\CP+D_{22}Z&-\gamma ^{2}I&0\\NP+D_{12}Z&0&-\mu I\end{bmatrix}}<0\\\end{aligned}}$

## Conclusion:

The controller gains, K, are calculated by $K=ZP^{-1}$.

## Implementation

https://github.com/mcavorsi/LMI

## Related LMIs

Quadratically Stabilizing Controllers with Parametric Norm-Bounded Uncertainty
Stabilizing State-Feedback Controllers with Structured Norm-Bounded Uncertainty
Optimal State-Feedback Controllers with Structured Norm-Bounded Uncertainty

## External Links

* LMI Methods in Optimal and Robust Control - A course on LMIs in Control by Matthew Peet.
# LMIs in Control/Controller Synthesis/Continuous Time

      * State Feedback
      * D-Stability
      * Optimal State Feedback
      * Output Feedback
      * Static Output Feedback
      * Optimal Output Feedback
      * Optimal Dynamic Output Feedback
      * Decentralized Feedback
      * Stabilizability LMI
      * LMI for the Controllability Grammian
      * LMI for Decentralized Feedback Control
      * LMI for Mixed $H_{2}/H_{\infty }$ Output Feedback Controller
      * Quadratically Stabilizing Controllers with Parametric Norm-Bounded Uncertainty
      * H-inf Optimal Quadratically Stabilizing Controllers with Parametric Norm-Bounded Uncertainty
      * Stabilizing State-Feedback Controllers with Structured Norm-Bounded Uncertainty
      * Optimal State-Feedback Controllers with Structured Norm-Bounded Uncertainty
      * $H_{\infty }$ Optimal Output Controllability for Systems With Transients
      * Quadratic Polytopic Stabilization
      * Quadratic D-Stabilization
      * Quadratic Polytopic Full State Feedback Optimal $H_{\infty }$ Control
      * Quadratic Polytopic Full State Feedback Optimal $H_{2}$ Control
      * Continuous-Time Static Output Feedback Stabilizability
      * Multi-Criterion LQG
      * Inverse Problem of Optimal Control
      * Nonconvex Multi-Criterion Quadratic Problems
      * Static-State Feedback Problem
      * Mixed H2 Hinf with desired pole location control
      * Mixed H2 Hinf with desired pole location control for perturbed systems
      * Robust H2 State Feedback Control
      * LQ Regulation via H2 control
# LMIs in Control/Controller Synthesis

      * Continuous Time
      * Discrete Time
      * Design For Insensitive Region
      * Takagi Sugeno Models for Polytopic Controller Design
# Controlling MATLAB Memory Use

MATLAB is a very useful tool for analysing medical image data. Unfortunately, it has one significant drawback: MATLAB memory management is terrible. The memory becomes easily fragmented, with no attempts made at compaction (except for the almost useless MATLAB pack function). With large medical image volumes, the results can be disastrous, leading to huge memory use, poor performance, and in the extreme case the termination of your MATLAB process by the operating system.
Controlling MATLAB memory use is a bit of a black art. There are general guidelines that can be followed, but no hard and fast rules that will work in every case. Here are some soft rules:
* Re-use memory whenever possible. For example, the EMMA getimages function allows you to specify a block of memory to use. In general, this is the variable that already contains an image, and should be the same size as the images to be loaded:
will re-use the memory assigned to the matrix PET, and will not allocate new memory for the returned images. This eliminates the fragmentation associated with reloading a set of images.
* Use the EMMA rescale function to multiply matrices by a scalar. This function does not assign new memory, but instead uses the memory already assigned to the matrix. For example, the MATLAB instruction:
will cause fragmentation since the matrix PET will be copied. However, the instruction:
has the same effect, but without causing fragmentation.
* Initialise large matrices. This is useful when you intend to fill a matrix slowly through a series of operations. For example, if you intended to create a 128x128 image one row at a time in the variable Fake_PET, you should specify:
This will initialise the matrix to the correct size, and fill it with zeros. Then, when you fill the matrix in with your values, it will not be copied, and memory fragmentation will not occur.
* Use small amounts of memory at a time. This is probably the most important rule, and can potentially solve all memory use problems. For example, when analysing a dynamic study, consider breaking down your analysis so that it can be performed on one line (or several lines) at a time, instead of on the whole image.
For example consider the case presented in the [emma1.html basic EMMA image manipulation] tutorial: we want to generate a volume of integrated images. The following snippet of code demonstrates the wrong way to do this:
This brute force technique violates several of the above guidelines. It does not re-use memory when loading images from the MINC file. It transposes PET, which causes PET to be copied. It then transposes the result from ntrapz, which causes this result to be copied.
A better approach is to load the images for one slice, take the data line by line, and then re-assemble this into a final image. The following piece of MATLAB code has the same final result as the above, but uses much less memory (approximately 4 Megabytes).
# MATLAB Fitting Demo

There are many occasions where a non-linear function must be fitted to measured data, and MATLAB provides a very flexible platform for performing this analysis. This document presents an example of performing a least squares fit to the standard two-compartment blood flow model:
File:Ratequation.gif
where K1 is the rate constant of flow from vasculature to tissue, k2 is the rat constant of flow from tissue to vasculature, A(t) is the activity in the brain, and Ca(t) is the activity in the blood.
The MATLAB leastsq function provided with the Optimization Toolbox is the obvious choice for solving this problem, since it performs a non-linear least squares fit to a multi-dimensional problem. Please see the MATLAB documentation for a detailed description of how the leastsq function works, and what options it accepts. For our purposes, its default tolerances and fitting algorithm (Levenberg-Marquardt) will be used.
There are several steps to performing a curve fit in MATLAB:
* Create a function that returns the values of the function. In this example, we require a function that returns calculated values of A(t), based on a given K1 and k2, as well as the measured Ca(t) curve. In MATLAB, this is quite straight forward:
This short function returns the values of A(t) given the fitting variables (in this case, K1=vars(1), and k2=vars(2)), a vector of times, and a vector of values for Ca. The first line calculates the exponential part of the equation, the second line calculates the convolution, the third line clips the convolution to the length that we are interested in, and the fourth line sets the return value (K1 times the convolution).
* Create a function that returns the values of the residuals (in practice, this could be combined with the previous function). The following function gets the values of the function from the previous function, and returns the residuals:
* Make a call to leastsq, passing the name of the function that returns the residuals:
leastsq will call the function fitrat to get the residuals, and pass it [K1 k2] (which will be received in vars), ts_even, plasma_even, and brain_even in that order. The leastsq function passes back the final parameters (the solution) in final, the options vector (giving such information as the number of iterations), and both the residuals and the Jacobians at the solution.
* Get the 95% confidence interval through a call to the MATLAB confint function (also from the Optimization Toolbox).
This function takes the solution to the least squares problem (final), the residuals at the solution (f), and the Jacobians at the solution (j). It returns the 95% confidence interval and the variance (please see the MATLAB Optimization Toolbox documentation for further details, or type help confint in MATLAB).
# MINC/Tools/emma
## Introduction

EMMA (Extensible MATLAB Medical image Analysis) is a toolkit written at the Montreal Neurological Institute designed to ease the use of MATLAB in the analysis of medical imaging data. It was conceived by Sean Marrett and implemented (in the summer of 1993) by Mark Wolforth and Greg Ward, under Sean's guidance. It provides functions for reading and writing MINC files, viewing images, performing ROI operations, and performing several popular analyses. Also, there are toolkits for performing kinetic analysis of dynamic PET rCBF (regional cerebral blood flow) and FDG data.

## Online EMMA documentation

emma-ref General EMMA documentation: Explains the use of the EMMA analysis package.
emma-rcbf Regional Cerebral Blood Flow (rCBF) Analysis: Explains the theory, implementation, and use of the EMMA RCBF toolkit, with examples. This is meant both as a usable application for determining kinetic constants K1 and k2, and as an example of how to write such applications with MATLAB and EMMA.

## MATLAB/EMMA demos

emma-demo1 Basic EMMA image manipulation.: Gives a demonstration of using MATLAB and the EMMA toolkit to perform basic image manipulation (reading, viewing, and writing of images).
emma-demo2 Advanced EMMA image manipulation.: Gives a demonstration of using MATLAB and the EMMA toolkit to perform advanced image manipulation (masking, averaging, producing time activity curves).
emma-matlab_memory Controlling MATLAB Memory Use: Gives some pointers on reducing memory use within MATLAB.
emma-rcbf RCBF analysis: Gives a demonstration of using MATLAB and the EMMA toolkit to perform two-compartment RCBF (Regional Cerebral Blood Flow) analysis.
emma-rat Rat data analysis: Gives a demonstration of using MATLAB to perform two-compartment analysis on data gathered from rats. This method is also extendable to finding local values of K1 and k2 in PET studies.
emma-fitting Curve fitting: Gives a demonstration of using MATLAB to perform least squares curve fitting.
emma-speed Speeding up MATLAB: Gives some examples of how to get the most out of your MATLAB scripts.
emma-roi Region of Interest Analysis with MATLAB: Explains the use of the MATLAB/EMMA ROI package, with examples of use.
emma-tags Tagged Region Analysis with MATLAB: Gives some examples of using MATLAB to analyze tagged volumes produced by Display.