<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2021-03-11T23:48:01+00:00</updated><id>/feed.xml</id><title type="html">Moosenon’s Blog</title><subtitle>I write blog posts anonymously about things that I would want to read and see online. </subtitle><entry><title type="html">Rocket Propeller</title><link href="/dynamics/2021/03/11/rocket-propeller.html" rel="alternate" type="text/html" title="Rocket Propeller" /><published>2021-03-11T10:05:23+00:00</published><updated>2021-03-11T10:05:23+00:00</updated><id>/dynamics/2021/03/11/rocket-propeller</id><content type="html" xml:base="/dynamics/2021/03/11/rocket-propeller.html">&lt;style type=&quot;text/css&quot;&gt;
.center {
    margin: 0 auto;
    display: block;
}
.scale {
    min-width: 70%;
}
.box {
    border-style: solid;
}
&lt;/style&gt;

&lt;script type=&quot;text/x-mathjax-config&quot;&gt;
MathJax.Hub.Config({
    TeX: {
      equationNumbers: {
        autoNumber: &quot;AMS&quot;
      }
    },
    tex2jax: {
    inlineMath: [ ['$', '$'] ],
    displayMath: [ ['$$', '$$'] ],
    processEscapes: true,
  }
});
MathJax.Hub.Register.MessageHook(&quot;Math Processing Error&quot;,function (message) {
      alert(&quot;Math Processing Error: &quot;+message[1]);
    });
MathJax.Hub.Register.MessageHook(&quot;TeX Jax - parse error&quot;,function (message) {
      alert(&quot;Math Processing Error: &quot;+message[1]);
    });
&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot; async=&quot;&quot; src=&quot;https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML&quot;&gt;
&lt;/script&gt;

&lt;p&gt;Problems can seem deceptively simple. A while ago, I got asked what I thought
would be a boring and simple 2D dynamics problem, but it ended up becoming a
really interesting math problem involving complex numbers. I wanted to share
this problem because it illuminated a couple concepts for me, and I hope to
share that knowledge with others. First, I learned that understanding how
objects relate to eachother does not mean that I’ll be able to easily solve for
how those same objects concretely interact with eachother. Second, I learned
that “imaginary” numbers can pop up all over the place, even in something as
seemingly simple as a 2D dynamics problem.&lt;/p&gt;

&lt;p&gt;The problem that I was asked to help with, was understanding what would happen
if a force was constantly applied perpendicularly to a skinny bar at one of its
ends. The person who asked it thought a propeller could be modeled as a bar with
a massless rocket thruster at one of its ends – and it can’t – but I didn’t
tell them that because I thought it was funny and the problem was really
interesting.&lt;/p&gt;

&lt;h2 id=&quot;the-boring-part&quot;&gt;The Boring Part&lt;/h2&gt;

&lt;p&gt;Before I can get to the interesting part I have to go through the regular
dynamics. I tried to be thorough, so it includes a lot of math. If you want to
skip ahead to where the complex numbers are introduced, click
&lt;a href=&quot;#the-interesting-part&quot;&gt;here&lt;/a&gt;. If you just want to see how I simulated the
system, click &lt;a href=&quot;#the-simulation&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h1 id=&quot;problem-statement&quot;&gt;Problem Statement&lt;/h1&gt;

&lt;p&gt;A long skinny bar at rest with uniformly distributed mass &lt;span&gt;$m$&lt;/span&gt;,
center of mass &lt;span&gt;$G$&lt;/span&gt;, and length &lt;span&gt;$L$&lt;/span&gt; experiences a
constant magnitude force &lt;span&gt;$\bf{\vec{F}}$&lt;/span&gt; perpendicular to the bar at
point &lt;span&gt;$P$&lt;/span&gt; on one of its ends. Describe the motion of the bar.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/rocket_propeller/figure1.svg&quot; alt=&quot;Problem Figure&quot; class=&quot;center scale&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;step-1-find-orientation&quot;&gt;Step 1: Find orientation&lt;/h1&gt;

&lt;p&gt;The first step is to find the orientation of the bar at any point in time.&lt;/p&gt;

&lt;p&gt;If I define &lt;span&gt;$\theta(t)$&lt;/span&gt; to be the angle of the bar at time
&lt;span&gt;$t$&lt;/span&gt;, then I can define:&lt;/p&gt;
&lt;div&gt;$$
\bf{\vec{r}}_{\mathit{P/G}} = \mathrm{\frac{\mathit{L}}{2}} \left[\matrix{ \cos(\theta)
\cr \sin(\theta) }\right] 
$$&lt;/div&gt;
&lt;div&gt;$$
\bf{\vec{F}} = \lvert\vec{F}\rvert \left[\matrix{ -\sin(\theta) \cr \cos(\theta) }\right]
$$&lt;/div&gt;

