Approaching the ultimate answer for m<1

Far out in the uncharted backwaters of the unfashionable end of the Western Spiral arm of the Galaxy lies a small unregarded yellow sun.
Orbiting this at a distance of roughly ninety-eight million miles is an utterly insignificant little blue-green planet whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea.
This planet has—or rather had—a problem, which was this: most of the people living on it were unhappy for pretty much of the time. Many solutions were suggested for this problem, but most of these were largely concerned with the movements of small green pieces of paper, which is odd because on the whole it wasn’t the small green pieces of paper that were unhappy.
And so the problem remained; lots of the people were mean, and most of them were miserable, even the ones with digital watches.

So sets Douglas Adams the scenery in his Hitchhiker’s Guide to the Galaxy. And he is right, neither green pieces of paper nor digital watches will make us happy. But digital computers – that’s another story. Digital computer, with some patience and determination made me happy today (or I made him happy, doesn’t mater which way), and I am going now to share my happiness with you. Because there is no true happiness which is not shared happiness.

And no, I am not going to calculate the answer to the Ultimate Question of Life, the Universe and Everything. Though we will be not very far away from obtaining such an answer. But please, don’t panic!

In the last post I have perversely asked this question:

So, my guess is that the formula (23) in the paper has wrong signs. What to do?
Should I write to the authors?

Now I admit, I was not completely sincere. I was teasing, I was playing with You, the Reader. Because the truth it that months ago I discovered wrong signs in the formula (20) of this paper. So, being young and naive, I wrote to prof. Zanna announcing my discovery. Here is the reply I got:

So, we should not consider the paper as being sacred, typos sometimes happen. But software – that is something different. Software is a serious matter. The software has been thoroughly tested, so if we test our software against something that has been thoroughly tested, that will be even better than through tests of our own code!

In The Hitchhiker’s Guide to the Galaxy the answer came as forty two.

“I checked it very thoroughly,” said the computer, “and that quite definitely is the answer.

We will also check very thoroughly. Our answer will not exactly be forty two. But we will come out with a quaternion, quaternio, quatro – it can explain 4. It remains to explain the last 2.

We will be testing example four from the code 903 – you need to read a couple of previous posts if you do not know what I am talking about. Alternatively, you can download the file 903.zip, unzip it, go to the folder 903\Fortran77\Drivers, and contemplate the following three files there: driver_example4.f, init_example4.dat, out_example4.dat. All three with number four. That is what we will be doing now.

 Helsinky OH 52 - Emil ZÁTOPEK maraton
Emil Zátopek was a Czechoslovak long-distance runner best known for winning three gold medals at the 1952 Summer Olympics in Helsinki. He won gold in the 5,000 metres and 10,000 metres runs, but his final medal came when he decided at the last minute to compete in the first marathon of his life.

According to README.txt

driver_example3.f (example for FRB integration with many steps
of lenght h from 0 to Tfin, using
semi-exact methods)
To be linked with frb_step.f
driver_example4.f (Like driver_example3.f but uses quaternions)
To be linked with quat_step.f

Both examples have the body with the same moments of inertia, but initial momenta are different. So it is impossible to compare their outputs. We return to this issue later on, for now let us concentrate on example4.

The moments of inertia can be read from init_example4.dat. They are

(1)   \begin{eqnarray*} I_1&=&1.0,\\ I_2&=&1.012686988782515,\\ I_3&=&3.306237422473038 \end{eqnarray*}

So it is the same “future physics” body that we have already met in , when discussing example2.

