digital-brain/content/zettels/system_identification.md

173 lines
5.0 KiB
Markdown

+++
title = "System Identification"
author = ["Dehaeze Thomas"]
draft = false
+++
Tags
: [Modal Analysis]({{< relref "modal_analysis.md" >}})
## SISO Identification {#siso-identification}
### Problem Description {#problem-description}
<a id="figure--fig:siso-identification-schematic"></a>
{{< figure src="/ox-hugo/siso_identification_schematic.png" caption="<span class=\"figure-number\">Figure 1: </span>Block diagram of the SISO system identification" >}}
<a id="figure--fig:siso-identification-schematic-simplier"></a>
{{< figure src="/ox-hugo/siso_identification_schematic_simplier.png" caption="<span class=\"figure-number\">Figure 2: </span>Simpler Block diagram of the SISO system identification" >}}
<div class="note">
If the open-loop system is unstable, first design a simple controller that stabilizes the system and then identify the closed-loop system.
</div>
### Design of the Excitation Signal {#design-of-the-excitation-signal}
#### Introduction {#introduction}
There are several choices for excitation signals:
- Impulse, Steps
- Sweep Sinus
- Random noise, Periodic signals
#### Random noise with specific ASD {#random-noise-with-specific-asd}
The ASD of the measured output is:
\begin{equation}
\Gamma\_{y\_m}(\omega) = \Gamma\_d(\omega) + \Gamma\_u(\omega) \cdot |G(j\omega)|
\end{equation}
And we want the effect of the excitation signal to be much higher than the effect of the exogenous signals (measurement noise, input noise, disturbances).
\begin{equation}
\Gamma\_u(\omega) \gg \Gamma\_d(\omega) \cdot |G(j\omega)|^{-1}
\end{equation}
Note that \\(\Gamma\_d(\omega)\\) can be estimated by measuring the system output in the absence of any excitation signal.
The plant magnitude \\(|G(j\omega)|\\) can be roughly estimated from a first identification with bad coherence.
In order to design a random excitation signal with specific spectral characteristics, first a signal with an ASD equal to one is generated (i.e. white noise with unity ASD):
```matlab
Ts = 1e-4; % Sampling Time [s]
t = 0:Ts:10; % Time Vector [s]
%% Signal with an ASD equal to one
u_norm = sqrt(1/2/Ts)*randn(length(t), 1);
```
Then, a transfer function whose magnitude \\(|G\_u(j\omega)|\\) has the same shape as the wanted excitation ASD \\(\Gamma\_u(\omega)\\) is designed:
```matlab
%% Transfer function representing the wanted ASD
G_u = tf([1], [1/2/pi/100 1]);
```
Finally `lsim` is used to compute the shaped excitation signal.
```matlab
%% Shape the ASD of the excitation signal
u = lsim(G_u, u_norm, t);
```
#### Choose Sampling Frequency and Duration of Excitation {#choose-sampling-frequency-and-duration-of-excitation}
<div class="important">
The sampling frequency \\(F\_s\\) will determine the maximum frequency \\(F\_{\text{max}}\\) that can be estimated (see Nyquist theorem):
\begin{equation}
F\_{\text{max}} = \frac{1}{2} F\_s
\end{equation}
</div>
<div class="important">
The duration of excitation \\(T\_{\text{exc}}\\) will determine the minimum frequency \\(F\_{\text{min}}\\) that can be estimated:
\begin{equation}
F\_{\text{min}} = \frac{1}{T\_{\text{exc}}}
\end{equation}
It will also corresponds to the frequency resolution \\(\Delta f\\):
\begin{equation}
\Delta f = \frac{1}{T\_{\text{exc}}}
\end{equation}
</div>
In order to increase the estimation quality, averaging can be use with a longer excitation duration.
A factor 10 is usually good enough, therefore the excitation time can be taken as:
\begin{equation}
T\_{\text{exc}} \approx \frac{10}{F\_{\text{min}}}
\end{equation}
<div class="exampl">
Therefore, if the system has to be identified from 1Hz up to 500Hz, the sampling frequency should be:
\begin{equation}
F\_s = 2 F\_{\text{max}} = 1\\,\text{kHz}
\end{equation}
Then, the excitation duration should be (10 averaging):
\begin{equation}
T\_{\text{exc}} = \frac{10}{1} = 10\\,s
\end{equation}
</div>
### Computation of the Frequency Response Function {#computation-of-the-frequency-response-function}
#### Windowing Function {#windowing-function}
#### Example {#example}
`tfestimate`
```matlab
[G, f] = tfestimate(u, y, win, [], [], 1/Ts);
```
### Verification of the Identification Quality {#verification-of-the-identification-quality}
`mscohere`
```matlab
[coh, f] = mscohere(u, y, win, [], [], 1/Ts);
```
## Reference Books {#reference-books}
- (<a href="#citeproc_bib_item_1">Pintelon and Schoukens 2012</a>)
- (<a href="#citeproc_bib_item_2">Schoukens, Pintelon, and Rolain 2012</a>)
## Bibliography {#bibliography}
<style>.csl-entry{text-indent: -1.5em; margin-left: 1.5em;}</style><div class="csl-bib-body">
<div class="csl-entry"><a id="citeproc_bib_item_1"></a>Pintelon, Rik, and Johan Schoukens. 2012. <i>System Identification : a Frequency Domain Approach</i>. Hoboken, N.J. Piscataway, NJ: Wiley IEEE Press. doi:<a href="https://doi.org/10.1002/9781118287422">10.1002/9781118287422</a>.</div>
<div class="csl-entry"><a id="citeproc_bib_item_2"></a>Schoukens, Johan, Rik Pintelon, and Yves Rolain. 2012. <i>Mastering System Identification in 100 Exercises</i>. John Wiley &#38; Sons.</div>
</div>