&lt;p&gt;I need the &lt;span&gt;$\theta$&lt;/span&gt; terms to keep track of the direction of the
force and the relative position of &lt;span&gt;$P$&lt;/span&gt;. I’ll also be solving for
&lt;span&gt;$\theta$&lt;/span&gt;.&lt;/p&gt;

&lt;p&gt;Since &lt;span&gt;$\bf{\vec{F}}$&lt;/span&gt; and &lt;span&gt;$\bf{\vec{r}}_{\mathrm{P/G}}$&lt;/span&gt;
are always perpendicular to eachother, the torque about point &lt;span&gt;$G$&lt;/span&gt;
on the bar is&lt;/p&gt;
&lt;div&gt;$$
\bf{T_\mathit{G}} = \lvert\bf{\vec{r}}_{\mathrm{P/G}}\rvert \lvert\vec{F}\rvert 
$$&lt;/div&gt;
&lt;div&gt;$$
= \frac{ \mathit{L} \lvert\bf{\vec{F}}\rvert }{\mathrm{2}}
$$&lt;/div&gt;

&lt;p&gt;You can verify this by pretending the cross product exists in two dimensions
like my undergraduate physics professor loved to do.&lt;/p&gt;

&lt;p&gt;From 2D rigid body dynamics,&lt;/p&gt;
&lt;div&gt;$$
\mathbf{T} = \mathrm{I}\mathbf{\alpha}
$$&lt;/div&gt;
&lt;div&gt;$$
\bf{T_\mathit{G}} = \mathrm{I_\mathit{G}\frac{d^2 \theta}{d t^2}}
$$&lt;/div&gt;

&lt;p&gt;For a long skinny bar, the &lt;a href=&quot;https://en.wikipedia.org/wiki/List_of_moments_of_inertia&quot;&gt;moment of inertia of the rod about
&lt;span&gt;$G$&lt;/span&gt;&lt;/a&gt;
is &lt;span&gt;$\mathrm{I}_\mathit{G} = \frac{mL^2}{12}$&lt;/span&gt;. Substituting that and the value found
for torque above, the equation becomes:&lt;/p&gt;

&lt;div&gt;$$
\frac{ \mathit{L} \lvert\bf{\vec{F}}\rvert }{\mathrm{2}}
 = \mathrm{\frac{\mathit{mL}^2}{12} \frac{d^2 \theta}{d t^2}}
$$&lt;/div&gt;

&lt;p&gt;which can be simplified into:&lt;/p&gt;

&lt;div&gt;$$ 
\mathrm{\frac{d^2 \theta}{d t^2}} =
\frac{6\lvert\bf{\vec{F}}\rvert}{\mathit{mL}}
$$&lt;/div&gt;

&lt;p&gt;I was working from the assumption that the rod starts at rest and at
&lt;span&gt;$\theta = 0$&lt;/span&gt;, so after integrating twice:&lt;/p&gt;
&lt;div&gt; $$
\theta(t) = \frac{3\lvert\bf{\vec{F}}\rvert \mathit{t}^\mathrm{2}}{\mathit{mL}}
$$&lt;/div&gt;

&lt;p&gt;To make things easier I defined&lt;/p&gt;
&lt;div&gt; $$
k = \frac{3\lvert\bf{\vec{F}}\rvert}{\mathit{mL}}
$$&lt;/div&gt;

&lt;p&gt;So the orientation of the bar &lt;span&gt;$\theta(t)$&lt;/span&gt; is&lt;/p&gt;
&lt;div&gt; $$
\theta(t) = kt^2
$$&lt;/div&gt;

&lt;h1 id=&quot;step-2-find-the-motion&quot;&gt;Step 2: Find the motion&lt;/h1&gt;

&lt;p&gt;This part should be simple. I define the changing position of point
&lt;span&gt;$G$&lt;/span&gt; as &lt;span&gt;$\bf{\vec{r}_\mathrm{G}}$&lt;/span&gt; and apply Newton’s
second law&lt;/p&gt;
&lt;div&gt; $$
\mathbf{\vec{F}} = \mathit{m}\mathbf{\vec{a}}
$$ &lt;/div&gt;
&lt;div&gt; $$
\bf{\vec{F}} = \mathit{m}\frac{ \mathrm{d^2} \vec{\bf{r}}_\mathit{G}
}{\mathrm{d} \mathit{t}^\mathrm{2}} 
$$ &lt;/div&gt;

