<?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>Ring Breathing</title>
<link>https://blog.q-bea.science/</link>
<atom:link href="https://blog.q-bea.science/index.xml" rel="self" type="application/rss+xml"/>
<description>Science, math and programming blog by Adelaide Espinoza, a Latin American chemist exploring the world naïvely.</description>
<generator>quarto-1.8.26</generator>
<lastBuildDate>Fri, 30 Jan 2026 05:00:00 GMT</lastBuildDate>
<item>
  <title>Singing the praises of electrochemistry</title>
  <dc:creator>Adelaide Beatriz Espinoza</dc:creator>
  <link>https://blog.q-bea.science/posts/whats-so-special/</link>
  <description><![CDATA[ 





<p>The post’s description can be roughly translated to “Said I never worked a day, always treat it like a hobby”. Casting work-life boundaries aside, science can be seen as a work of income and a work of art, depending on how passionate one feels about it.</p>
<p>I am currently in queue to join a Master’s program in Chemistry, researching in a group that focuses in fundamental electrochemistry. Working in this field feels to me like racing a Daytona 500<sup>1</sup>: always daunting, always feeling inexperienced, always mysterious. And that’s one of the reasons my coworkers and classmates always asked:</p>
<blockquote class="blockquote">
<p>“Why is that you like electrochemistry <em>so much?</em>”</p>
</blockquote>
<p>I’ll be honest: I have no clue. Writing a post like this is a way of looking into my heart and pointing at a certain reason I want to stay. So, open heart surgeries aside,</p>
<ol type="1">
<li><p>Electrochemistry is <strong>cryptic</strong> — in a wide sense, just as thermodynamics is and just how all physical chemistry arrives at being so after several decades of theories. However, any endeavor involving electricity in chemistry is quite rare outside this specific branch, so it is very welcome to work with something half-wet, half-dry.</p></li>
<li><p>Electrochemistry is <strong>mysterious</strong>: what kind of observable science lets you conjecture about the fate of trillions of trillions of atoms confined to picometer-thick surfaces, and produce anything near a feasible response? Again, one could argue in favor of physical chemistry overall – without denying it, there is an allure (to me) when electricity is involved.</p>
<ol type="1">
<li><p>You’re very familiar, from an early age, with what heating or pushing things feels like – but electricity? Unless you live with someone working in the field as a technician or engineer, <em>electricity is its own untamed beast</em>. It’s a force you cannot easily control, that travels through air and vacuum<sup>2</sup> and requires special equipment to be correctly managed and detected.</p></li>
<li><p>Even among early-career scientists, most of the mathematical joust required to understand mechanics <em>to begin with</em>, lacks most of the special tools that explain electromagnetic phenomena. For example, the Dirac distribution and all the frequency-domain jargon, Maxwell’s laws and whatnot.</p></li>
</ol></li>
</ol>
<ol start="3" type="1">
<li><p>To me, even if it’s old, <strong>electrochemistry is in its infancy</strong>. We do not know why steel shows an inductive loop when you record its impedance spectrum. We do not understand why the constant phase element begged to appear almost everywhere in impedance responses.Wwe do not know why nickel and its older brothers, palladium and platinum, are extremely affine to hydrogen and thus almost unbeatable at reducing bonds with it. Us being fascinated with such questions, even after 200 plus years of toying with them</p></li>
<li><p>What’s special about electrochemistry, and not physical chemistry overall or electromagnetism in physics, is the <strong>apparent bridge I’ve caught between the atomic scale (0.1 to 10 nm) and mesoscale (up to μm)</strong> in this branch. What you see is the complex interplay of surface phenomena: diffusion, (electro)sorption, redox reactions, transient EM fields… and the like. When you watch it in the nanometer window, it all makes no sense as a puzzling soup of equations; when you throw caution at the wind and average their behavior over time and space, electrochemical reactions appear as natural as the blue sky, erratic behaviors coalesce into a coherent set of steps, and breaking every bond<sup>3</sup> becomes possible.</p></li>
</ol>
<ol start="4" type="1">
<li>I easily become possessed by academic challenges, which is why I’m eager to begin my graduate studies. This doesn’t rule out physical chemistry, again, but that’s why my concentration is in <em>this branch</em>. Someone who loves symphonies may understandably have a preference for a wind or percussive instrument. However, they will without a doubt understand that, for their favorite instrument to sound accurate to the composer’s emotion, it has to be surrounded by other beautiful instruments, completing its flavor without relinquishing anything.</li>
</ol>
<p>I’d sum up that this is how I see electrochemistry: after seeing the wonders of physics and chemistry, and falling enamoured of the mysteries of electricity, what comes after? What’s the symphony that will sound the loudest, the most mysterious, the most cryptic but yet the sweetest? In a poetic way, I chose electrochemistry because I don’t understand it, and even hoping for the best I’m not sure that many of its puzzles will be solved for how long I am alive. In the same spirit which by I prefer certain music, electrochemistry is so authentic and unique that it allures me to keep researching. That’s why I think it’s so great.</p>




<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>The <a href="https://en.wikipedia.org/wiki/Daytona_500">Daytona 500</a> is a namesake race lasting five hundred miles in the Daytona International Speedway (Daytona Beach, Florida, USA). The equivalent of a Super Bowl or a World Cup Final for the NASCAR schedule, it has raised many competitors to a legendary status, even after many tries (such as <a href="https://www.youtube.com/watch?v=IxTAJNifDAI">the story of Dale Earnhardt</a>).↩︎</p></li>
<li id="fn2"><p>Or through the ether, as the founding scientists would have noted. This footnote serves mostly to satisfy my habit of writing footnotes.↩︎</p></li>
<li id="fn3"><p>What I say here is a fair depiction of what electrochemical synthesis, often coupled with electrocatalysts, has accomplished that was banished even from imagination to organic chemistry and thermal catalysis. See the myriad of papers…↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>electrochemistry</category>
  <category>metacognition</category>
  <guid>https://blog.q-bea.science/posts/whats-so-special/</guid>
  <pubDate>Fri, 30 Jan 2026 05:00:00 GMT</pubDate>
</item>
<item>
  <title>Where does the oscillation come from?</title>
  <dc:creator>Adelaide Beatriz Espinoza</dc:creator>
  <link>https://blog.q-bea.science/posts/oscillation-ground/</link>
  <description><![CDATA[ 





<section id="what-oscillation-exactly" class="level1 page-columns page-full">
<h1>What oscillation, exactly?</h1>
<p>One of my first experiments with a potentiostat was calibrating two silver / silver chloride (Ag/AgCl) reference electrodes (specifically, the <a href="https://www.metrohm.com/en/products/6/0726/60726100.html">Metrohm 6.0726.100</a> and <a href="https://www.metrohm.com/es_es/products/6/0733/60733100.html">6.0733.100</a> models; say, RPint2 and RPint3). Both electrodes were being cared for in the upstairs lab, and my advisor commissioned me and one of her research assistants to calibrate their electrode potential, which for a KCl(aq) 3.0 M electrolyte should have been 209 mV at room temperature (which was very close to 25 °C)<sup>1</sup>.</p>
<p>The (actually stable) reference was a well-aged Ag/AgCl electrode from the lab, ceremoniously tagged as “REP1” in bold black marker. Its formal electrode potential, <img src="https://latex.codecogs.com/png.latex?%7BE%5E%5Ccirc%7D'">, was determined to be 208.0 mV <em>versus</em> NHE<sup>2</sup> by a senior researcher long gone. Moreover, we connected the system to a very robust <a href="https://www.metrohm.com/es_es/products/a/ut30/aut302n_s.html">PGSTAT302N potentiostat</a> to determine the calibration samples’ open circuit potential (OCP), leaving little to no room for error as we even detangled the cell-to-potentiostat wires<sup>3</sup>.</p>
<p>What’s so enchanting about electrochemistry is that nothing is entirely under our control, ever. Indeed, when we recorded the two electrodes’ OCPs against REP1, a strange pattern emerged for the three whole hours.</p>
<div class="cell page-columns page-full">
<div class="cell-output-display page-columns page-full">
<div id="fig-rpaints" class="quarto-float quarto-figure quarto-figure-center anchored page-columns page-full" data-cap-location="margin">
<figure class="quarto-float quarto-float-fig figure page-columns page-full">
<div aria-describedby="fig-rpaints-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://blog.q-bea.science/posts/oscillation-ground/index_files/figure-html/fig-rpaints-1.png" class="img-fluid figure-img" width="672">
</div>
<figcaption class="quarto-float-caption-margin quarto-float-caption quarto-float-fig margin-caption" id="fig-rpaints-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Snake-like oscillations in the recorded open circuit potentials, <img src="https://latex.codecogs.com/png.latex?E_%5Ctext%7BOCP%7D">, for both electrodes against REP1 (208.0 mV vs.&nbsp;NHE).
</figcaption>
</figure>
</div>
</div>
</div>
<p>Do you see the snake-like oscillations in Figure&nbsp;1, every around 2000 seconds and with a magnitude lower than 0.1 mV? It is such an unimportant problem, that doesn’t determine the potential determined (it averages out!), but it <em>bothers me so, so much</em>. Where does it actually come from?</p>
</section>
<section id="no-really.-where-does-it-come-from" class="level1 page-columns page-full">
<h1>No, really. Where does it come from?</h1>
<p>My first intuition as an inexperienced electrochemist was to ask my advisor. Her contextual response was to tell me contractors were working outside the building, and that “this messes with the ground connection”. Since I don’t have any experience in electrical issues, I took her word for it at the time and didn’t worry too much. However, I already decided to investigate the <em>trend</em> these voltages could produce.</p>
<p>The shape of the curves suggest the voltages oscillate around a central value, so I wanted to test for two symmetrical distributions (i.e.&nbsp;uniform and normal). The Q-Q plots and the PPCC or Filliben’s test<sup>4</sup> for both assumptions can be seen in Figure&nbsp;2, and I’ve also gathered some summary statistics<sup>5</sup> in Table&nbsp;1.</p>
<div class="cell">
<details class="code-fold">
<summary><strong>Code:</strong> Implementation of the Filliben approximation in a QQ plot for normal and uniform distributions.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filliben's uniform order statistics medians</span></span>
<span id="cb1-2">filliben <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb1-3">  n <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(data)</span>
<span id="cb1-4">  store <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>()</span>
<span id="cb1-5">  store[n] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span>n)</span>
<span id="cb1-6">  store[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> store[n]</span>
<span id="cb1-7">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> (i <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span>(n<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">-1</span>)) {</span>
<span id="cb1-8">    store[i] <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (i <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3175</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="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.365</span>)</span>
<span id="cb1-9">  }</span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(store)</span>
<span id="cb1-11">}</span>
<span id="cb1-12"></span>
<span id="cb1-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Generate shifted uniform distributions</span></span>
<span id="cb1-14">gen_unif <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data) {</span>
<span id="cb1-15">  mi <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">min</span>(data)</span>
<span id="cb1-16">  ma <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">max</span>(data)</span>
<span id="cb1-17">  f <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> </span>
<span id="cb1-18">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(p) {</span>
<span id="cb1-19">      <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qunif</span>(p, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">min =</span> mi, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">max =</span> ma)</span>
<span id="cb1-20">    }</span>
<span id="cb1-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(f)</span>
<span id="cb1-22">}</span>
<span id="cb1-23"></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Store potentials in mV</span></span>
<span id="cb1-25">rpaint2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> ocp2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Potential / V</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span>[<span class="sc" 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="sc" 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 class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span></span>
<span id="cb1-26">rpaint3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> ocp3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span><span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Potential / V</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">`</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e3</span></span>
<span id="cb1-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Generate uniform distribution windows</span></span>
<span id="cb1-28">up2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gen_unif</span>(rpaint2)</span>
<span id="cb1-29">up3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gen_unif</span>(rpaint3)</span>
<span id="cb1-30"></span>
<span id="cb1-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Graphics generation</span></span>
<span id="cb1-32"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">layout</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(</span>
<span id="cb1-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<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="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>,</span>
<span id="cb1-34">    <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;">5</span>,<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</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;">3</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> F</span>
<span id="cb1-35">))</span>
<span id="cb1-36"></span>
<span id="cb1-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># histograms</span></span>
<span id="cb1-38"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hist</span>(rpaint2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">freq =</span> F,</span>
<span id="cb1-39">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>,</span>
<span id="cb1-40">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"density"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightpink1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">border =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"firebrick"</span>,</span>
<span id="cb1-41">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="sc" 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 class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5e-2</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"histogram for OCP of RPint2"</span>)</span>
<span id="cb1-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">hist</span>(rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">freq =</span> F,</span>
<span id="cb1-43">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(E[OCP] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / mV"</span>),</span>
<span id="cb1-44">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"density"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lightblue1"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">border =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"royalblue3"</span>,</span>
<span id="cb1-45">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">breaks =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">seq</span>(<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.10</span>, <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"histogram for OCP of RPint3"</span>)</span>
<span id="cb1-46"></span>
<span id="cb1-47"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># normality Q-Q plots</span></span>
<span id="cb1-48"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqnorm</span>(rpaint2, </span>
<span id="cb1-49">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"normal Q-Q plot for RPint2"</span>,</span>
<span id="cb1-50">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(E[OCP] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / mV"</span>),</span>
<span id="cb1-51">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pch =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray50"</span>)</span>
<span id="cb1-52"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqline</span>(rpaint2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"firebrick"</span>,</span>
<span id="cb1-53">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb1-54"></span>
<span id="cb1-55"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqnorm</span>(rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"normal Q-Q plot for RPint2"</span>,</span>
<span id="cb1-56">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theoretical quantiles"</span>,</span>
<span id="cb1-57">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(E[OCP] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / mV"</span>),</span>
<span id="cb1-58">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pch =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray50"</span>)</span>
<span id="cb1-59"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqline</span>(rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"royalblue3"</span>,</span>
<span id="cb1-60">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb1-61"></span>
<span id="cb1-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># uniformity plots</span></span>
<span id="cb1-63"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">up2</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filliben</span>(rpaint2)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> rpaint2, </span>
<span id="cb1-64">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform Q-Q plot for RPint2"</span>,</span>
<span id="cb1-65">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(E[OCP] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / mV"</span>),</span>
<span id="cb1-66">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pch =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray50"</span>)</span>
<span id="cb1-67"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqline</span>(rpaint2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"firebrick"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">distribution =</span> up2,</span>
<span id="cb1-68">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span>
<span id="cb1-69"></span>
<span id="cb1-70"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqplot</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">up3</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filliben</span>(rpaint3)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> rpaint3, </span>
<span id="cb1-71">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"theoretical quantiles"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform Q-Q plot for RPint3"</span>,</span>
<span id="cb1-72">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(E[OCP] <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" / mV"</span>),</span>
<span id="cb1-73">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">pch =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cex =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray50"</span>)</span>
<span id="cb1-74"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">qqline</span>(rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"royalblue3"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">distribution =</span> up3,</span>
<span id="cb1-75">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div id="fig-potential-distribution" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-potential-distribution-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://blog.q-bea.science/posts/oscillation-ground/index_files/figure-html/fig-potential-distribution-1.png" class="img-fluid figure-img" width="672">
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-potential-distribution-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;2: Histograms and Q-Q plots for the electrode potentials vs.&nbsp;Ag/AgCl in KCl 3M, assuming normality (middle) and uniformity (right).
</figcaption>
</figure>
</div>
</div>
</div>
<div class="cell page-columns page-full" data-tbl-colwidths="[9,13,13,13,13,13,13,13]" data-tbl-cap-location="margin">
<details class="code-fold">
<summary><strong>Code:</strong> Implementation of Filliben’s probability plot correlation coefficient (PPCC), plus the median and first four central moments of each dataset.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(knitr)</span>
<span id="cb2-2"></span>
<span id="cb2-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># adjusted Fisher-Pearson skewness, G[1]</span></span>
<span id="cb2-4">gskw <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sqrt</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span> <span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x) <span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>((x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(x))<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(x)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>}</span>
<span id="cb2-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># excess kurtosis wrt normal distribution, g[2]</span></span>
<span id="cb2-6">ekrt <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x) {<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sum</span>((x <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(x))<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> (<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(x)<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span>}</span>
<span id="cb2-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Filliben's probability plot correlation test, or PPCC</span></span>
<span id="cb2-8">ppcc <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(data, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">dist =</span> qnorm) {</span>
<span id="cb2-9">  uordered <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filliben</span>(data)</span>
<span id="cb2-10">  quantiles <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">dist</span>(uordered)</span>
<span id="cb2-11">  r <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">cor</span>(quantiles, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sort</span>(data))</span>
<span id="cb2-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(r)</span>
<span id="cb2-13">}</span>
<span id="cb2-14"></span>
<span id="cb2-15">summaries <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">data.frame</span>(</span>
<span id="cb2-16">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean</span>(rpaint3)),</span>
<span id="cb2-17">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">median</span>(rpaint3)),</span>
<span id="cb2-18">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"stdev"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sd</span>(rpaint3)),</span>
<span id="cb2-19">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skw"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gskw</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">gskw</span>(rpaint3)),</span>
<span id="cb2-20">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"krt"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ekrt</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ekrt</span>(rpaint3)),</span>
<span id="cb2-21">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rn"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ppcc</span>(rpaint2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ppcc</span>(rpaint3)),</span>
<span id="cb2-22">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ru"</span> <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ppcc</span>(rpaint2, up2), <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ppcc</span>(rpaint3, up3))</span>
<span id="cb2-23">)</span>
<span id="cb2-24"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rownames</span>(summaries) <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RPint2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"RPint3"</span>)</span>
<span id="cb2-25"></span>
<span id="cb2-26"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">kable</span>(summaries, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">digits =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>,</span>
<span id="cb2-27">      <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col.names =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean  $</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">bar x$"</span>, </span>
<span id="cb2-28">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"median $p_{50}$"</span>, </span>
<span id="cb2-29">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"st. dev. $s$"</span>, </span>
<span id="cb2-30">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"skewness $G_1$"</span>, </span>
<span id="cb2-31">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"kurtosis $g_2$"</span>,</span>
<span id="cb2-32">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"normal ppcc $r_{x</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\\</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">mathcal{N}}$"</span>,</span>
<span id="cb2-33">                    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"uniform ppcc $r_{xU}$"</span>))</span></code></pre></div></div>
</details>
<div id="tbl-electrode-summaries" class="cell quarto-float quarto-figure quarto-figure-center anchored page-columns page-full" data-tbl-cap-location="margin" data-tbl-colwidths="[9,13,13,13,13,13,13,13]">
<figure class="quarto-float quarto-float-tbl figure page-columns page-full">
<div aria-describedby="tbl-electrode-summaries-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div class="cell-output-display">
<table class="cell caption-top table table-sm table-striped small">
<colgroup>
<col style="width: 9%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 13%">
<col style="width: 13%">
</colgroup>
<thead>
<tr class="header">
<th style="text-align: left;"></th>
<th style="text-align: right;">mean <img src="https://latex.codecogs.com/png.latex?%5Cbar%20x"></th>
<th style="text-align: right;">median <img src="https://latex.codecogs.com/png.latex?p_%7B50%7D"></th>
<th style="text-align: right;">st. dev. <img src="https://latex.codecogs.com/png.latex?s"></th>
<th style="text-align: right;">skewness <img src="https://latex.codecogs.com/png.latex?G_1"></th>
<th style="text-align: right;">kurtosis <img src="https://latex.codecogs.com/png.latex?g_2"></th>
<th style="text-align: right;">normal ppcc <img src="https://latex.codecogs.com/png.latex?r_%7Bx%5Cmathcal%7BN%7D%7D"></th>
<th style="text-align: right;">uniform ppcc <img src="https://latex.codecogs.com/png.latex?r_%7BxU%7D"></th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: left;">RPint2</td>
<td style="text-align: right;">-0.6403</td>
<td style="text-align: right;">-0.6439</td>
<td style="text-align: right;">0.0171</td>
<td style="text-align: right;">0.2788</td>
<td style="text-align: right;">-1.0209</td>
<td style="text-align: right;">0.9775</td>
<td style="text-align: right;">0.9927</td>
</tr>
<tr class="even">
<td style="text-align: left;">RPint3</td>
<td style="text-align: right;">-0.2309</td>
<td style="text-align: right;">-0.2319</td>
<td style="text-align: right;">0.0187</td>
<td style="text-align: right;">0.1682</td>
<td style="text-align: right;">-0.8424</td>
<td style="text-align: right;">0.9875</td>
<td style="text-align: right;">0.9934</td>
</tr>
</tbody>
</table>
</div>
</div>
<figcaption class="quarto-float-caption-margin quarto-float-caption quarto-float-tbl margin-caption" id="tbl-electrode-summaries-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Table&nbsp;1: Summary statistics for both electrode’s potential over time. RPint2 truncated before 1000 s. See footnotes for details on formulae.
</figcaption>
</figure>
</div>
</div>
<p>It’s clear that both voltages follow, if any, an uniform distribution around their formal potentials. Since the emergent electrical noise from a potentiostat should follow a normal distribution<sup>6</sup>, this gives grounds (pun not intended!) to point to somewhere else. And since I have no expertise in electrical engineering…</p>
</section>
<section id="theres-a-spectrum-of-possibilities" class="level1 page-columns page-full">
<h1>There’s a spectrum of possibilities</h1>
<p>…I happened to land on a beautifully written technical report from the North American SynchroPhasor Initiative<sup>7</sup>, that described how to diagnose and analyze the transient responses of a power system that’s oscillating. To me, this is sufficient to understand that</p>
<ol type="1">
<li><p>this system is oscillating <em>way too slowly</em> for an overtone of the power network to be happening. Even when a power system is mechanically forced, the resulting noise should be way faster. So, the construction workers are not to blame, and certainly not the 220 VAC network in place.</p></li>
<li><p>anything oscillating so slowly should be in the ballpark of <a href="https://en.wikipedia.org/wiki/Pink_noise">pink noise</a>, i.e.&nbsp;a signal with a power spectral density <img src="https://latex.codecogs.com/png.latex?S(%5Cnu)"> decaying as <img src="https://latex.codecogs.com/png.latex?1/%5Cnu%5E%5Calpha">, where <img src="https://latex.codecogs.com/png.latex?0%20%3C%20%5Calpha%20%3C%202"> is a constant and <img src="https://latex.codecogs.com/png.latex?%5Cnu"> is the frequency<sup>8</sup>.</p></li>
</ol>
<p>Being nowhere closer to being an electrical engineer, I decided to brush up on Fourier transforms and ask someone else<sup>9</sup> <em>how</em> to analyze a visible trend in the power spectrum. After zero-filling and transforming the data, a pair of periodograms appear with what seems to be a borderline pink noise.</p>
<p>Regrettably, the sampling period is a very long <img src="https://latex.codecogs.com/png.latex?T%20=%201%20%5Ctext%7B%20s%7D">, which leads to an inaccurate Nyquist frequency of 0.5 Hz. This only helps us decode <em>extremely</em> low frequency trends, but luckily, this is all we need.</p>
<div class="cell page-columns page-full">
<details class="code-fold">
<summary><strong>Code:</strong> Fourier transform and cleanup of both datasets to perform a log-log linear regression, looking for a pink noise-like trend.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb3" data-cap-location="margin" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb3-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># zero-padding implementation</span></span>
<span id="cb3-2">zero_fill <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">function</span>(x, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">times =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span>) {</span>
<span id="cb3-3">  long <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">=</span> times <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">length</span>(x)</span>
<span id="cb3-4">  x <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(x, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">rep</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">times =</span> long))</span>
<span id="cb3-5">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">return</span>(x)</span>
<span id="cb3-6">}</span>
<span id="cb3-7"></span>
<span id="cb3-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># zero filled time-domain data</span></span>
<span id="cb3-9">zf_rpaint2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">zero_fill</span>(rpaint2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">times =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>)</span>
<span id="cb3-10">zf_rpaint3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">zero_fill</span>(rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">times =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">19</span>)</span>
<span id="cb3-11"></span>
<span id="cb3-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># PSD estimations</span></span>
<span id="cb3-13">paint2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spectrum</span>(zf_rpaint2, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot =</span> F)</span>
<span id="cb3-14">paint3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">spectrum</span>(zf_rpaint3, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yes"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">plot =</span> F)</span>
<span id="cb3-15"></span>
<span id="cb3-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># 1/f noise regression</span></span>
<span id="cb3-17"></span>
<span id="cb3-18">bool2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>)</span>
<span id="cb3-19">bool3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> (paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-4</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&amp;</span> (paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-2</span>)</span>
<span id="cb3-20"></span>
<span id="cb3-21">pink2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log10</span>(paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>spec[bool2]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log10</span>(paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq[bool2]))</span>
<span id="cb3-22">pink3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log10</span>(paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>spec[bool3]) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">log10</span>(paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq[bool3]))</span>
<span id="cb3-23"></span>
<span id="cb3-24"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">layout</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">matrix</span>(</span>
<span id="cb3-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<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="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="at" style="color: #657422;
background-color: null;
font-style: inherit;">byrow =</span> F</span>
<span id="cb3-26">))</span>
<span id="cb3-27"></span>
<span id="cb3-28"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>spec <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yx"</span>,</span>
<span id="cb3-29">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray20"</span>,</span>
<span id="cb3-30">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"power spectrum of RPint2"</span>,</span>
<span id="cb3-31">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(frequency <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> nu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> (Hz)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spectral density ("</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> V<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/ Hz)"</span>)</span>
<span id="cb3-32">     )</span>
<span id="cb3-33"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">points</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> paint2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq[bool2], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict.lm</span>(pink2),</span>
<span id="cb3-34">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"royalblue3"</span>)</span>
<span id="cb3-35"></span>
<span id="cb3-36">coef <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.vector</span>(pink2<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>coefficients), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb3-37">peq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substitute</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">italic</span>(S)(nu) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>int <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> nu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>coef, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">int =</span> coef[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coef =</span> coef[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb3-38"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5e-5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray0"</span>,</span>
<span id="cb3-39">     peq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adj =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb3-40">rsq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(pink2)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>adj.r.squared</span>
<span id="cb3-41">rex <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substitute</span>(R<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> rsq, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rsq =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(rsq, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)))</span>
<span id="cb3-42"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.3e-7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"royalblue3"</span>,</span>
<span id="cb3-43">  rex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adj =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb3-44"></span>
<span id="cb3-45"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plot</span>(paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>spec <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">log =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"yx"</span>,</span>
<span id="cb3-46">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray20"</span>,</span>
<span id="cb3-47">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">main =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"power spectrum of RPint3"</span>,</span>
<span id="cb3-48">     <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">xlab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(frequency <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">","</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> nu <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> (Hz)), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">ylab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">expression</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spectral density ("</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> V<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/ Hz)"</span>)</span>
<span id="cb3-49">)</span>
<span id="cb3-50"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">points</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> paint3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>freq[bool3], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">predict.lm</span>(pink3),</span>
<span id="cb3-51">       <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">type =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"l"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lty =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">lwd =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"firebrick"</span>)</span>
<span id="cb3-52"></span>
<span id="cb3-53">coef <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">as.vector</span>(pink3<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>coefficients), <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)</span>
<span id="cb3-54">peq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substitute</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">italic</span>(S)(nu) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>int <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">*</span> nu<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">^</span>coef, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">int =</span> coef[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span>], <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">coef =</span> coef[<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>]))</span>
<span id="cb3-55"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-9</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gray0"</span>,</span>
<span id="cb3-56">     peq, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adj =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span>
<span id="cb3-57">rsq <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summary</span>(pink3)<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>adj.r.squared</span>
<span id="cb3-58">rex <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">substitute</span>(R<span class="sc" 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="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> rsq, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">rsq =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">round</span>(rsq, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span>)))</span>
<span id="cb3-59"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">text</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e-5</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2e-11</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"firebrick"</span>,</span>
<span id="cb3-60">  rex, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">adj =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>)</span></code></pre></div></div>
</details>
<div class="cell-output-display page-columns page-full">
<div id="fig-periodogram-re" class="quarto-float quarto-figure quarto-figure-center anchored page-columns page-full" data-cap-location="margin">
<figure class="quarto-float quarto-float-fig figure page-columns page-full">
<div aria-describedby="fig-periodogram-re-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<img src="https://blog.q-bea.science/posts/oscillation-ground/index_files/figure-html/fig-periodogram-re-1.png" class="img-fluid figure-img" width="672">
</div>
<figcaption class="quarto-float-caption-margin quarto-float-caption quarto-float-fig margin-caption" id="fig-periodogram-re-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;3: Periodograms of the <img src="https://latex.codecogs.com/png.latex?E_%5Ctext%7BOCP%7D"> time series with linear regressions in the 100μ-10mHz range.
</figcaption>
</figure>
</div>
</div>
</div>
<p>What’s common between both is the bump between 10-100 μHz, which doesn’t align with an oscillation every 2000 s (i.e.&nbsp;500 μHz). Moreover, the frequency exponents exceed 2, which suggests that what I’m seeing is not any more pink noise than it is my computer <em>trying to show me a Dirac delta without exploding.</em></p>
</section>
<section id="then-was-it-all-for-nothing" class="level1">
<h1>Then, was it all for nothing?</h1>
<p>Not exactly. Apart from it being extremely fun (since I started writing it, there have been low lows and high highs in this research, and it all pays off), I have coded more intensely in R than I have anytime in 2025, which helps me maintain my R skills awake and ready for any opportunity that may come.</p>
<p>Moreover, this whole tour encouraged me to put out an incomplete result, with the sole purpose of having fun. :-)</p>
<p>And closing, the original question. I haven’t seen this mentioned anywhere, but what I suspect empirically and more as a witch tale, is that the day I was measuring potentials, the air conditioning must have been working overtime. Exhausted from cooling a room to a near perfect 22 °C while fighting off the spring-to-summer heat in South America, it might have let out a few gasps every twenty minutes or so, let its guard down and continued to function as if nothing happened.</p>
<p>So in a more magical note, this oscillation with a frequency in the tenths of mHz is, to me, nothing more than the AC unit calling for help, and the potentiostat experiencing it as temperature fluctuating in the room. Like <a href="https://www.researchgate.net/post/Is_the_ring_breathing_mode_of_vibration_different_from_C-C_stretching_in_benzene_ring">the breathing of a ring</a>.</p>
<section id="acknowledgements" class="level2">
<h2 class="anchored" data-anchor-id="acknowledgements">Acknowledgements</h2>
<p>I’d like to thank the NASPI for their masterful article on oscillations in power systems<sup>10</sup>. I’m grateful to <a href="https://stats.stackexchange.com/users/919/whuber">whuber</a> back at Cross Validated for an insightful response.</p>
<p>And, as always, thanks to Wikipedia for clearing out definitions on the way. Make sure to <a href="https://donate.wikimedia.org/w/index.php">donate to Wikimedia Foundation</a> so they can keep doing their mission.</p>