Then comes initial angular momentum (which sometimes I call \mathbf{m} and sometimes \methbf{L}:

(2)   \begin{eqnarray*} m_1(0)&=&-0.544332842491675,\\ m_2(0)&=&0.729131780907662,\\ m_3(0)&=&-0.414811526666455. \end{eqnarray*}

As in Spinning Gulliver among giants we have

(3)   \begin{equation*} 1/I_2= 0.987472.\end{equation*}

We calculate d

    \[d =\frac{m_1(0)^2}{I_1}+\frac{m_2(0)^2}{I_2}+\frac{m_3(0)^2}{I_3}=0.873315.\]

So d<1/I_2, therefore we have m<1 case.
Now I am presenting the complete m<1 algorithm based on the method introduced in Standing on the shoulders of giants – Reboot.

The case m<1.

(4)   \begin{eqnarray*} A_1&=&\sqrt{\frac{I_1 (d I_3-1)}{I_3-I_1}},\\ A_2&=&\sqrt{\frac{I_2 (d I_3-1)}{I_3-I_2}},\\ A_3&=&\sqrt{\frac{I_3 (1-d I_1)}{I_3-I_1}},\\ B&=&\sqrt{\frac{(1-d I_1) (I_3-I_2)}{I_1 I_2 I_3}},\\ m&=&\frac{(d I_3-1) (I_2-I_1)}{(1-d I_1) (I_3-I_2)}. \end{eqnarray*}

The solution \mathbf{L}(t) of the Euler’s equations has two trajectories: one with L_3(t)>0 is given by

(5)   \begin{eqnarray*} L_1(t)&=&A_1\, \cn (Bt,m),\\ L_2(t)&=&A_2\, \sn (Bt,m),\\ L_3(t)&=&A_3\, \dn (Bt,m), \end{eqnarray*}

while the other one, with L_3(t)<0 is given by

(6)   \begin{eqnarray*} L_1(t)&=&-\,A_1\, \cn (Bt,m),\\ L_2(t)&=&A_2\, \sn (Bt,m),\\ L_3(t)&=&-\,A_3\, \dn (Bt,m). \end{eqnarray*}

With constants \alpha and \nu defined as

(7)   \begin{equation*} \alpha=\frac{I_3-I_1}{\sqrt{\frac{I_1(1-d I_1)(I_3-I_2)I_3}{I_2}}}, \end{equation*}

(8)   \begin{equation*} \nu=\frac{I_1-dI_1I_3}{I_3-dI_1I_3} \end{equation*}

we set the phase variable \psi(t) as

(9)   \begin{equation*} \psi(t)=\frac{t}I_1-\arctan\left((A_2/A_3)\mathrm{sd}(Bt,m)  \right)-\alpha \Pi(\nu,\am(Bt,m),m),\ \end{equation*}

where the Jacobi function \mathrm{sd} is defined as \mathrm{sd}(u,m)=\sn(u,m)/\dn(u,m).
Then the quaternionic attitude solution is given by q(t)=W(t)+\mathbf{i}X(t)+\mathbf{j}Y(t)+\mathbf{k}Z(t), with

(10)   \begin{eqnarray*} W(t)&=&\cos \frac{\psi(t)}{2}\sqrt{\frac{1+L_1(t)}{2}},\\ X(t)&=&\sin \frac{\psi(t)}{2}\sqrt{\frac{1+L_1(t)}{2}},\\ Y(t)&=&\frac{L_3(t)\cos \frac{\psi(t)}{2}+L_2(t)\sin \frac{\psi(t)}{2}}{\sqrt{2(1+L_1(t))}},\\ Z(t)&=&\frac{-L_2(t)\cos \frac{\psi(t)}{2}+L_3(t)\sin \frac{\psi(t)}{2}}{\sqrt{2(1+L_1(t))}} \end{eqnarray*}

My original intention was to verify the above with the 903 paper code using Mathematica, and, if there will be differences in the output, to fix the problems.
But now this Sunday is coming to the end, and I am getting tired. And before sleep I want to watch the second half of the movie “Master and Commander”. It fits this post:

Roger Ebert gave the film 4 stars out of 4, saying that “it achieves the epic without losing sight of the human”

13 thoughts on “Approaching the ultimate answer for m<1

  1. Is m1(0)=L1(0) etc?
    these are the values I get
    t0 := 0;
    m10 := L1(t0);= 0.90464553008
    m20 := L2(t0);=0
    m30 := L3(t0); =0.6471867488337
    sqrt(L1(t0)^2+L2(t0)^2+L3(t0)^2);=1.112310308
    sqrt(-.544332842^2+.7291317^2+(-.414811526^2));

    = 0.25152794647743 (i.e the values from the paper)

    I thought the magnitude of L or m should be 1

    Things could also get a bit confusing with m for the Jacobi functions (even though I use k) and m for angular monentum.

    Just to make sure I am not totally confused
    Q0 is the Rodrigues / Quaternion Matrix
    Q1 is the [cos (psi) -sin (psi) 0……] Matrix
    Q is Q1.Q0
    Have lots of numerical issues here. Magnitued of the determinant of Q0 is changing.

  2. “So it is the same “future physics” body that we have already met”

    Did the authors tell a word that they were especialy dealing with “strange” rigid body?

    1. No. I guess as a test for the software it is quite ok. For instance there is nothing wrong in having negative mass in Newton’s equations. Mathematics is the same.

      Thanks for the errata.

  3. Ark
    In the meantime.
    Would you please show me the graph of a functon: angle(time)?

    Where:
    angle is the angle between the velocity vector of the end of leg of T-handle and XY-plane of T-handle
    (or angle is the angle between the velocity vector of the end of leg of T-handle and the vector perpendicular to XY-plane of T-handle)

    In two cases:
    Case 1
    m=1.000001
    Case 2
    m=0.999999

      1. So from the shape of graph of Case 2 (m=0.99999) we can conclude that Case 2, in the limit, becomes Case 3 (m=1) splited into two cases:
        Case 3a:
        m=1 and angle = 150 (shown on the graph) and
        Case 3b:
        m=1 and angle = 30 (not shown).

Leave a Reply