&lt;p&gt;Plugging in known values and simplifying I find:&lt;/p&gt;
&lt;div&gt;$$
\frac{ \mathrm{d^2} \vec{\bf{r}}_\mathit{G}}{\mathrm{d} \mathit{t}^2} =
\frac{ \lvert\bf{\vec{F}}\rvert }{\mathit{m}}
\left[\matrix{ -\sin(\mathit{kt^2}) \cr \cos(\mathit{kt^2}) }\right]
$$&lt;/div&gt;

&lt;p&gt;and now if I integrate with respect to time I get:&lt;/p&gt;
&lt;div&gt;$$
???
$$&lt;/div&gt;
&lt;p&gt;Wait. That doesn’t look right. Let me try again.&lt;/p&gt;

&lt;p&gt;and now if I integrate with respect to time I get:&lt;/p&gt;
&lt;div&gt;$$
???
$$&lt;/div&gt;

&lt;p&gt;Something looks wrong.&lt;/p&gt;

&lt;h2 id=&quot;the-interesting-part&quot;&gt;The Interesting Part&lt;/h2&gt;

&lt;p&gt;Why did the problem become hard to solve? Well, the acceleration the bar
experiences is given by the following equation:&lt;/p&gt;
&lt;div&gt;$$
\vec{\bf{a}} =
\frac{ \lvert\bf{\vec{F}}\rvert }{\mathit{m}}
\left[\matrix{ -\sin(\mathit{kt^2}) \cr \cos(\mathit{kt^2}) }\right]
$$&lt;/div&gt;

&lt;p&gt;If I wanted to find the velocity of the bar, I needed to integrate that vector
with respect to time. To do that, I had to find both of these integrals&lt;/p&gt;
&lt;div&gt;$$
\int \sin(kt^2)dt
$$&lt;/div&gt;
&lt;div&gt;$$
\int \cos(kt^2)dt
$$&lt;/div&gt;
&lt;p&gt;which I didn’t know how to solve for.&lt;/p&gt;

&lt;p&gt;At the time, I was trying to find a solution without using the internet. Using
the internet on problems like these can sometimes feel like cheating, and dampen
the satisfaction of coming up with a solution on my own. Looking it up now,
those are known as the &lt;a href=&quot;https://en.wikipedia.org/wiki/Fresnel_integral&quot;&gt;Fresnel
integrals&lt;/a&gt;, but they were not
integrals that I knew how to solve then. What I did know was the &lt;a href=&quot;https://en.wikipedia.org/wiki/Gaussian_integral&quot;&gt;Gaussian
integral&lt;/a&gt;, and I saw a sine and cosine that I could manipulate into an
exponential if I moved the problem into the complex plane.&lt;/p&gt;

&lt;p&gt;If I let the horizontal direction of the problem be represented by the real
numbers, and the vertical direction by the imaginary numbers, then the
acceleration vector becomes the complex number below.&lt;/p&gt;
&lt;div&gt;$$
z = \frac{ \lvert\bf{\vec{F}}\rvert }{\mathit{m}}(-\sin(kt^2) + i\cos(kt^2))
$$ &lt;/div&gt;
&lt;div&gt;$$
= \frac{ i \lvert\bf{\vec{F}}\rvert }{\mathit{m}}(\cos(kt^2) + i\sin(kt^2) )
$$ &lt;/div&gt;
&lt;div&gt;$$
= \frac{ i \lvert\bf{\vec{F}}\rvert }{\mathit{m}}e^{ikt^2}
$$ &lt;/div&gt;

&lt;p&gt;I still have the issue that there is no analytic solution for the integral, but
if I look at the problem as &lt;span&gt;$t \to \infty$&lt;/span&gt; I can use a modified
Gaussian integral&lt;/p&gt;
&lt;div&gt;$$
\int_{0}^{\infty} {e^{-\alpha x^2}} dx = \frac{1}{2} \sqrt{\frac{\pi}{\alpha}}
$$&lt;/div&gt;

&lt;p&gt;and just pretend it works the same for imaginary numbers of
&lt;span&gt;$\alpha$&lt;/span&gt; to find what the velocity approaches.&lt;/p&gt;