</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>Our lab’s temperature was at 21.5 °C that day. Here’s the catch: even assuming the temperature coefficient, <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7DE%C2%B0'/%5Cmathrm%7Bd%7DT">, caused only a small (&lt; 1 mV) drift in the electrode potential, <img src="https://latex.codecogs.com/png.latex?%7BE%5E%7B%5Ccirc%7D%20%7D'%20_%5Ctext%7BAg/AgCl%7D">, <em>a really thorough calibration should have considered this deviation</em>. However, no matter how far I looked into the subject, I found no values for <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7Bd%7D%7BE%5E%7B%5Ccirc%7D%20%7D'%20/%5Cmathrm%7Bd%7DT"> or any interpolation equation for <img src="https://latex.codecogs.com/png.latex?%7BE%5E%7B%5Ccirc%7D%20%7D'(T)"> across (<strong>a</strong>) any concentration range near 3.0 M and (<strong>b</strong>) at temperatures including 21.5 °C.↩︎</p></li>
<li id="fn2"><p>The normal hydrogen electrode (NHE) is a fictive two-electrode cell comprised by a Pt electrode submerged in a solution with an acid concentration of <img src="https://latex.codecogs.com/png.latex?%5Cleft%5B%5Cmathrm%7BH%5E+%7D%20%5Cright%5D"> = 1 mol/L and a steady current of 1 bar of <img src="https://latex.codecogs.com/png.latex?%5Cmathrm%7BH_2%7D"> bubbled through. Its differences with the standard (SHE) and reversible (RHE) hydrogen electrodes can be found <a href="https://en.wikipedia.org/wiki/Standard_hydrogen_electrode#SHE_vs_NHE_vs_RHE">here</a> but are negligible for our purposes.↩︎</p></li>
<li id="fn3"><p>This might be a witch’s tale at this point, but my colleagues have taught me even <em>cable inductance</em>, generated by coiling wires, affects the outcome of electrochemical experiments.↩︎</p></li>
<li id="fn4"><p>J. J. Filliben. “The Probability Plot Correlation Coefficient Test for Normality”. <em>Technometrics</em> <strong>1975</strong>, 17(1), 111–117. doi: <a href="https://doi.org/10.1080/00401706.1975.10489279">10.1080/00401706.1975.10489279</a>. This is a historical paper that treats a new use of the Pearson correlation coefficient of the straight line drawn in probability plots, in evaluating the adherence of a certain dataset to a hand-picked distribution (cf.&nbsp;“normality”, “uniformity”, “gamma-ness”, etc.). You can read a freely available copy <a href="https://www1.cmc.edu/pages/faculty/MONeill/Math152/Handouts/filliben.pdf">here</a>.↩︎</p></li>
<li id="fn5"><p>The standard deviation <img src="https://latex.codecogs.com/png.latex?s"> is calculated with the Bessel correction, i.e.&nbsp;with a factor of <img src="https://latex.codecogs.com/png.latex?1/%5Csqrt%7BN%20-%201%7D">. The (<img src="https://latex.codecogs.com/png.latex?s">-normalized) third moment is the Fisher-Pearson skewness adjusted for sample sizes, <img src="https://latex.codecogs.com/png.latex?G_1">: <img src="https://latex.codecogs.com/png.latex?%20G_1%20=%20%5Cfrac%7B%5Csqrt%7B1%20-%201/N%7D%7D%7BN-2%7D%20%5C,%20%5Cfrac%7B%5Csum_%7Bj%20=%201%7D%5E%7BN%7D%20(x_j%20-%20%5Cbar%7Bx%7D)%5E3%7D%7Bs%5E3%7D%20"> whereas the fourth moment is the (<img src="https://latex.codecogs.com/png.latex?s">-normalized) <strong>excess</strong> kurtosis with respect to the normal distribution, without corrections for sample sizes: <img src="https://latex.codecogs.com/png.latex?%20g_2%20=%20%5Cfrac%7B1%7D%7BN%7D%20%5C,%5Cfrac%7B%5Csum_%7Bj%20=%201%7D%5EN%20(x_j%20-%20%5Cbar%7Bx%7D)%5E4%7D%7Bs%5E4%7D%20-%203%20">↩︎</p></li>
<li id="fn6"><p>By an ergodic argument: since the number of electrons (charge carriers) goes to infinity, the energy exchanged by their averaged thermal motion should follow the Central Limit Theorem, and thus show a normal behavior. See <a href="https://dsp.stackexchange.com/questions/29475/why-is-gaussian-noise-called-so">dsp.se 29475: “Why is Gaussian noise called so?”</a> for a simpler explanation.↩︎</p></li>
<li id="fn7"><p>North American SynchroPhasor Initiative (NASPI). <a href="https://www.naspi.org/documents/power-system-oscillatory-behaviors-sources-characteristics-analyses">“Power System Oscillatory Behaviors: Sources, Characteristics, &amp; Analyses”</a>; 2025/may/17, PNNL-26375.↩︎</p></li>
<li id="fn8"><p>I’m pretty sure I’m pissing off some people in the electrical engineering community, but come on – <img src="https://latex.codecogs.com/png.latex?f"> is reserved for <a href="https://en.wikipedia.org/wiki/Function_(mathematics)">far more interesting things</a> and <img src="https://latex.codecogs.com/png.latex?%5Cnu"> looks cooler.↩︎</p></li>
<li id="fn9"><p>I asked the wise people at Cross Validated, the Stack Exchange forum for statistics, for advice and <a href="https://stats.stackexchange.com/questions/674061/weighting-logarithmic-data-in-regression-by-intensity-relative-to-baseline">someone actually replied (CV.se 674061)</a>.↩︎</p></li>
<li id="fn10"><p>North American SynchroPhasor Initiative (NASPI). <a href="https://www.naspi.org/documents/power-system-oscillatory-behaviors-sources-characteristics-analyses">“Power System Oscillatory Behaviors: Sources, Characteristics, &amp; Analyses”</a>; 2025/may/17, PNNL-26375.↩︎</p></li>
</ol>
</section></div> ]]></description>
  <category>electrochemistry</category>
  <category>statistics</category>
  <guid>https://blog.q-bea.science/posts/oscillation-ground/</guid>
  <pubDate>Thu, 22 Jan 2026 05:00:00 GMT</pubDate>
</item>
</channel>
</rss>
