<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>basics blog</title>
<link>https://basics2022.github.io/myblog/</link>
<atom:link href="https://basics2022.github.io/myblog/index.xml" rel="self" type="application/rss+xml"/>
<description>Basics blog</description>
<generator>quarto-1.8.26</generator>
<lastBuildDate>Thu, 30 Apr 2026 22:00:00 GMT</lastBuildDate>
<item>
  <title>Central limit theorem - why and when Gaussian distributions appear</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/central-limit-thm/</link>
  <description><![CDATA[ 





<p>In many introductory physics classes and labs, students are frequently taught that measurements will follow a Gaussian distribution. However, this is often a misunderstanding of how the normal distribution arises. Physical populations can follow many non-Gaussian distributions.</p>
<!--
due to natural constraints, such as the thresholds imposed by industrial quality control or biological limits. 
-->
<p>This post explores why the Gaussian distribution is not an inherent property of individual measurements, but rather a property of the sample average, as described by the Central Limit Theorem (CLT).</p>
<section id="population-distribution-px" class="level2">
<h2 class="anchored" data-anchor-id="population-distribution-px">Population distribution, <img src="https://latex.codecogs.com/png.latex?p(x)"></h2>
<p>Before looking at sample averages, the “ground truth” of our data is built. In this example, population has weight with a probability density distribution <img src="https://latex.codecogs.com/png.latex?p(x)">, resulting as an example from a factory production line for pens. While the machine produces a standard spread, a quality control process rejects any pen weighing less than a specific threshold (e.g., 10g).</p>
<p>The resulting distribution of this process is a left-truncated Gaussian: it features a sharp “cliff” on the left and a natural decay on the right. Clearly, the individual items in this population do not follow a standard bell curve.</p>
<p><strong>Remark.</strong> Different processes may produce individuals following different probability densities. As an example, there’s a bimodal distribution already implemented: just open this file in Colab, clicking on the button <strong>“Open in Colab”</strong>, under the Code Links, uncomment those lines and run this script.</p>
<div id="0a11bff9-4dd0-4b7e-80bd-ccf69dab980c" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[&quot;hide-input&quot;]" data-execution_count="40">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb1-3"></span>
<span id="cb1-4">np.random.seed(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span>)</span>
<span id="cb1-5"></span>
<span id="cb1-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Create a non-Gaussian population:</span></span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Left truncated Gaussian</span></span>
<span id="cb1-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1. Standard Gaussian</span></span>
<span id="cb1-10">mu_factory <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.5</span></span>
<span id="cb1-11">sigma_factory <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4</span></span>
<span id="cb1-12">raw_production <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.random.normal(mu_factory, sigma_factory, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">15000</span>)</span>
<span id="cb1-13"></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 2. Apply Quality Control: Cut everything below 9.2g</span></span>
<span id="cb1-15">threshold <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.</span></span>
<span id="cb1-16">population <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> raw_production[raw_production <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> threshold]</span>
<span id="cb1-17"></span>
<span id="cb1-18">pop_size <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(population)</span>
<span id="cb1-19"></span>
<span id="cb1-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb1-21"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Bimodal distribution</span></span>
<span id="cb1-22"></span>
<span id="cb1-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 40% are "Light" pens (10g), 60% are "Heavy" pens (15g)</span></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">pop_size = 100_000</span></span>
<span id="cb1-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">group1 = np.random.normal(10, 0.8, int(pop_size * 0.4))</span></span>
<span id="cb1-26"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">group2 = np.random.normal(15, 1.5, int(pop_size * 0.6))</span></span>
<span id="cb1-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">population = np.concatenate([group1, group2])</span></span>
<span id="cb1-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">"""</span></span>
<span id="cb1-29"></span>
<span id="cb1-30">plt.figure(figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb1-31">plt.hist(population, bins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'lightgray'</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'gray'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb1-32">plt.axvline(np.mean(population), color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'red'</span>, linestyle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'--'</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f'Mean: </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>np<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mean(population)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:.2f}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">'</span>)</span>
<span id="cb1-33">plt.title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Physical Population $p(x)$: Weights of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>pop_size<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Individual Pens"</span>)</span>
<span id="cb1-34">plt.xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Weight (g)"</span>)</span>
<span id="cb1-35">plt.ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Count"</span>)</span>
<span id="cb1-36">plt.legend()</span>
<span id="cb1-37">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/central-limit-thm/index_files/figure-html/cell-2-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="the-fallacy-more-samples-make-the-distribution-gaussian" class="level2">
<h2 class="anchored" data-anchor-id="the-fallacy-more-samples-make-the-distribution-gaussian">The fallacy: “more samples make the distribution Gaussian”</h2>
<p>A common misunderstanding is that collecting more data will “fix the distribution” and make it look normal. This is not true! Sampling individuals from the population, as the number of individuals <img src="https://latex.codecogs.com/png.latex?n"> in a sample increases they follow the very same distribution <img src="https://latex.codecogs.com/png.latex?p(x)"> of the whole population.</p>
<p>As the sample size is increased from <img src="https://latex.codecogs.com/png.latex?50"> to <img src="https://latex.codecogs.com/png.latex?5000"> individuals, the histogram simply becomes a more accurate representation of the truncated population with probability density <img src="https://latex.codecogs.com/png.latex?p(x)">. The “cliff” of the left-truncated distribution remains vertical. This shows that a large dataset of individual measurements does not “naturally become Gaussian” if the underlying population is not.</p>
<div id="0e20e103-22a2-4f04-8dc2-f1ed079bb53d" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[&quot;hide-input&quot;]" data-execution_count="41">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1">sample_sizes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">500</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5000</span>]</span>
<span id="cb2-2"></span>
<span id="cb2-3">fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb2-4"></span>
<span id="cb2-5"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(sample_sizes):</span>
<span id="cb2-6">    sample <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.random.choice(population, size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)</span>
<span id="cb2-7">    axes[i].hist(sample, bins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'salmon'</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'black'</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8</span>)</span>
<span id="cb2-8">    axes[i].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Sample of </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;"> Individuals"</span>)</span>
<span id="cb2-9">    axes[i].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Weight (g)"</span>)</span>
<span id="cb2-10"></span>
<span id="cb2-11">plt.suptitle(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, fontsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">16</span>)</span>
<span id="cb2-12">plt.tight_layout()</span>
<span id="cb2-13">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/central-limit-thm/index_files/figure-html/cell-3-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="correct-application-of-the-central-limit-theorem" class="level2">
<h2 class="anchored" data-anchor-id="correct-application-of-the-central-limit-theorem">Correct application of the central limit theorem</h2>
<p>The Central Limit Theorem (CLT) makes a very specific claim: it is not the individuals that become Gaussian, but the sum (or sample average, <img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_n">) of those individuals,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_n%20:=%20%5Cfrac%7B1%7D%7Bn%7D%20%5Csum_%7Bk=1%7D%20x_k%20%5C%20."></p>
<p>To see this, we take many random “samples”, each of <img src="https://latex.codecogs.com/png.latex?n"> individuals and calculate the average weight for each cluster.</p>
<p>This process is repeated for different values of <img src="https://latex.codecogs.com/png.latex?n">. As the number <img src="https://latex.codecogs.com/png.latex?n"> increases, the sample average tends to a random variable with a Gaussian probability distribution, centered at the population mean <img src="https://latex.codecogs.com/png.latex?%5Cmu">, and with variance that decreases with <img src="https://latex.codecogs.com/png.latex?1/n">, i.e.&nbsp;for “large” <img src="https://latex.codecogs.com/png.latex?n"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Coverline%7BX%7D_n%20%5Csim%20%5Cmathscr%7BN%7D%5Cleft(%20%5Cmu%20,%20%5Cfrac%7B%5Csigma%5E2%7D%7Bn%7D%20%5Cright)%20%5C%20,"></p>
<p>being <img src="https://latex.codecogs.com/png.latex?%5Csigma%5E2"> the (finite) variance of the population <img src="https://latex.codecogs.com/png.latex?p(x)">.</p>
<div id="86977ad0-50a9-4251-8cf9-a1a9284e6e43" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[&quot;hide-input&quot;]" data-execution_count="32">
<details class="code-fold">
<summary>Show the code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">def</span> plot_sampling_distribution(pop, n_values, iterations<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>):</span>
<span id="cb3-2">    fig, axes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">len</span>(n_values), figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">18</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb3-3">    </span>
<span id="cb3-4">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i, n <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">enumerate</span>(n_values):</span>
<span id="cb3-5">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># The CLT step: calculate the mean of 'n' random pens, 2000 times</span></span>
<span id="cb3-6">        sample_means <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> [np.mean(np.random.choice(pop, size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>n)) <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> _ <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">range</span>(iterations)]</span>
<span id="cb3-7">        </span>
<span id="cb3-8">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plotting the means</span></span>
<span id="cb3-9">        axes[i].hist(sample_means, bins<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'skyblue'</span>, edgecolor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'navy'</span>, density<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">True</span>, alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>)</span>
<span id="cb3-10">        </span>
<span id="cb3-11">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Add a theoretical normal curve for comparison</span></span>
<span id="cb3-12">        mu <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.mean(pop)</span>
<span id="cb3-13">        sigma_mean <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.std(pop) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> np.sqrt(n)</span>
<span id="cb3-14">        x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="bu" style="color: null;
background-color: null;
font-style: inherit;">min</span>(sample_means), <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">max</span>(sample_means), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span>)</span>
<span id="cb3-15">        p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> (<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (sigma_mean <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.sqrt(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi))) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.exp(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> ((x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> mu) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> sigma_mean)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb3-16">        axes[i].plot(x, p, color<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'darkblue'</span>, linewidth<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'Normal Dist.'</span>)</span>
<span id="cb3-17">        </span>
<span id="cb3-18">        axes[i].set_title(<span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">f"Distribution of Means (n=</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span>n<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">)"</span>)</span>
<span id="cb3-19">        axes[i].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Average Weight (g)"</span>)</span>
<span id="cb3-20">        <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> i <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>: axes[i].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Probability Density"</span>)</span>
<span id="cb3-21"></span>
<span id="cb3-22">plot_sampling_distribution(population, n_values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span>])</span>
<span id="cb3-23">plt.tight_layout()</span>
<span id="cb3-24">plt.show()</span></code></pre></div></div>
</details>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/central-limit-thm/index_files/figure-html/cell-4-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="links-and-references" class="level2">
<h2 class="anchored" data-anchor-id="links-and-references">Links and references</h2>
<ul>
<li><a href="https://basics2022.github.io/bbooks-programming-hs/ch/statistics/sampling.html">Sampling, sampling average, central limit theorem, Gaussian and Student’s <img src="https://latex.codecogs.com/png.latex?t">-distribution</a>, in <em>Introduzione alla programmazione, al calcolo scientifico e alla statistica</em></li>
<li>…</li>
</ul>


</section>

 ]]></description>
  <category>statistics</category>
  <category>central limit theorem</category>
  <guid>https://basics2022.github.io/myblog/posts/central-limit-thm/</guid>
  <pubDate>Thu, 30 Apr 2026 22:00:00 GMT</pubDate>
</item>
<item>
  <title>Compressible fluid mechanics and finite volume method</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/hyperbolic-equations/</link>
  <description><![CDATA[ 





<!--
draft: true
-->
<p>This post acts as an introduction to or the landing page of a “meta-course” on compressible fluid mechanics and finite volume method.</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: left;">Topics</th>
<th style="text-align: left;">Main contents</th>
<th style="text-align: left;">Primary link</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">Physics of Compressible Fluids</td>
<td style="text-align: left;">From physics principles to Euler equations</td>
<td style="text-align: left;"><a href="https://basics2022.github.io/bbooks-fluid-mechanics/ch/compressible/intro.html">Fluid Mechanics: Compressible Fluid Mechanics</a></td>
</tr>
<tr class="even">
<td style="text-align: left;">Mathematics of Hyperbolic PDEs</td>
<td style="text-align: left;">Eigenstructure and characteristics of differential equation; discontinuities from integral equations</td>
<td style="text-align: left;"><a href="https://basics2022.github.io/bbooks-math-miscellanea/ch/pde/hyperbolic.html">Math: PDEs: Hyperbolic Equations</a></td>
</tr>
<tr class="odd">
<td style="text-align: left;">Numerical methods for Hyperbolic PDEs</td>
<td style="text-align: left;">Physics-based schemes in FVM: non-linear Riemann solvers (Godunov) and linearized solvers (Roe)</td>
<td style="text-align: left;"><a href="https://basics2022.github.io/bbooks-math-miscellanea/ch/pde/fvm-hyperbolic-pde.html">Math: Numerical Methods for PDEs: Finite Volume Method</a></td>
</tr>
</tbody>
</table>
<section id="the-physics" class="level2">
<h2 class="anchored" data-anchor-id="the-physics">The physics</h2>
<p><strong>Differential equations.</strong> Euler equations are the local (differential) form of three fundamental principles of classical mechanics:</p>
<ol type="1">
<li>conservation of mass</li>
<li>second principle of Newtonian mechanics, or balance of momentum</li>
<li>first principle of Thermodynamics, or balance of total energy</li>
</ol>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20&amp;%20%5Cpartial_t%20%5Crho%20+%20%5Cnabla%20%5Ccdot%20(%20%5Crho%20%5Cmathbf%7Bu%7D%20)%20=%200%20%5C%5C%0A%20%20&amp;%20%5Cpartial_t%20(%20%5Crho%20%5Cmathbf%7Bu%7D%20)%20+%20%5Cnabla%20%5Ccdot%20%5Cleft(%20%5Crho%20%5Cmathbf%7Bu%7D%20%5Cmathbf%7Bu%7D%20+%20p%20%5Cright)%20=%20%5Crho%20%5Cmathbf%7Bg%7D%20%5C%5C%0A%20%20&amp;%20%5Cpartial_t%20%5Cleft(%20%5Crho%20e%5Et%20%5Cright)%20+%20%5Cnabla%20%5Ccdot%20%5Cleft(%20%5Crho%20h%5Et%20%5Cmathbf%7Bu%7D%20%5Cright)%20=%20%5Crho%20%5Cmathbf%7Bg%7D%20%5Ccdot%20%5Cmathbf%7Bu%7D%20%5C%5C%0A%5Cend%7Baligned%7D"></p>
<p>in the limit of <strong>negligible viscosity and heat conduction</strong>, supplemented with proper:</p>
<ul>
<li>constitutive equations describing the behavior of the medium of interest,</li>
<li>boundary conditions</li>
<li>initial conditions.</li>
</ul>
<p>Differential equations hold only in regions of space where the functions involved are continuous and sufficient regular for the derivativesi appearing in the equations to exist.</p>
<p>Neglecting diffusive terms (viscous stress and heat conduction), Navier-Stokes equations become Euler equations. While Navier-Stokes equations contain second-order derivatives in space (e.g.&nbsp;the Laplacian of the velocity in viscous stress, and the Laplacian of temperature in heat conduction flux), Euler equations are first orde. While Navier-Stokes equations are not prone to produce discontinuous solutions, <strong>discontinuities</strong> (like shock waves) naturally arises in Euler equations.</p>
<p>Fields involved in Euler equations may be not continuous across a discontiuity. Thus, across a discontinuity, the differential form of the equations is likely to fail, while integral equations are still valid (not having the same regularity assumptions required by differential equations, to be derived from the integral equations, namely no divergenvce theorem is required).</p>
<p><strong>Integral equations.</strong> For a control volume <img src="https://latex.codecogs.com/png.latex?V"> at rest</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20&amp;%20%5Cfrac%7Bd%7D%7Bdt%7D%20%5Cint_V%20%5Crho%20+%20%5Coint_%7B%5Cpartial%20V%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20(%20%5Crho%20%5Cmathbf%7Bu%7D%20)%20=%200%20%5C%5C%0A%20%20&amp;%20%5Cfrac%7Bd%7D%7Bdt%7D%20%5Cint_V%20%5Crho%20%5Cmathbf%7Bu%7D%20+%20%5Coint_%7B%5Cpartial%20V%7D%20%5Crho%20%5Cmathbf%7Bu%7D%20%5Cmathbf%7Bu%7D%20%5Ccdot%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20+%20%5Coint_%7B%5Cpartial%20V%7D%20p%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20=%20%5Cint_%7BV%7D%20%5Crho%20%5Cmathbf%7Bg%7D%20%5C%5C%0A%20%20&amp;%20%5Cfrac%7Bd%7D%7Bdt%7D%20%5Cint_V%20%5Crho%20e%5Et%20+%20%5Coint_%7B%5Cpartial%20V%7D%20%5Crho%20e%5Et%20%5Cmathbf%7Bu%7D%20%5Ccdot%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20+%20%5Coint_%7B%5Cpartial%20V%7D%20p%20%5Cmathbf%7Bu%7D%20%5Ccdot%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20=%20%5Cint_%7BV%7D%20%5Crho%20%5Cmathbf%7Bg%7D%20%5Ccdot%20%5Cmathbf%7Bu%7D%20%5C%5C%0A%5Cend%7Baligned%7D"></p>
<p>Integral equations for an arbitrary volume <img src="https://latex.codecogs.com/png.latex?v_t"> can be written Using <strong>Reynolds’ transport theorem</strong>. These equations provides:</p>
<ul>
<li><strong>jump conditions</strong> across discontinuities</li>
<li><strong>arbitrary Lagrangian Eulerian</strong> description of the problem, that can be useful for moving domains</li>
</ul>
</section>
<section id="the-mathematical-features" class="level2">
<h2 class="anchored" data-anchor-id="the-mathematical-features">The mathematical features</h2>
<p>Euler equations are an example of a non-linear hyperbolic system of equations. In this section, general hyperbolic problems</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cpartial_t%20%5Cmathbf%7Bu%7D%20+%20%5Cnabla%20%5Ccdot%20%5Cmathbf%7BF%7D(%5Cmathbf%7Bu%7D)%20=%20%5Cmathbf%7Bs%7D%20%5C%20,"></p>
<p>are introduced and their features are discussed.</p>
<p><strong>todo</strong></p>
<ul>
<li><p>conservative and convective form of the differential equations</p></li>
<li><p>spectral decomposition of the convection matrix</p></li>
<li><p>origin of speed of sound</p></li>
<li><p>velocity of propagation of the info</p></li>
<li><p>continuous solutions</p></li>
<li><p>discontinuous solutions (speed of the shock and Rankine-Hugoniot conditions)</p></li>
<li><p>infinite non-physical solutions; entropy condition to select the physical solution among them</p></li>
<li><p>Riemann problem: definition; solution of the Riemann problem is used in physics-based numerical schemes</p></li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/hyperbolic-equations/riemann-psys.png" class="img-fluid figure-img"></p>
<figcaption>Phase state of the Riemann problem for a P-sys, see <a href="https://basics2022.github.io/bbooks-fluid-mechanics/ch/compressible/riemann-problem-psys.html">Fluid Mechanics: Compressible Fluid Mechanics: P-system</a>.</figcaption>
</figure>
</div>
</section>
<section id="the-numerical-realization" class="level2">
<h2 class="anchored" data-anchor-id="the-numerical-realization">The numerical realization</h2>
<p>The Finite Volume Method (FVM) is the natural choice for hyperbolic conservation laws because it is derived directly from the <strong>integral form of the governing equations</strong>. Rather than approximating derivatives at discrete points, FVM enforces the balance of fluxes across the boundaries of discrete control volumes (cells).</p>
<p>In its simplest form, the numerical solution is represented as piecewise constant, where physical fields are averaged within each cell. The core challenge in developing an FVM scheme lies in the design of the <strong>numerical flux at cell interfaces</strong>. This flux must be carefully constructed not only for stability but to act as a mathematical “selection principle,” ensuring that the captured solution is the unique physical solution (the entropy solution) among the infinite set of weak solutions allowed by the mathematics of hyperbolic PDEs.</p>
<p><strong>Godunov scheme</strong> treates the jump between fields in two adjacent cells as a local Riemann problem. The scheme solves the Riemann problem to find the <em>state at the boundary</em>, and uses that state to compute the numerical flux. Riemann problem is a non-linear problem that could be computationally expensive to solve at every time-step for every cell interface. To reduce the computational cost, <strong>Roe method</strong> intoruces a local linearization of the problem at each interface. Convection matrix is evaluated on the <em>Roe intermediate state</em>, and its spectrum is used to build an upwind scheme that, combined with entropy fix schemes, introduces enough numerical diffusion to select the physical solution.</p>
<p><strong>todo</strong> - CFL condition - theorems about flux: stability vs.&nbsp;accuracy - high-order schemes - …</p>


</section>

 ]]></description>
  <category>fluid mechanics</category>
  <category>hyperbolic equations</category>
  <category>finite volume method</category>
  <guid>https://basics2022.github.io/myblog/posts/hyperbolic-equations/</guid>
  <pubDate>Thu, 12 Mar 2026 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Quadratic Equations and Conics</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/conics-quadratic-forms/</link>
  <description><![CDATA[ 





<p>This</p>
<p><strong>Introduction.</strong></p>
<p><strong>Geometry.</strong> Different definitions:</p>
<ul>
<li>as plane sections of a conical surface<br>
</li>
<li>in terms of eccentricity<br>
</li>
<li>in terms of distances from the foci</li>
</ul>
<p><strong>Analytical geometry and algebra.</strong> If the two independent variables <img src="https://latex.codecogs.com/png.latex?x">, <img src="https://latex.codecogs.com/png.latex?y"> represent the Cartesian coordinates of points in the plane, the second-degree polynomial equation</p>
<p><img src="https://latex.codecogs.com/png.latex?%0AA%20x%5E2%20+%20B%20x%20y%20+%20C%20y%5E2%20+%20D%20x%20+%20E%20y%20+%20F%20=%200%20%5C%20,%0A"></p>
<p>when it admits real solutions, defines the set of points of a regular or degenerate conic section, see <a href="https://basics2022.github.io/bbooks-math-miscellanea-hs/ch/analytic_geometry/analytic_geometry_2d/conics-and-quadratic-forms.html">Math:Analytic Geometry:Conics and Quadratic Forms</a>.</p>
<p><strong>Geometric properties.</strong></p>
<p>…</p>
<p><strong>Physics.</strong></p>
<ul>
<li><p>Gravitation, trajectories in the two-body problem, see <a href="https://basics2022.github.io/bbooks-physics-hs/ch/mechanics/dynamics-central.html">Physics:Mechanics:Dynamics:Central motions</a></p></li>
<li><p>Trajectories of two electric charges, as in the<br>
<a href="https://basics2022.github.io/bbooks-physics-hs/ch/modern/experiments-matter.html#modello-atomico-di-rutherford-geiger-mardsen">Physics:XX Century Physics:Rutherford–Geiger–Marsden scattering experiment</a>, through which the Rutherford atomic model was formulated. This model predicts that the atom is mostly empty space with a positively charged nucleus. The three scientists bombarded a thin gold foil with positively charged () particles and observed a scattering pattern compatible with hyperbolic trajectories—those followed by a charged particle under the electric field generated by another point charge of the same sign, kept at rest.</p></li>
</ul>
<!--
**Introduction.**

**Geometria.** Diverse definizioni:

- come sezioni piane di una superficie conica
- in termini di eccentricità
- in termini di distanze dai fuochi

**Geometria analitica e algebra.** Se le due variabili indipendenti $x$, $y$ indicano le due coordinate cartesiane per identificare i punti di un piano, l'equazione polinomiale di secondo grado 

$$A x^2 + B xy + C y^2 + D x + E + F = 0 \ ,$$

quando ammette soluzioni reali, definisce i punti di una sezione conica regolare o degenere.

**Proprietà geometriche.**

...

**Fisica.**

- Gravitazione, traiettorie nel problema dei due corpi [Fisica:meccanica:dimanica:moti centrali](https://basics2022.github.io/bbooks-physics-hs/ch/mechanics/dynamics-central.html)
- Traiettoria di due cariche elettrice, come nell'[esperimento di scattering di Rutherford-Geiger-Mardsen](https://basics2022.github.io/bbooks-physics-hs/ch/modern/experiments-matter.html#modello-atomico-di-rutherford-geiger-mardsen), grazie al quale è stato formulato il modello atomico di Rutherford, che prevede che l'atomo sia principalmente vuoto di materia e con un nucleo positivo: i tre scienziati bombardarono una sottile lamina d'oro con delle particelle $\alpha$ &mdash; di carica positiva &mdash; e ottennero uno scattering compatibile con traiettorie iperboliche, traiettorie seguite da una particella di carica elettrica soggetta al campo elettrico generato da un'altra carica puntiforme di carica concorde e mantenuta in quiete.
-->
<!--

Conic sections are among the first curves where algebra and geometry truly start to speak the same language. On the surface, ellipses, parabolas, and hyperbolas look like simple shapes—often introduced early in mathematics education as loci or as intersections of a plane with a cone. Yet, behind these familiar figures lies a remarkably rich structure that makes conics an ideal playground for analytical geometry and linear algebra.

From a mathematical point of view, conics offer a natural context in which to train essential tools: coordinate changes, quadratic forms, diagonalization, eigenvalues, and invariants. Starting from a single second-degree equation in two variables, one can uncover an entire taxonomy of curves through systematic algebraic manipulation. This process is not just a technical exercise—it reveals how geometry is encoded in algebra, and how different equations can describe the same geometric object once the right coordinates are chosen.

Beyond their algebraic elegance, conic sections possess striking geometric properties. Reflection laws of ellipses and parabolas, focal definitions, and symmetry principles give these curves a special role in optics, mechanics, and geometry. These properties are not mathematical curiosities: they explain why parabolic mirrors focus light, why whispering galleries work, and why certain trajectories arise naturally in physical systems.

Conics also appear everywhere in science and engineering. Planetary orbits in gravitational fields are ellipses, escape trajectories are parabolas or hyperbolas, and the paths of particles under central forces often reduce to conic sections. Even repulsive interactions, such as those between like electric charges, lead naturally to hyperbolic motion. Understanding conics, therefore, means understanding a common geometric language shared across physics, astronomy, and engineering.

The main goal of this post is to take a comprehensive look at conic sections starting from the most general quadratic equation in two variables. Rather than focusing only on the “classical” non-degenerate cases, we will systematically explore all possibilities: regular conics, degenerate cases (such as pairs of lines or a single point), and even equations that correspond to no real curve at all. This complete classification is rarely presented in detail, yet it is precisely where algebra, geometry, and interpretation come together most clearly. In that sense, conics are not just a basic topic—they are a perfect example of how much depth can be hidden inside simple equations.

-->



 ]]></description>
  <category>conics</category>
  <category>quadratic equations</category>
  <category>analytic geometry</category>
  <category>linear algebra</category>
  <guid>https://basics2022.github.io/myblog/posts/conics-quadratic-forms/</guid>
  <pubDate>Thu, 15 Jan 2026 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Natural modes in structures</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/modes-in-structures/</link>
  <description><![CDATA[ 





<p>This post tries to answer a narrow <a href="https://physics.stackexchange.com/questions/864252/fixed-vs-free-ends-in-1d-standing-waves">question</a> I’ve found on Physics SE, mainly about some doubts the OP<sup>1</sup> had about standing waves — or natural or proper modes of vibration —, their definition and the role of boundary conditions in the differential problem, and response to external forcing arising from the YouTube video, <a href="https://www.youtube.com/watch?si=Ewe45KtT3trKdzPS&amp;v=-gr7KmTOrx0&amp;feature=youtu.be">Standing Waves Parti I: Demonstration</a>, by <a href="James Dann, Ph.D">James Dann, Ph.D</a>.</p>
<section id="natural-modes" class="level2">
<h2 class="anchored" data-anchor-id="natural-modes">Natural modes</h2>
<p>Many structural problems are governed by a differential problem, whose discret(ized) counterpart is a second order dynamical system,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BM%7D%20%5Cddot%7B%5Cmathbf%7Bu%7D%7D%20+%20%5Cmathbf%7BC%7D%20%5Cdot%7B%5Cmathbf%7Bu%7D%7D%20+%20%5Cmathbf%7BK%7D%20%5Cmathbf%7Bu%7D%20=%20%5Cmathbf%7Bf%7D%20%5C%20,"></p>
<p>supplied with the proper conditions on the state <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bu%7D(t)">, like initial values of the function and its first derivative for <em>Cauchy problems (or initial value problems)</em>,</p>
<details>
<summary>
Remarks
</summary>
<ul>
<li><p>This is a linear problem, and its solution can be written as a linear combination of a set of solutions</p></li>
<li><p>Proper modes: a <em>basis</em> for the non-trivial solution of the homogenous problem, i.e.&nbsp;the response of the system to a free system with no external forcing, to a non-zero initial condition</p></li>
<li><p>Mass matrix <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BM%7D"> and stiffness matrix <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BK%7D"> are <strong>symmetric</strong>, if dynamical equations are derived with a Lagrangian approach. <a href="https://basics2022.github.io/bbooks-physics-mechanics/ch/lagrange-properties.html">Here a proof for rigid-body mechanical systems</a>.</p></li>
<li><p>If no rigid degree of freedom exists, stiffness matrix is definite positive. If <img src="https://latex.codecogs.com/png.latex?n_r"> independent degrees of freedom exists, stiffness matrix is semi-definite positive with a kernel of dimension <img src="https://latex.codecogs.com/png.latex?n_r"> (or it’s <img src="https://latex.codecogs.com/png.latex?n_r"> times singular).</p></li>
<li><p>If there’s no degree of freedom associated with zero-inertia, mass matrix is definite positive. Independent d.o.f.s with zero-inertia are usually associated with algebraic constraints: if corresponding d.o.f.s are not expressed as a function of the other d.o.f.s, mass matrix is semi-definite positive (with kernel of dimension <img src="https://latex.codecogs.com/png.latex?n_c">, whose elements are the mass-less d.o.f.s; or it’s <img src="https://latex.codecogs.com/png.latex?n_c"> times singular), and the governing equations can be written as a system of <em>DAE</em>s (dynamical-algebraic equations).</p></li>
<li><p>The modes of an undamped system, <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D%20=%20%5Cmathbf%7B0%7D">, simultaneously diagonalize mass and stiffness matrices. As a consequence of matrix symmetry, it’s easy to prove that modes are mutually orthogonal through mass and stiffness matrices</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20%20%5Cmathbf%7Bu%7D_i%5ET%20%5Cmathbf%7BM%7D%20%5Cmathbf%7Bu%7D_j%20&amp;%20=%20m_i%20%5Cdelta_%7Bij%7D%20&amp;%20%5Ctext%7B(no%20sum)%7D%20%5C%5C%0A%20%20%20%5Cmathbf%7Bu%7D_i%5ET%20%5Cmathbf%7BK%7D%20%5Cmathbf%7Bu%7D_j%20&amp;%20=%20k_i%20%5Cdelta_%7Bij%7D%20&amp;%20%5Ctext%7B(no%20sum)%7D%20%5C%5C%0A%5Cend%7Baligned%7D"></p></li>
<li><p>Mechanical systems with no dampers usually have <strong>small damping</strong>. This condition is treated in detail <a href="https://basics2022.github.io/bbooks-physics-continuum-mechanics/ch/solids/structural-damping.html">here</a>. In the small-damping regime, damping matrix <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D"> can be treated as a small perturbation of the undamped system, and two assumptions emerge as reasonable assumptions:</p>
<ul>
<li><p><img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D"> is semi-definite positive</p></li>
<li><p>modal basis <img src="https://latex.codecogs.com/png.latex?%5C%7B%20%5Chat%7B%5Cmathbf%7Bu%7D%7D_i%20%5C%7D"> makes the damping matrix <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7BC%7D"> diagonal</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Chat%7B%5Cmathbf%7Bu%7D%7D%5ET_i%20%5Cmathbf%7BC%7D%20%5Chat%7B%5Cmathbf%7Bu%7D%7D_j%20=%20c_i%20%5Cdelta_%7Bij%7D%20%5C%20,"></p>
<p>as well.</p></li>
</ul></li>
<li><p>If many eigenvectors exist with the same eigenvalue, it’s possible to define an orthogonal basis of that subspace</p></li>
<li><p>…</p></li>
</ul>
</details>
</section>
<section id="string" class="level2">
<h2 class="anchored" data-anchor-id="string">String</h2>
<section id="governing-equations" class="level3">
<h3 class="anchored" data-anchor-id="governing-equations">Governing equations</h3>
<p>The transverse displacement <img src="https://latex.codecogs.com/png.latex?u(x,t)"> of a string with axial (tension) pre-load <img src="https://latex.codecogs.com/png.latex?N_0"> and linear mass density <img src="https://latex.codecogs.com/png.latex?m"> is governed by the partial differential equation</p>
<p><img src="https://latex.codecogs.com/png.latex?-%20m%20%5Cddot%7Bu%7D%20+%20N_0%20u''%20=%20f"></p>
<p>supplied with proper boundary and initial conditions. Here <img src="https://latex.codecogs.com/png.latex?f(x,t)"> is the transverse force per unit-length acting on the string.</p>
</section>
<section id="natural-modes-1" class="level3">
<h3 class="anchored" data-anchor-id="natural-modes-1">Natural modes</h3>
</section>
<section id="response-to-motion-of-an-extreme-point-as-external-forcing" class="level3">
<h3 class="anchored" data-anchor-id="response-to-motion-of-an-extreme-point-as-external-forcing">Response to motion of an extreme point (as external forcing)</h3>
<p>Exploiting the linearity of the problem, the solution can be written as the sum of a forced and an homogeneous part,</p>
<p><img src="https://latex.codecogs.com/png.latex?u(x,t)%20=%20u_0(x,t)%20+%20u_p(x,t)%20%5C%20."></p>
<p><em>…some words about slow and fast contributions in structural mechanics, direct truncation and mode acceleration,…</em></p>
<p>Here <img src="https://latex.codecogs.com/png.latex?f%20=%200">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20-%20m%20%5Cddot%7Bu%7D%20+%20N_0%20u''%20=%200%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$(x,t)%20%5Cin%20%5B0,b%5D%20%5Ctimes%20%5B0,%20t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u(0,t)%20=%200%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$t%20%5Cin%20%5B0,t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u(b,t)%20=%20u_B(t)%20%5C%5C%0A%20%20u(x,0)%20=%20u_0(x)%20%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$x%20%5Cin%20%5B0,b%5D$%7D%20%5C%5C%0A%20%20%5Cdot%7Bu%7D(x,0)%20=%20v_0(x)%0A%5Cend%7Bcases%7D"></p>
<section id="fast-part" class="level4">
<h4 class="anchored" data-anchor-id="fast-part">Fast part</h4>
<p>Fast part of the solution takes into account non-homogeneous boundary conditions and other external forces. It can be defined through its governing equation</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20N_0%20u''_p%20=%200%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$(x,t)%20%5Cin%20%5B0,b%5D%20%5Ctimes%20%5B0,%20t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u_p(0,t)%20%20=%200%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$t%20%5Cin%20%5B0,t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u_p(b,t)%20%20=%20u_B(t)%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
<p>whose solution reads</p>
<p><img src="https://latex.codecogs.com/png.latex?u_p(x,t)%20=%20u_B(t)%20%5Cfrac%7Bx%7D%7Bb%7D%20%5C%20."></p>
</section>
<section id="slow-part" class="level4">
<h4 class="anchored" data-anchor-id="slow-part">Slow part</h4>
<p>Slow part takes into account the remaining part of the problem</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20-%20m%20%5Cddot%7Bu%7D_0%20+%20N_0%20u''_0%20=%20m%20%5Cddot%7Bu%7D_p%20-%20N_0%20%5Cunderbrace%7Bu''_p%7D_%7B=0%7D%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$(x,t)%20%5Cin%20%5B0,b%5D%20%5Ctimes%20%5B0,%20t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u_0(0,t)%20%20=%200%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$t%20%5Cin%20%5B0,t_%7Bmax%7D%5D$%7D%20%5C%5C%0A%20%20u_0(b,t)%20%20=%200%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5C%5C%0A%20%20u_0(x,0)%20%20=%20u(x,0)%20-%20u_p(x,0)%20%20%20%20%20%20%20%20%20%20&amp;%20,%20%5Cquad%20%5Ctext%7B$x%20%5Cin%20%5B0,b%5D$%7D%20%20%20%20%20%20%20%5C%5C%0A%20%20%5Cdot%7Bu%7D_0(x,0)%20=%20%5Cdot%7Bu%7D(x,0)%20-%20%5Cdot%7Bu%7D_p(x,0)%0A%5Cend%7Bcases%7D"></p>
<p>The solution of this problem can be written as a linear combination</p>
<p><img src="https://latex.codecogs.com/png.latex?u_0(x,t)%20=%20%5Csum_n%20g_n(t)%20%5C,%20f_n(x)%20%5C%20,"></p>
<p>of the proper modes,</p>
<p><img src="https://latex.codecogs.com/png.latex?f_n(x)%20=%20%5Csin%20%5Cleft(%20k_n%20x%20%5Cright)%20%5C%20,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?k_n%20=%20%5Cfrac%7Bn%20%5Cpi%7D%7Bb%7D">, whose time-dependent amplitudes read</p>
<p><img src="https://latex.codecogs.com/png.latex?g_n(t)%20=%20a_n%20%5Ccos%20%5Cleft(%20%5Comega_n%20t%20%5Cright)%20+%20b_n%20%5Csin%20%5Cleft(%20%5Comega_n%20t%20%5Cright)%20%5C%20,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Comega_n%20=%20c%20k_n%20=%20%5Csqrt%7B%5Cfrac%7BN_0%7D%7Bm%7D%7D%20%5Cfrac%7Bn%20%5Cpi%7D%7Bb%7D">, and coefficients <img src="https://latex.codecogs.com/png.latex?a_n">, <img src="https://latex.codecogs.com/png.latex?b_n"> evaluated to match the initial conditions.</p>
<details open="">
<summary>
Solution
</summary>
<p>Exploiting orthogonality of harmonic functions,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20%5Cint_%7B0%7D%5E%7Bb%7D%20%5Csin%20%5Cleft(%5Cfrac%7Bn%20%5Cpi%20x%7D%7Bb%7D%5Cright)%20%5Csin%20%5Cleft(%5Cfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5C,%20dx%20&amp;%20=%20%5Cfrac%7Bb%7D%7B2%7D%20%5Cdelta_%7Bnm%7D%20%5C%5C%0A%20%20%5Cint_%7B0%7D%5E%7Bb%7D%20%5Ccos%20%5Cleft(%5Cfrac%7Bn%20%5Cpi%20x%7D%7Bb%7D%5Cright)%20%5Ccos%20%5Cleft(%5Cfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5C,%20dx%20&amp;%20=%20%5Cfrac%7Bb%7D%7B2%7D%20%5Cdelta_%7Bnm%7D%20%5C%5C%0A%20%20%5Cint_%7B0%7D%5E%7Bb%7D%20%5Csin%20%5Cleft(%5Cfrac%7Bn%20%5Cpi%20x%7D%7Bb%7D%5Cright)%20%5Ccos%20%5Cleft(%5Cfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5C,%20dx%20&amp;%20=%200%20%5C%5C%0A%5Cend%7Baligned%7D"></p>
<p>and projection of the solution onto these functions,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%200%20&amp;%20=%20%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Csin%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5Cleft%5C%7B%20-%20m%20%5Cddot%7Bu%7D_0%20+%20N_0%20u''_0%20-%20m%20%5Cddot%7Bu%7D_p%20%5Cright%5C%7D%20dx%20=%20%5C%5C%0A%20%20%20%20&amp;%20=%20%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Csin%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5Csum_n%20%5Cleft%5C%7B%20-%20m%20%5Cddot%7Bg%7D_n(t)%20-%20k%5E2_n%20N_0%20g_n(t)%20%5Cright%5C%7D%20%5Csin%20%5Cleft(%20%5Cdfrac%7Bn%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5C,%20dx%20-%20%5Cint_%7Bx=0%7D%5Eb%20%5Csin%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20m%20%5Cfrac%7Bx%7D%7Bb%7D%20dx%20%5C,%20%5Cddot%7Bu%7D_B(t)%0A%5Cend%7Baligned%7D"></p>
<p>the PDEs can be recast as a (infinite dimension) linear system</p>
<p><img src="https://latex.codecogs.com/png.latex?m%20%5Cdfrac%7Bb%7D%7B2%7D%20%5Cddot%7Bg%7D_n(t)%20+%20k%5E2_n%20N_0%20%5Cdfrac%7Bb%7D%7B2%7D%20g_n(t)%20=%20(-1)%5E%7Bn%7D%20m%20%5Cdfrac%7Bb%7D%7B%5Cpi%20n%7D%20%5Cddot%7Bu%7D_B(t)%20%5C%20,%20"></p>
<p>or, dividing by the mass <img src="https://latex.codecogs.com/png.latex?m"> times <img src="https://latex.codecogs.com/png.latex?%5Cfrac%7Bb%7D%7B2%7D"> and recalling that <img src="https://latex.codecogs.com/png.latex?k_n%20=%20%5Cfrac%7Bn%20%5Cpi%7D%7Bb%7D">, <img src="https://latex.codecogs.com/png.latex?c%20:=%20%5Csqrt%7B%5Cfrac%7BN_0%7D%7Bm%7D%7D"> and <img src="https://latex.codecogs.com/png.latex?%5Comega_n%20:=%20c%20k_n">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cddot%7Bg%7D_n(t)%20+%20%5Comega_n%5E2%20g_n(t)%20=%20(-1)%5E%7Bn%7D%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cddot%7Bu%7D_P(t)%20%5C%20,"></p>
<p>being</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%5Cint_%7Bx=0%7D%5Eb%20%5Cdfrac%7Bx%7D%7Bb%7D%20%5Csin%20%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20dx%0A%20%20&amp;%20=%20%5Cleft.%5Cleft%5B%20-%20%5Cdfrac%7Bx%7D%7Bb%7D%20%5Cdfrac%7Bb%7D%7B%5Cpi%20m%7D%20%5Ccos%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5Cright%5D%5Cright%7C_%7Bx=0%7D%5E%7Bb%7D%20+%20%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Cdfrac%7B1%7D%7B%5Cpi%20m%7D%20%5Ccos%20%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%20%5C,%20dx%20=%20%5C%5C%0A%20%20&amp;%20=%20-%20%5Cdfrac%7Bb%7D%7B%5Cpi%20m%7D%20%5Cunderbrace%7B%5Ccos%5Cleft(%20m%20%5Cpi%20%5Cright)%7D_%7B(-1)%5Em%7D%20+%20%5Cunderbrace%7B%5Cdfrac%7Bb%7D%7B(%5Cpi%20m)%5E2%7D%20%5Cleft.%5Csin%5Cleft(%20%5Cdfrac%7Bm%20%5Cpi%20x%7D%7Bb%7D%20%5Cright)%5Cright%7C_%7Bx=0%7D%5E%7Bb%7D%7D_%7B=0%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20-(-1)%5E%7Bm%7D%20%5Cdfrac%7Bb%7D%7B%5Cpi%20m%7D%20%5C%20.%0A%5Cend%7Baligned%7D"></p>
<p>The solution of the equation for <img src="https://latex.codecogs.com/png.latex?g_n"> can be written as the sum of the solution of the homogeneous equation and an <em>independent</em> particular solution <img src="https://latex.codecogs.com/png.latex?g_%7Bn,P%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?g_n(t)%20=%20a_n%20%5Ccos%20%5Cleft(%20%5Comega_n%20t%20%5Cright)%20+%20b_n%20%5Csin%20%5Cleft(%20%5Comega_n%20t%20%5Cright)%20+%20g_%7Bn,P%7D(t)%20%5C%20."></p>
</details>
</section>
<section id="sligthly-damped-system" class="level4">
<h4 class="anchored" data-anchor-id="sligthly-damped-system">Sligthly damped system</h4>
<p>Mechanical systems without any damper element usually have small damping, that can be well represented as a modal damping. Under this assumption, the modal equations become</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cddot%7Bg%7D_n(t)%20+%202%20%5Cxi_n%20%5Comega_n%20%5Cdot%7Bg%7D_n(t)%20+%20%5Comega_n%5E2%20g_n(t)%20=%20(-1)%5E%7Bn%7D%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cddot%7Bu%7D_B(t)%20%5C%20,"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Cxi_n%20%5Cll%201">. The eigenvalues of the equation comes from the solution of the algebraic equation</p>
<p><img src="https://latex.codecogs.com/png.latex?s%5E2%20+%202%20%5Cxi_n%20%5Comega_n%20s%20+%20%5Comega%5E2_n%20=%200%20%5Cqquad%20%5Crightarrow%20%5Cqquad%20s_%7B1,2%7D%20=%20-%20%5Cxi_%7Bn%7D%20%5Comega_n%20%5Cmp%20%5Csqrt%7B%5Cxi_n%5E2%20%5Comega_n%5E2%20-%20%5Comega%5E2_n%7D%20=%20%5Comega_n%20%5Cleft%5B%20-%5Cxi_n%20%5Cmp%20i%20%5Csqrt%7B%201%20-%20%5Cxi_n%5E2%20%7D%20%5Cright%5D%20%5C%20,"></p>
<p>and the solution of the homogeneous equation reads</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20g_%7Bn,0%7D(t)%0A%20%20&amp;%20=%20c_n%20e%5E%7B%5Cleft(-%20%5Cxi_n%20%5Cmp%20i%20%5Csqrt%7B1-%5Cxi%5E2_n%7D%20%5Cright)%20%5Comega_n%20t%7D%20+%20%5Ctext%7B%20c.c.%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20a_n%20e%5E%7B-%5Cxi_n%20%5Comega_n%20t%7D%20%5Ccos%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20%5Cright)%20+%20b_n%20e%5E%7B-%5Cxi_n%20%5Comega_n%20t%7D%20%5Csin%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20%5Cright)%0A%5Cend%7Baligned%7D"></p>
<p>If the damping is non-zero, <img src="https://latex.codecogs.com/png.latex?%5Cxi_n%20%3E%200">, and the homogeneous part of the solution <img src="https://latex.codecogs.com/png.latex?g_%7Bn,0%7D(t)"> goes to zero for sufficient long time,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Clim_%7Bt%20%5Crightarrow%20+%20%5Cinfty%7D%20g_%7Bn,0%7D(t)%20%5Crightarrow%200%20%5C%20,"></p>
<p>and thus the free response of the system — and the effect of the initial condition — becomes negligible and only the forced response is relevant.</p>
<!--
<details open><summary>Back to PDE: damping term.</summary>

The goal of this section is to provide the expression of a damping contribution that is compatible with the modal damping, starting from the equations for the amplitude of the modes and going back to the original PDE.

If the equation

$$\ddot{g}_n + 2 \xi_n \omega_n \dot{g}_n + \omega^2_n g_n = F_n(t) \ ,$$

comes from the diagonalization of the problem &mdash; with $\omega_n = n \sqrt{\frac{N_0}{m}}$ &mdash;, after having introduced the ansatz using separation of variables, $u(x,t) = \sum_n f_n(x) g_n(t)$,

</details>
-->
</section>
<section id="harmonic-forcing" class="level4">
<h4 class="anchored" data-anchor-id="harmonic-forcing">Harmonic forcing</h4>
<p>With <img src="https://latex.codecogs.com/png.latex?u_B(t)%20=%20U%20%5Csin%20%5Cleft(%20%5COmega%20t%20%5Cright)">, the particular solution has the expression</p>
<p><img src="https://latex.codecogs.com/png.latex?g_%7Bn,P%7D(t)%20=%20A_n%20%5Ccos%5Cleft(%20%5COmega%20t%20%5Cright)%20+%20B_n%20%5Csin%5Cleft(%20%5COmega%20t%20%5Cright)%20%5C%20,%20"></p>
<p>whose coefficients <img src="https://latex.codecogs.com/png.latex?A_n">, <img src="https://latex.codecogs.com/png.latex?B_n"> can be evaluated matching harmonic terms</p>
<p><img src="https://latex.codecogs.com/png.latex?%0A%5Cbegin%7Bbmatrix%7D%0A-%5COmega%5E2+%5Comega_n%5E2%20&amp;%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5C%5C%0A-2%20%5Cxi_n%20%5Comega_n%20%5COmega%20&amp;%20-%5COmega%5E2+%5Comega_n%5E2%0A%5Cend%7Bbmatrix%7D%0A%5Cbegin%7Bbmatrix%7D%20A_n%20%5C%5C%20B_n%20%5Cend%7Bbmatrix%7D%20=%0A%5Cbegin%7Bbmatrix%7D%200%20%5C%5C%201%20%5Cend%7Bbmatrix%7D%20(-1)%5E%7Bn+1%7D%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20U%20%5COmega%5E2%0A"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%5Cbegin%7Bbmatrix%7D%20A_n%20%5C%5C%20B_n%20%5Cend%7Bbmatrix%7D%20&amp;%20=%0A%5Cdfrac%7B1%7D%7B%5Cleft(%20-%20%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5Cright)%5E2%7D%0A%5Cbegin%7Bbmatrix%7D%0A-%5COmega%5E2+%5Comega_n%5E2%20&amp;%20-2%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5C%5C%0A2%20%5Cxi_n%20%5Comega_n%20%5COmega%20&amp;%20-%5COmega%5E2+%5Comega_n%5E2%0A%5Cend%7Bbmatrix%7D%0A%5Cbegin%7Bbmatrix%7D%200%20%5C%5C%201%20%5Cend%7Bbmatrix%7D%20(-1)%5E%7Bn+1%7D%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20U%20%5COmega%5E2%20=%20%5C%5C%0A&amp;%20=%20%20(-1)%5E%7Bn+1%7D%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cdfrac%7B%5COmega%5E2%7D%7B%5Cleft(-%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5Cright)%5E2%7D%0A%5Cbegin%7Bbmatrix%7D%20-2%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5C%5C%20-%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cend%7Bbmatrix%7D%20U%20%5C%20.%0A%5Cend%7Baligned%7D"></p>
<p>Exploiting properties of harmonic functions, the particular solution can be recast as</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20%5Cdfrac%7Bg_%7Bn,P%7D(t)%7D%7BU%7D%0A%20%20&amp;%20=%20A_n%20%5Ccos(%5COmega%20t%20)%20+%20B_n%20%5Csin(%5COmega%20t%20)%20=%20%5C%5C%0A%20%20&amp;%20=%20C_n%20%5Csin(%5COmega%20t%20+%20%5Cvarphi_n%20)%20=%20%5C%5C%0A%20%20&amp;%20=%20C_n%20%5Cleft(%20%5Cdfrac%7BA_n%7D%7BC_n%7D%20%5Ccos(%5COmega%20t)%20+%20%5Cdfrac%7BB_n%7D%7BC_n%7D%20%5Csin(%5COmega%20t)%20%5Cright)%20=%20%5C%5C%0A%20%20&amp;%20=%20C_n%20%5Cleft(%20%5Csin%20%5Cvarphi_n%20%5Ccos(%5COmega%20t)%20+%20%5Ccos%20%5Cvarphi_n%20%5Csin(%5COmega%20t)%20%5Cright)%20%5C%20,%0A%5Cend%7Baligned%7D"></p>
<p>with <strong>gain</strong> <img src="https://latex.codecogs.com/png.latex?C_n%20=%20%5Csqrt%7BA%5E2_n%20+%20B%5E2_n%7D">, i.e.</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20C_n%0A%20%20&amp;%20=%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cdfrac%7B%5COmega%5E2%7D%7B%5Cleft(-%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5Cright)%5E2%7D%5Csqrt%7B%5Cleft(-%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5Cright)%5E2%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cdfrac%7B%5COmega%5E2%7D%7B%5Csqrt%7B%5Cleft(-%5COmega%5E2%20+%20%5Comega%5E2_n%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20%5Cright)%5E2%7D%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B2%7D%7B%5Cpi%20n%7D%20%5Cdfrac%7B%5Cleft(%5Cfrac%7B%5COmega%7D%7B%5Comega_n%7D%5Cright)%5E2%7D%7B%5Csqrt%7B%5Cleft(1%20-%20%5Cleft(%5Cfrac%7B%5COmega%7D%7B%5Comega_n%7D%5Cright)%5E2%20%5Cright)%5E2%20+%20%5Cleft(%202%20%5Cxi_n%20%5Cfrac%7B%5COmega%7D%7B%5Comega_n%7D%20%5Cright)%5E2%7D%7D%20%5C%20,%0A%5Cend%7Baligned%7D"></p>
<p>and <strong>phase delay</strong> <img src="https://latex.codecogs.com/png.latex?%5Cvarphi_n"> s.t.</p>
<p><img src="https://latex.codecogs.com/png.latex?%20%5Cvarphi_n%20=%20%5Ctext%7Batan2%7D%5Cleft(%20a%20%5Csin%20%5Cvarphi_n,%20a%20%5Ccos%20%5Cvarphi_n%20%5Cright)%20=%20%5Ctext%7Batan2%7D%5Cleft(%20A_n,%20B_n%20%5Cright)%20=%20%5Cleft(%20(-1)%5E%7Bn%7D%20%5Ccdot%202%20%5Cxi_n%20%5Comega_n%20%5COmega%20,%20(-1)%5E%7Bn%7D%20(%20%5COmega%5E2%20-%20%5Comega_n%5E2%20)%20%5Cright)%20%5C%20,"></p>
<p>having exploited the definition of an <img src="https://latex.codecogs.com/png.latex?%5Ctext%7Batan2%7D(%5Ccdot)"> function, whose co-domain width is <img src="https://latex.codecogs.com/png.latex?2%5Cpi">.</p>
<!--
$$\tan \varphi_n = \dfrac{B_n}{A_n} = \dfrac{2 \xi_n \omega_n \Omega}{-\Omega^2 + \omega^2_n} = \dfrac{2 \xi_n \frac{\Omega}{\omega_n}}{1 - \left(\frac{\Omega}{\omega_n}\right)^2} \ .$$
-->
<p><strong>Gain as a function of frequency <img src="https://latex.codecogs.com/png.latex?%5COmega"> of the forcing.</strong></p>
<p><img src="https://latex.codecogs.com/png.latex?f(x)%20=%20%5Cdfrac%7Bx%5E2%7D%7B%5Cleft(%20(%201%20-%20x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%20%20%5Cright)%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20f'(x)%0A%20%20&amp;%20=%20%5Cdfrac%7B2%20x%20(%20(%201%20-%20x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%20)%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%20-%20x%5E2%20%5Cfrac%7B1%7D%7B2%7D%20(%20(%201%20-%20x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%20%20)%5E%7B-%5Cfrac%7B1%7D%7B2%7D%7D%20%5Cleft(%20-%202%20(%201%20-%20x%5E2%20)%20%5Ccdot%202%20x%20+%208%20%5Cxi%5E2%20x%20%5Cright)%20%7D%7B(1-x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B%202x%20-%204%20x%5E3%20+%202%20x%5E5%20+%208%20%5Cxi%5E2%20x%5E3%20-%20%5Cleft(%20-%202%20x%5E3%20+%202%20x%5E5%20+%204%20%5Cxi%5E2%20x%5E3%20%5Cright)%20%7D%7B%5Cleft%5C%7B(1-x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%5Cright%5C%7D%5E%7B%5Cfrac%7B3%7D%7B2%7D%7D%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B%202x%20-%202%20x%5E3%20+%204%20%5Cxi%5E2%20x%5E3%7D%7B%5Cleft%5C%7B(1-x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%5Cright%5C%7D%5E%7B%5Cfrac%7B3%7D%7B2%7D%7D%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B%202%20x%20(%201%20-%20(%201%20-%202%20%5Cxi%5E2%20)%20x%5E2)%7D%7B%5Cleft%5C%7B(1-x%5E2)%5E2%20+%204%20%5Cxi%5E2%20x%5E2%5Cright%5C%7D%5E%7B%5Cfrac%7B3%7D%7B2%7D%7D%7D%20=%20%5C%5C%0A%5Cend%7Baligned%7D"></p>
<p>a maximum exists for <img src="https://latex.codecogs.com/png.latex?%5Cbar%7Bx%7D%20=%20%5Cfrac%7B1%7D%7B%5Csqrt%7B1-%202%20%5Cxi%5E2%7D%7D">, if <img src="https://latex.codecogs.com/png.latex?%5Cxi%20%3C%20%5Cfrac%7B1%7D%7B%5Csqrt%7B2%7D%7D">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20f(%5Cbar%7Bx%7D)%0A%20%20&amp;%20=%20%5Cdfrac%7B%5Cfrac%7B1%7D%7B1-2%5Cxi%5E2%7D%7D%7B%5Cleft(%20%5Cleft(%201%20-%20%5Cfrac%7B1%7D%7B1-2%5Cxi%5E2%7D%20%5Cright)%5E2%20%20+%204%20%5Cxi%5E2%20%5Cfrac%7B1%7D%7B1%20-%202%20%5Cxi%5E2%7D%5Cright)%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cdfrac%7B1%7D%7B%5Cleft(%204%20%5Cxi%5E4%20+%204%20%5Cxi%5E2%20(%201-%202%20%5Cxi%5E2)%20%5Cright)%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cfrac%7B1%7D%7B2%20%5Cxi%20(1-%5Cxi%5E2)%5E%7B%5Cfrac%7B1%7D%7B2%7D%7D%7D%0A%5Cend%7Baligned%7D"></p>
<div id="0e20e103-22a2-4f04-8dc2-f1ed079bb53d" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[]" data-execution_count="45">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Some libraries</span></span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb1-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">from</span> scipy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> signal</span>
<span id="cb1-4"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span>
<span id="cb1-5"></span>
<span id="cb1-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Bode diagram of the natural modes</span></span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Parameters of the system (non-dimensional)</span></span>
<span id="cb1-9">m, N0, b <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.</span>, np.pi</span>
<span id="cb1-10">c <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sqrt(N0<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>m)</span>
<span id="cb1-11">xi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.02</span></span>
<span id="cb1-12"></span>
<span id="cb1-13">n_modes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">30</span></span>
<span id="cb1-14">i_modes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.arange(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, n_modes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)</span>
<span id="cb1-15">omegas <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10.</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.5</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1000</span>)</span>
<span id="cb1-16"></span>
<span id="cb1-17">fig, ax <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> plt.subplots(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>,<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, figsize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">5</span>))</span>
<span id="cb1-18"></span>
<span id="cb1-19"><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> i_mode <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> i_modes:</span>
<span id="cb1-20">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Mode parameters</span></span>
<span id="cb1-21">    k_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> i_mode <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> b</span>
<span id="cb1-22">    omega_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> c</span>
<span id="cb1-23">    xi_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> xi</span>
<span id="cb1-24"></span>
<span id="cb1-25">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Continuous-time TF (no dt is given as a third argument in signal.TransferFunction)</span></span>
<span id="cb1-26">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># defined with numerator and denominator</span></span>
<span id="cb1-27">    num <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>]) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> (<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span>(i_mode<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>) <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> ( np.pi <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> i_mode )</span>
<span id="cb1-28">    den <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.array([<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>xi_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span>omega_n, omega_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">**</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>])</span>
<span id="cb1-29">    sys <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> signal.TransferFunction(num, den)</span>
<span id="cb1-30"></span>
<span id="cb1-31">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Evaluation of magnitude and phase of the TF of the LTI system sys</span></span>
<span id="cb1-32">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># mag is in dB i.e. |G|_{dB} = 20 log_10{|G|}se</span></span>
<span id="cb1-33">    w, mag, phase <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> signal.bode(sys, omegas)</span>
<span id="cb1-34"></span>
<span id="cb1-35">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Plot</span></span>
<span id="cb1-36">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].semilogx(omegas, mag  , lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.7</span>)</span>
<span id="cb1-37">    ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].semilogx(omegas, phase, lw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">.7</span>)</span>
<span id="cb1-38"></span>
<span id="cb1-39">G_ticks <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> np.arange(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>)</span>
<span id="cb1-40">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_yticks(G_ticks)</span>
<span id="cb1-41">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_xlim(omegas[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], omegas[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].grid()</span>
<span id="cb1-42">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylim(G_ticks[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], G_ticks[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])</span>
<span id="cb1-43">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlim(omegas[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>], omegas[<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>])<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">;</span>  ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].grid()</span>
<span id="cb1-44">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'$|G|_</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{dB}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">$'</span>)</span>
<span id="cb1-45">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_xlabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Omega$'</span>)</span>
<span id="cb1-46">ax[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>].set_ylabel(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">'$</span><span class="er" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">phi$'</span>)</span></code></pre></div></div>
<div class="cell-output cell-output-display" data-execution_count="45">
<pre><code>Text(0, 0.5, '$\\phi$')</code></pre>
</div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/modes-in-structures/index_files/figure-html/cell-2-output-2.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>
</section>
<section id="full-solution" class="level4">
<h4 class="anchored" data-anchor-id="full-solution">Full solution</h4>
<p>Full solution of the problem with the prescribed motion <img src="https://latex.codecogs.com/png.latex?u_B(t)%20=%20U%20%5Csin(%5COmega%20t)"> reads</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20u(x,t)%20&amp;%20=%20%5Cleft%5C%7B%20%5Cfrac%7Bx%7D%7Bb%7D%20%5Csin(%5COmega%20t)%20+%20%5Csum_n%20%5Csin%20%5Cleft(%20k_n%20x%20%5Cright)%20g_%7Bn,p%7D(t)%20%5Cright%5C%7D%20U_B%20+%20%5Csum_%7Bn%7D%20C_%7Bn,0%7D%20%5Csin(%20k_n%20x%20)%20e%5E%7B-%5Cxi_n%20%5Comega_n%20t%7D%20%5Ccos%20%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20-%20%5Cvarphi_%7Bn,0%7D%20%5Cright)%20%5C%5C%0A%20%20&amp;%20=%20%5Cleft%5C%7B%20%5Cfrac%7Bx%7D%7Bb%7D%20%5Csin(%5COmega%20t)%20+%20%5Csum_n%20%5Csin%20%5Cleft(%20k_n%20x%20%5Cright)%20C_n(%5COmega)%20%5Csin(%5COmega%20t%20+%20%5Cvarphi_n(%5COmega)%20)%20%5Cright%5C%7D%20U_B%20+%20%5Csum_%7Bn%7D%20C_%7Bn,0%7D%20%5Csin(%20k_n%20x%20)%20e%5E%7B-%5Cxi_n%20%5Comega_n%20t%7D%20%5Ccos%20%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20+%20%5Cvarphi_%7Bn,0%7D%20%5Cright)%0A%5Cend%7Baligned%7D"></p>
<p>s.t. its time derivative <img src="https://latex.codecogs.com/png.latex?%5Cpartial_t%20u(x,t)"> is</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20%5Cdot%7Bu%7D(x,t)%0A%20%20&amp;%20=%20%5Cleft%5C%7B%20%5Cfrac%7Bx%7D%7Bb%7D%20%5Ccos(%5COmega%20t)%20+%20%5Csum_n%20%5Csin%20%5Cleft(%20k_n%20x%20%5Cright)%20C_n(%5COmega)%20%5Ccos(%5COmega%20t%20+%20%5Cphi_n(%5COmega)%20)%20%5Cright%5C%7D%20%5COmega%20U_B%20+%20%5Csum_%7Bn%7D%20C_%7Bn,0%7D%20%5Csin(%20k_n%20x%20)%20e%5E%7B-%5Cxi_n%20%5Comega_n%20t%7D%20%5Cleft%5B%20-%20%5Cxi_n%20%5Comega_n%20%5Ccos%20%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20+%20%5Cvarphi_%7Bn,0%7D%20%5Cright)%20-%20%5Csqrt%7B1-%5Cxi_n%5E2%7D%20%5Comega_n%20%5Csin%5Cleft(%20%5Csqrt%7B1%20-%20%5Cxi%5E2_n%7D%20%5C,%20%5Comega_n%20t%20+%20%5Cvarphi_%7Bn,0%7D%20%5Cright)%20%5Cright%5D%0A%5Cend%7Baligned%7D"></p>
<p>Both forced and free response can be re-written as the sum of a <img src="https://latex.codecogs.com/png.latex?%5Csin"> and <img src="https://latex.codecogs.com/png.latex?%5Ccos"> contribution per each wave number. The coefficients <img src="https://latex.codecogs.com/png.latex?A_n">, <img src="https://latex.codecogs.com/png.latex?B_n"> of the forced response have already been evaluated above. The coefficients of the free response <img src="https://latex.codecogs.com/png.latex?A_%7B0,n%7D">, <img src="https://latex.codecogs.com/png.latex?B_%7B0,n%7D"> need to be evaluated with the initial conditions.</p>
<p><img src="https://latex.codecogs.com/png.latex?f(t)%20=%20e%5E%7B-%5Cxi%20%5Comega%20t%7D%20%5Cleft%5B%20A_0%20%5Ccos(%5Cwidetilde%7B%5Comega%7D%20t)%20+%20B_0%20%5Csin(%5Cwidetilde%7B%5Comega%7D%20t)%20%5Cright%5D"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cdot%7Bf%7D(t)%20=%20e%5E%7B-%5Cxi%20%5Comega%20t%7D%20%5Cleft%5B%20A_0%20%5Cleft(%20-%5Cxi%20%5Comega%20%5Ccos(%5Cwidetilde%7B%5Comega%7D%20t)%20-%20%5Cwidetilde%7B%5Comega%7D%20%5Csin(%5Cwidetilde%7B%5Comega%7D%20t)%20%5Cright)%20+%20B_0%20%5Cleft(-%5Cxi%20%5Comega%20%5Csin(%5Cwidetilde%7B%5Comega%7D%20t)%20+%20%5Cwidetilde%7B%5Comega%7D%20%5Ccos(%5Cwidetilde%7B%5Comega%7D%20t)%20%5Cright)%20%5Cright%5D"></p>
</section>
<section id="solving-for-initial-conditions" class="level4">
<h4 class="anchored" data-anchor-id="solving-for-initial-conditions">Solving for initial conditions</h4>
<p><em>Projection to find a linear system for the coefficients <img src="https://latex.codecogs.com/png.latex?A_%7Bn,0%7D">, <img src="https://latex.codecogs.com/png.latex?B_%7Bn,0%7D">…</em></p>
<p><img src="https://latex.codecogs.com/png.latex?u_0(x)%20=%20u(x,0)%20=%20%5Csum_%7Bn%7D%20%5Csin(k_n%20x)%20A_n%20U_B%20+%20%5Csum_%7Bn%7D%20A_%7Bn,0%7D%20%5Csin(k_n%20x)"></p>
<p><img src="https://latex.codecogs.com/png.latex?v_0(x)%20=%20%5Cdot%7Bu%7D(x,0)%20=%20%5Cdfrac%7Bx%7D%7Bb%7D%5COmega%20U_B%20+%20%5Csum_%7Bn%7D%20B_n%20%5COmega%20U_B%20%5Csin(k_n%20x)%20+%20%5Csum_%7Bn%7D%20%5Cleft%5C%7B%20-%20A_%7Bn,0%7D%20%5Cxi_n%20%5Comega_n%20+%20B_%7Bn,0%7D%20%5Comega_n%20%5Csqrt%7B1%20-%20%5Cxi_n%5E2%7D%20%5Cright%5C%7D%20%5Csin(k_n%20x)"></p>
<p>This is a system of two equations, with infinite unknowns <img src="https://latex.codecogs.com/png.latex?A_%7Bn,0%7D">, <img src="https://latex.codecogs.com/png.latex?B_%7Bn,0%7D">. While this sounds like a very under-determined system, this is not the case since the two equations depends on the continuous spatial coordinate <img src="https://latex.codecogs.com/png.latex?x"> and thus they’re 2 <em>infinite-dimensional</em> equations: each equation is not just an equality, but it’s an equality that needs to hold for every possible <img src="https://latex.codecogs.com/png.latex?x%20%5Cin%20%5B0,b%5D">, and thus each equation prescribes infinite constraints.</p>
<p>Now, infinite constraints and infinite unknowns…the problem looks trickier and trickier. But it’s quite easy to solve through projection on the functions <img src="https://latex.codecogs.com/png.latex?%5Csin(%20k_p%20x%20)"> exploiting the orthogonality of these harmonic functions on the interval <img src="https://latex.codecogs.com/png.latex?%5B0,b%5D">. This process should recall to the reader the Fourier series expansion of periodic functions. The equations become an infinite number of decoupled pairs of equations,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Csin(k_p%20x)%20u_0(x)%20dx%20=%20%5Cdfrac%7Bb%7D%7B2%7D%20%5Cleft(%20A_p%20U_B%20+%20A_%7Bp,0%7D%20%5Cright)"></p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Csin(k_p%20x)%20%5Cleft(%20v_0(x)%20-%20%5Cdfrac%7Bx%7D%7Bb%7D%20%5COmega%20U_B%20%5Cright)%20%5C,%20dx%20=%20%5Cdfrac%7Bb%7D%7B2%7D%20%5Cleft(%20B_p%20%5COmega%20U_B%20+%20%5Comega_p%20%5Cleft(%20-%20%5Cxi_p%20A_%7Bp,0%7D%20+%20%5Csqrt%7B1%20-%20%5Cxi%5E2_p%7D%20B_%7Bp,0%7D%20%5Cright)%20%5Cright)"></p>
<p>whose results are easily evaluated as</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%20A_%7Bp,0%7D%20&amp;%20=%20-%20A_p%20U_B%20+%20%5Cdfrac%7B2%7D%7Bb%7D%20%5Cint_%7Bx=0%7D%5E%7Bb%7D%20%5Csin(k_p%20x)%20u_0(x)%20%5C,%20dx%20%5C%5C%0A%20%20B_%7Bp,0%7D%20&amp;%20=%20%5Cdots%0A%5Cend%7Baligned%7D"></p>


</section>
</section>
</section>


<div id="quarto-appendix" class="default"><section id="footnotes" class="footnotes footnotes-end-of-document"><h2 class="anchored quarto-appendix-heading">Footnotes</h2>

<ol>
<li id="fn1"><p>Slang proper of Stack Exchange and other forums, OP means Original Poster.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>structural mechanics</category>
  <category>natural modes</category>
  <category>resonance</category>
  <guid>https://basics2022.github.io/myblog/posts/modes-in-structures/</guid>
  <pubDate>Mon, 24 Nov 2025 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Weak formulation of problems in structural mechanics</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/hyperstatics-and-weak-form/</link>
  <description><![CDATA[ 





<!--
draft: true
-->
<p>This post grew out of a question about a structural mechanics exercise that appeared in a community of structural engineers. The exercise dealt with a hyperstatic beam system with elastic supports and thermal strains.</p>
<p>It’s a nice excuse to talk about the role of the weak form — especially compatibility and equilibrium conditions — and to show that the so-called energy theorems follow directly from choosing suitable test functions in the weak formulation.</p>
<!--
![](thumbnail.png)
-->
<p align="center">
<img src="https://basics2022.github.io/myblog/posts/hyperstatics-and-weak-form/thumbnail.png">
</p>
<section id="linear-elastic-problem" class="level2">
<h2 class="anchored" data-anchor-id="linear-elastic-problem">Linear elastic problem</h2>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cboldsymbol%5Csigma%20+%20%5Coverline%7B%5Cmathbf%7Bf%7D%7D%20=%20%5Cmathbf%7B0%7D%20%20&amp;&amp;%20%5Ctext%7Bin%20$V$%7D%20%5C%5C%0A%20%20%5Cboldsymbol%5Cvarepsilon%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cleft(%20%5Cboldsymbol%5Cnabla%20%5Cmathbf%7Bs%7D%20+%20%5Cboldsymbol%5Cnabla%5ET%20%5Cmathbf%7Bs%7D%20%5Cright)%20%5C%5C%0A%20%20%5Cboldsymbol%5Csigma%20=%20%5Cmathbf%7BC%7D%20:%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Cboldsymbol%5Cbeta%20%5CDelta%20T%20%5C%5C%0A%20%20%5Cmathbf%7Bs%7D%20=%20%5Coverline%7B%5Cmathbf%7Bs%7D%7D%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_D$%7D%20%5C%5C%0A%20%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5Csigma%20=%20%5Coverline%7B%5Cmathbf%7Bt%7D%7D_n%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_N$%7D%20%5C%5C%0A%20%20%5Cmathbf%7BK%7D%20%5Ccdot%20%5Cmathbf%7Bs%7D%20+%20%5Cmathbf%7BS%7D%20%5Ccdot%20(%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5Csigma%20)%20=%20%5Coverline%7Bh%7D%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_R$%7D%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
</section>
<section id="equilibrium-conditions" class="level2">
<h2 class="anchored" data-anchor-id="equilibrium-conditions">Equilibrium conditions</h2>
<section id="strong-form" class="level3">
<h3 class="anchored" data-anchor-id="strong-form">Strong form</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cboldsymbol%5Csigma%20+%20%5Coverline%7B%5Cmathbf%7Bf%7D%7D%20=%20%5Cmathbf%7B0%7D%20%20&amp;&amp;%20%5Ctext%7Bin%20$V$%7D%20%5C%5C%0A%20%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5Csigma%20=%20%5Coverline%7B%5Cmathbf%7Bt%7D%7D_n%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_N$%7D%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5Csigma%20=%20%5Cmathbf%7BC%7D%20:%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Cboldsymbol%5Cbeta%20%5CDelta%20T">.</p>
</section>
<section id="weak-form" class="level3">
<h3 class="anchored" data-anchor-id="weak-form">Weak form</h3>
<p>For every <em>sufficiently regular</em> test function <img src="https://latex.codecogs.com/png.latex?%5Cmathbf%7Bw%7D">,</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%200%0A%20%20&amp;%20=%20%5Cint_%7BV%7D%20%5Cmathbf%7Bw%7D%20%5Ccdot%20%5Cleft%5C%7B%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cboldsymbol%5Csigma%20+%20%5Coverline%7B%5Cmathbf%7Bf%7D%7D%20%5Cright%5C%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Coint_%7B%5Cpartial%20V%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5Csigma%20%5Ccdot%20%5Cmathbf%7Bw%7D%20-%20%5Cint_%7BV%7D%20%5Cboldsymbol%5Cnabla%20%5Cmathbf%7Bw%7D%20:%20%5Cboldsymbol%5Csigma%20+%20%5Cint_%7BV%7D%20%5Cmathbf%7Bw%7D%20%5Ccdot%20%5Cmathbf%7Bf%7D%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Coint_%7B%5Cpartial%20V%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5Csigma%20%5Ccdot%20%5Cmathbf%7Bw%7D%20-%20%5Cint_%7BV%7D%20%5Cdfrac%7B1%7D%7B2%7D%20%5Cleft(%20%5Cboldsymbol%5Cnabla%20%5Cmathbf%7Bw%7D%20+%20%5Cboldsymbol%5Cnabla%5ET%20%5Cmathbf%7Bw%7D%20%5Cright)%20:%20%5Cboldsymbol%5Csigma%20+%20%5Cint_%7BV%7D%20%5Cmathbf%7Bw%7D%20%5Ccdot%20%5Cmathbf%7Bf%7D%20%5C%20.%0A%5Cend%7Baligned%7D"></p>
<p>having exploited the symmetry of the stress tensor <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5Csigma">.</p>
</section>
<section id="section" class="level3">
<h3 class="anchored" data-anchor-id="section">…</h3>
</section>
<section id="pvw" class="level3">
<h3 class="anchored" data-anchor-id="pvw">PVW</h3>
</section>
</section>
<section id="compatibility-conditions" class="level2">
<h2 class="anchored" data-anchor-id="compatibility-conditions">Compatibility conditions</h2>
<section id="strong-form-1" class="level3">
<h3 class="anchored" data-anchor-id="strong-form-1">Strong form</h3>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20%5Cboldsymbol%5Cvarepsilon%20=%20%5Cfrac%7B1%7D%7B2%7D%20%5Cleft(%20%5Cboldsymbol%5Cnabla%20%5Cmathbf%7Bs%7D%20+%20%5Cboldsymbol%5Cnabla%5ET%20%5Cmathbf%7Bs%7D%20%5Cright)%20&amp;&amp;%20%5Ctext%7Bin%20$V$%7D%20%5C%5C%0A%20%20%5Cmathbf%7Bs%7D%20=%20%5Coverline%7B%5Cmathbf%7Bs%7D%7D%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_D$%7D%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
<p>with <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5Cvarepsilon%20=%20%5Cmathbf%7BD%7D%20:%20%5Cboldsymbol%5Csigma%20+%20%5Cboldsymbol%5Calpha%20%5CDelta%20T">.</p>
</section>
<section id="weak-form-1" class="level3">
<h3 class="anchored" data-anchor-id="weak-form-1">Weak form</h3>
<p>For every <em>sufficiently regular</em> test function <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5CSigma"> (<img src="https://latex.codecogs.com/png.latex?2%5E%7Bnd%7D">-order tensor)</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Baligned%7D%0A%20%200%0A%20%20&amp;%20=%20%5Cint_%7BV%7D%20%5Cboldsymbol%5CSigma%20:%20%5Cleft(%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Cdfrac%7B1%7D%7B2%7D%20%5Cleft(%20%5Cboldsymbol%5Cnabla%20%5Cmathbf%7Bs%7D%20+%20%5Cboldsymbol%5Cnabla%5ET%20%5Cmathbf%7Bs%7D%20%5Cright)%20%5Cright)%20=%20%5C%5C%0A%20%20&amp;%20=%20%5Cint_%7BV%7D%20%5Cboldsymbol%5CSigma%20:%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Coint_%7B%5Cpartial%20V%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cboldsymbol%5CSigma%20%5Ccdot%20%5Cmathbf%7Bs%7D%20+%20%5Cint_V%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cboldsymbol%5CSigma%20%5Ccdot%20%5Cmathbf%7Bs%7D%20=%20%5C%5C%0A%5Cend%7Baligned%7D"></p>
<p>if the tensor test function is symmetric <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5CSigma%20=%20%5Cboldsymbol%5CSigma%5ET">.</p>
</section>
<section id="force-method" class="level3">
<h3 class="anchored" data-anchor-id="force-method">Force method</h3>
<p>Choosing the test function to be an equilibrated stress field — let’s define it as <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5CSigma%20:=%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D"> to recall this condition — i.e.&nbsp;a stress field that satisfies equilibrium conditions</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20+%20%5Cwidetilde%7B%5Cmathbf%7Bf%7D%7D%20=%20%5Cmathbf%7B0%7D%20%20&amp;&amp;%20%5Ctext%7Bin%20$V$%7D%20%5C%5C%0A%20%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20=%20%5Cwidetilde%7B%5Cmathbf%7Bt%7D%7D_n%20%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_N$%7D%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
<!--  
-->
<p>under some external loads <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7B%5Cmathbf%7Bf%7D%7D"> in <img src="https://latex.codecogs.com/png.latex?V"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7B%5Cmathbf%7Bt%7D%7D_n"> on <img src="https://latex.codecogs.com/png.latex?S_N">. The weak problem thus becomes</p>
<p><img src="https://latex.codecogs.com/png.latex?0%20=%20%5Cint_%7BV%7D%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20:%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Cint_%7BV%7D%20%5Cwidetilde%7B%5Cmathbf%7Bf%7D%7D%20%5Ccdot%20%5Cmathbf%7Bs%7D%20-%20%5Cint_%7BS_N%7D%20%5Cwidetilde%7B%5Cmathbf%7Bt%7D%7D_n%20%5Ccdot%20%5Cmathbf%7Bs%7D%20-%20%5Cint_%7BS_D%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20%5Ccdot%20%5Coverline%7B%5Cmathbf%7Bs%7D%7D%20-%20%5Cint_%7BS_R%7D%20%5Cdots%20%20"></p>
<p>```mvzvzefphg Example: evaluation of hyperstatics</p>
<p>One of the most common example of applications of force method is the evaluation of hyperstatic actions in over-determined structures.</p>
<p>```</p>
</section>
<section id="pcvw" class="level3">
<h3 class="anchored" data-anchor-id="pcvw">PCVW</h3>
<p>Choosing the test function to be the variation equilibrated stress field — let’s define it as <img src="https://latex.codecogs.com/png.latex?%5Cboldsymbol%5CSigma%20:=%20%5Cdelta%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D"> to recall this condition — i.e.&nbsp;a stress field that satisfies equilibrium conditions</p>
<p><img src="https://latex.codecogs.com/png.latex?%5Cbegin%7Bcases%7D%0A%20%20%5Cboldsymbol%5Cnabla%20%5Ccdot%20%5Cdelta%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20=%20%5Cmathbf%7B0%7D%20%20&amp;&amp;%20%5Ctext%7Bin%20$V$%7D%20%5C%5C%0A%20%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cdelta%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20=%20%5Cmathbf%7B0%7D%20%20&amp;&amp;%20%5Ctext%7Bon%20$S_N$%7D%20%5C%5C%0A%5Cend%7Bcases%7D"></p>
<!--  
-->
<p>as the variation of given external loads <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7B%5Cmathbf%7Bf%7D%7D"> in <img src="https://latex.codecogs.com/png.latex?V"> and <img src="https://latex.codecogs.com/png.latex?%5Cwidetilde%7B%5Cmathbf%7Bt%7D%7D_n"> on <img src="https://latex.codecogs.com/png.latex?S_N"> is identically zero. The weak problem thus becomes</p>
<p><img src="https://latex.codecogs.com/png.latex?0%20=%20%5Cint_%7BV%7D%20%5Cdelta%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20:%20%5Cboldsymbol%5Cvarepsilon%20-%20%5Cint_%7BS_D%7D%20%5Chat%7B%5Cmathbf%7Bn%7D%7D%20%5Ccdot%20%5Cdelta%20%5Cwidetilde%7B%5Cboldsymbol%5Csigma%7D%20%5Ccdot%20%5Coverline%7B%5Cmathbf%7Bs%7D%7D%20-%20%5Cint_%7BS_R%7D%20%5Cdots%20%20"></p>


</section>
</section>

 ]]></description>
  <category>structural mechanics</category>
  <category>weak form</category>
  <guid>https://basics2022.github.io/myblog/posts/hyperstatics-and-weak-form/</guid>
  <pubDate>Sun, 23 Nov 2025 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Hello .ipynb on the blog!</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/welcome-ipynb/</link>
  <description><![CDATA[ 





<p>Just the first try of a notebook post.</p>
<div id="47eb7d6d-0617-4c3c-8c0d-bd1419af76b1" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[]" data-execution_count="5">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#&gt; Import libraries</span></span>
<span id="cb1-2"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> numpy <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> np</span>
<span id="cb1-3"><span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">import</span> matplotlib.pyplot <span class="im" style="color: #00769E;
background-color: null;
font-style: inherit;">as</span> plt</span></code></pre></div></div>
</div>
<div id="d9dea04d-e654-4b93-bf6d-da38522c1a77" class="cell" data-execution_count="8">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb2-1">x <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.linspace(<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span>np.pi, np.pi, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">101</span>)</span>
<span id="cb2-2">y <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> np.sin(x)</span></code></pre></div></div>
</div>
<div id="30a1d12a-d178-455f-90eb-aa71ef27eb41" class="cell" data-editable="true" data-quarto-private-1="{&quot;key&quot;:&quot;slideshow&quot;,&quot;value&quot;:{&quot;slide_type&quot;:&quot;&quot;}}" data-tags="[&quot;hide-input&quot;]" data-execution_count="9">
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb3-1">plt.figure()</span>
<span id="cb3-2">plt.plot(x,y)</span>
<span id="cb3-3">plt.grid()</span></code></pre></div></div>
<div class="cell-output cell-output-display">
<div>
<figure class="figure">
<p><img src="https://basics2022.github.io/myblog/posts/welcome-ipynb/index_files/figure-html/cell-4-output-1.png" class="img-fluid figure-img"></p>
</figure>
</div>
</div>
</div>



 ]]></description>
  <category>blog</category>
  <category>jupyter</category>
  <guid>https://basics2022.github.io/myblog/posts/welcome-ipynb/</guid>
  <pubDate>Sun, 23 Nov 2025 23:00:00 GMT</pubDate>
</item>
<item>
  <title>Hello blog!</title>
  <dc:creator>Basics </dc:creator>
  <link>https://basics2022.github.io/myblog/posts/welcome/</link>
  <description><![CDATA[ 





<p><img src="https://basics2022.github.io/myblog/posts/welcome/thumbnail.jpg" class="img-fluid"></p>
<p>Hello, blog!</p>
<p>This is just the first post of the <strong>basics blog</strong>, exploiting Quarto. Could it be the answer to the need for a simple tool, providing similar experience to Jupyter Books with minimal fancy tools for blogging, like tags, automatic layout of the main page (e.g.&nbsp;with latest post), built with .md and .ipynb, to be publicly hosted on GitHub, and allowing comments with the smallest amount of pain as possible? I’ll find out.</p>
<p>I’ve come across Quarto just this morning, through some nice examples <a href="https://bitsofanalytics.org/">Mark Isken, Bits of Abalytics</a>, who looks like having some experience with blogging and moved to Quarto after using several other platforms: his blog looks good and clean, it looks like he has my same needs, he looks quite satisfied with Quarto and he’s explaining why in details in his post <a href="https://bitsofanalytics.org/posts/port-to-quarto/">Firts impressions of blogging with Quarto</a>, written in 2023. There are no later posts about porting, while the last post came out only few days ago: it looks like the blog is alive and he keeps using Quarto. So, why shouldn’t I trust him?</p>
<!--
This is the first post in a Quarto blog. Welcome!

Let's edit it.

Since this post doesn't specify an explicit `image`, the first image in the post will be used in the listing page of posts.
-->



 ]]></description>
  <category>blog</category>
  <guid>https://basics2022.github.io/myblog/posts/welcome/</guid>
  <pubDate>Sun, 23 Nov 2025 23:00:00 GMT</pubDate>
</item>
</channel>
</rss>