&lt;div&gt;$$
v = \int_{0}^{\infty}\frac{ i \lvert\bf{\vec{F}}\rvert }{\mathit{m}}e^{ikt^2} dt
$$&lt;/div&gt;
&lt;div&gt;$$
= \frac{ i \lvert\bf{\vec{F}}\rvert }{\mathit{m}}\int_{0}^{\infty}e^{ikt^2} dt
$$&lt;/div&gt;
&lt;div&gt;$$
= \frac{ i \lvert\bf{\vec{F}}\rvert }{2 \mathit{m}} \sqrt{\frac{\pi}{-ik}}
$$&lt;/div&gt;
&lt;div&gt;$$
= \frac{ \lvert\bf{\vec{F}}\rvert }{\mathit{m}} \sqrt{\frac{\pi}{8k}}(-1 + i)
$$&lt;/div&gt;

&lt;p&gt;And if I plugin the value of &lt;span&gt;$k$&lt;/span&gt; from above:&lt;/p&gt;

&lt;div&gt;$$
v = \sqrt{\frac{\pi\mathit{L}\lvert\bf{\vec{F}}\rvert}{12\mathit{m}}}
\left(-\frac{\sqrt{2}}{2} + \frac{\sqrt{2}}{2}i\right)
$$&lt;/div&gt;

&lt;p&gt;Now I can translate back from the complex plane to the vector space to find that
the velocity of the bar approaches the following vector:&lt;/p&gt;

&lt;div&gt;$$
\mathbf{\vec{v}} =
\sqrt{\frac{\pi\mathit{L}\lvert\bf{\vec{F}}\rvert}{12\mathit{m}}}
\left[\matrix{\frac{-\sqrt{2}}{2} \cr \frac{\sqrt{2}}{2}}\right]
$$&lt;/div&gt;

&lt;p&gt;That answer felt satisfying. The general behavior could be described. The bar
will start at rest, and constantly increase its rotational velocity as its
linear velocity spirals asymptotically towards that final answer. Technically
there’s more math that could be done, such as quantifying how long it takes to
reach a stable threshold near the final velocity, but that seemed difficult and
really I was just tired of math. I also had a more pressing issue.&lt;/p&gt;

&lt;p&gt;How could I be sure that my answer was right? I had made fun of my undergraduate
physics professor earlier for pretending that cross products exist in two
dimensions, but now I had just come up with the assumption that Gaussian
integrals worked for complex numbers (maybe my professor was onto something…).
I could try to find the answer online, but I was still trying to avoid looking
up the answer to any part. So, I did the next worse thing: proof by simulation.
If it’s good enough for the computer, it’s good enough for me.&lt;/p&gt;

&lt;h2 id=&quot;the-simulation&quot;&gt;The Simulation&lt;/h2&gt;

&lt;p&gt;I included a simulation of this problem in the canvas below. Uncheck the
“stopped” box to start the simulation, and use the sliders to change the
parameters of the system and restart. The green arrow represents the current
velocity of the bar, while the blue arrow represents the expected velocity from
the math above.&lt;/p&gt;

&lt;div id=&quot;guiContainer&quot;&gt;&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;canvas id=&quot;simulation&quot; class=&quot;center scale box&quot;&gt;It seems you don't have canvas
supported. Sorry about that.&lt;/canvas&gt;
&lt;script src=&quot;/assets/rocket_propeller/propellerSim.js&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
document.onreadystatechange = () =&gt; {
    if (document.readyState == &quot;interactive&quot;) {
        let sim = new propellerSim.World(
            document.getElementById(&quot;simulation&quot;),
            document.getElementById(&quot;guiContainer&quot;),
        )
    }
}
&lt;/script&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;If you let the simulation run long enough, the bar will eventually rotate so
fast and accumulate enough error that it’ll deviate from the expected output.
Increasing the number of substeps should increase the amount of time that it’s
stable, but because of precision errors the velocity will always eventually
deviate.&lt;/p&gt;

&lt;p&gt;The source code can be viewed &lt;a href=&quot;https://github.com/moosenon/propeller_sim&quot;&gt;here&lt;/a&gt;
if you want to see it for yourself.&lt;/p&gt;</content><author><name></name></author><category term="dynamics" /><summary type="html">Problems can seem deceptively simple. A while ago, I got asked what I thought would be a boring and simple 2D dynamics problem, but it ended up becoming a really interesting math problem involving complex numbers. I wanted to share this problem because it illuminated a couple concepts for me, and I hope to share that knowledge with others. First, I learned that understanding how objects relate to eachother does not mean that I’ll be able to easily solve for how those same objects concretely interact with eachother. Second, I learned that “imaginary” numbers can pop up all over the place, even in something as seemingly simple as a 2D dynamics problem.</summary></entry></feed>