rotation – What is the relationship between gimbals and Euler angles?

The definition of Euler angles inherently includes gimbals.

Let’s use Unity’s convention as one arbitrary example (technically they’re a related convention called Tait-Bryan angles, but nobody calls them that).

An Euler angle triplet (pitch, yaw, roll) means…

  1. Rotate the outermost gimbal, with its axis parallel to the world y axis, by yaw degrees.

  2. Rotate the middle gimbal, with its axis perpendicular to the outer gimbal and parallel to the world x axis when yaw is zero, by pitch degrees.

  3. Rotate the inner gimbal, with its axis perpendicular to the middle gimbal and parallel to the world z axis when yaw and pitch are both zero, by roll degrees.

The net orientation of the object is then the orientation of this inner gimbal, stacking up the individual rotations of the middle and outer gimbals.

There are other Euler angle / Tait-Bryan angle conventions, but they all share this pattern where an arbitrary orientation is built-up from a sequence of rotations about particular axes. As I explain in this answer, when you compose two rotations in sequence, the angle of one changes the axis of the second – and that makes the chained rotation behave like two linked gimbals.

To emphasize: any rotation scheme that tries to decompose an orientation into multiple angles is inherently modelling a set of linked gimbals. That means it will have situations where it loses a degree of freedom because two of its gimbal axes become parallel – gimbal lock – and you need a correspondingly larger change to your angle triplet to get to a nearby orientation in some direction.

To escape this, you need to leave behind the idea of chaining separate rotations with different axes/angles entirely. Instead we can use…

  • Angle-axis representations, where we express a particular orientation as a single rotation around one axis by a particular angle. By allowing arbitrary diagonal axes, we can still reach any orientation we choose this way, without composing multiple rotations in sequence.

  • Quaternions, which are really a special kind of angle-axis representation, dressed up in 4D space with 3 imaginary dimensions. This might seem like a strange choice, but it lets us take advantage of patterns in the multiplication of these imaginary units to compose and interpolate rotations much more easily than other methods.

  • Matrices, which can express any arbitrary affine transformation, including rotations.

All of these methods let us express an orientation “all at once” rather than as a sequence of rotations with different angles around different axes, so they let us break out of the gimbal paradigm that comes with that sequencing.

differential equations – Euler Buckling using DEigensystem

I’m new to using the functions DEigensystem and DEigenvalue. I started with the examples given in the Documentation system, and it works fine. I decided to test it out on the classical Euler buckling problem – in particular, the more general form, where the governing differential equation is fourth order.

I start with the equation of the elastica parameterized by the angle along the arc length, linearize it, and then use the small slope approximation to write it in terms of deflection in Cartesian coordinates:

elastica = (Theta)''(s) + (Lambda)^2 Sin((Theta)(s));
elasticaLin = Series(elastica, {(Theta)(s), 0, 1}) // Normal
elasticaLinW = elasticaLin /. {(Theta)(s) -> w''(x), (Theta)''(s) -> w''''(x)}

This gives:
$$lambda^2 w”(x) + w^{(4)}(x)$$

Of course, this equation can be obtained in a more “Mathematica” way by:

(ScriptCapitalL) = Laplacian(Laplacian(w(x), {x}), {x}) + (Lambda)^2 Laplacian(w(x), {x})

I defined the Dirichlet boundary conditions of $$w(0)==w(L)==0$$ as:

(ScriptCapitalB)1 = DirichletCondition(w(0) == 0, True);
(ScriptCapitalB)2 = DirichletCondition(w(L) == 0, True);

Finally, trying to use DEigensystem to find the first few eigenfunctions, I use the following code, which Mathematica just returns to me when I run it:

DEigensystem({(ScriptCapitalL), (ScriptCapitalB)1, (ScriptCapitalB)2}, w(x), {x, 0, L},4)

What am I doing wrong here?

Euler characteristics in 6 dimensional manifold

I have been trying to calculate the integral below.
As far as I know this is Euler class in 6 dimensions but until now i could not get the answer that the quantity X is proportional to Q.
Maybe somebody here has any idea that could help me , thanks in advance.

enter image description here

physics – Making a parent system with euler angles (gimbal lock problem)

I thought the direct and easiest way would be to get the difference of the Euler angles

No, this is definitely not a direct or easy way. This road leads only to suffering.

Euler angles are good for presenting an orientation to a human reader/editor, or for serializing an orientation to disc, or for a few special cases like camera control. But they are an absolute nightmare to use for general orientation computations or compositions. A combination of two Euler angle rotations is not the sum or any simple expression of the angles of the inputs, nor is there a simple expression for inverting them.

Just use quaternions. They don’t have the axis bias or gimbal lock problems you’ve observed. You can compose two rotations in a chain (like a parent and child) as simply as doing a multiplication. And inverting a quaternion (eg. to undo a parent rotation and get into local space) is as easy as negating the x, y, and z components.

I have heard that quaternions also don’t save 360+ degrees, so that would be also a problem for angular velocity.

It’s not a problem because you use quaternions to store orientations, not angular velocity.

Angular velocity can be stored as an axis and an angular speed, or as a single 3-component vector along the axis of rotation, whose length is the speed of rotation along that axis.

When you want to step forward your orientation by your angular velocity, you integrate your angular speed over the timestep to get a total angle of travel. Then you can construct a quaternion that rotates by that angle about the axis vector, and compose your previous orientation quaternion with this one.

graph theory – Is there a purely set-theoretic expression of the Euler characteristic?

The Euler characteristic of a graph is V – E + F. Where V is the number of vertices, E is the number of edges, and F is the number of faces.

Given a graph $X$, can we write $X$ as a set and find its Euler characteristic with a formula which only refers to cardinality and union?

I think we found a way, but is this interesting? We would like to find a way to write the Euler characteristic completely set-theoretically. And, we have found a way, but still working on it. Has this already been done?

dg.differential geometry – On the Euler number of an orbit space

Let $X$ be a differentiable manifold and $G$ a finite group acting
differentiably on $X$. The following formula for the Euler number $text{e}(X/G)$ of the orbit space $X/G$ appears to be well-known:
begin{equation*}tag{1}
text{e}(X/G) = dfrac{1}{lvert G rvert} sum_{g in G} text{e}(X^g)
end{equation*}

where, for each $g in G$, $X^g$ is the subspace of elements fixed by $g$. Instances of this formula can be found in (3) and (5), but without proof or
link to such. A quite elaborate search on the web did not produce one, either.

Following the allusion to Lefschetz numbers in (3), a proof might be given, I suppose, along the following lines. Consider the canonical projection $pi : X rightarrow X/G$ and its induced map $pi^* : text{H}^*(X/G;Bbb{Q}) rightarrow text{H}^*(X;Bbb{Q})$ on rational cohomology. According to a celebrated result of Grothendieck in (4), this map is injective and maps $text{H}^*(X/G;Bbb{Q})$ isomorphically onto the $G$-invariants $text{H}^*(X;Bbb{Q})^G$ (this follows from the Leray SS for the map $pi$, which collapses). Now for any representation of $G$ on a finite dimensional vector space $V$ over a field of characteristic 0, one has that
begin{equation*}
P := dfrac{1}{lvert G rvert} sum_{g in G} g : V rightarrow V
end{equation*}

is the projector onto the $G$-invariants $V^G$ and so, by taking traces,
begin{equation*}
dim V^G = text{tr}, P =
dfrac{1}{lvert G rvert} sum_{g in G} text{tr}, g.
end{equation*}

Therefore, for each $i$,
begin{equation*}
dim text{H}^i(X/G;Bbb{Q}) = dim text{H}^i(X;Bbb{Q})^G =
dfrac{1}{lvert G rvert} sum_{g in G} text{tr}, g^i,
end{equation*}

where $g^i$ is the endomorphism induced by $g$ on $text{H}^i(X;Bbb{Q})$. Taking the alternating sum and interchanging the summation order leaves us with
begin{equation*}
begin{aligned}
text{e}(X/G) &= sum_i (-1)^i dim text{H}^i(X/G;Bbb{Q}) \
&= dfrac{1}{lvert G rvert} sum_{g in G} sum_i (-1)^i text{tr}, g^i
end{aligned}
end{equation*}

and so
begin{equation*}tag{2}
text{e}(X/G) = dfrac{1}{lvert G rvert} sum_{g in G} L(g),
end{equation*}

where
begin{equation*}
L(g) := sum_i (-1)^i text{tr}, g^i
end{equation*}

is the Lefschetz number of the endomorphism $g : X rightarrow X$.

But now we are in business; (1) boils down to the sixty-four dollar question
begin{equation*}tag{3}
forall g in G: L(g) = text{e}(X^g).
end{equation*}

A high-brow reference for this is is the general Lefschetz fixed point theorem
Theorem (2.12) of (2) (which is a synthesis of the main theorem Theorem (6.7) of (1) and the Localization Theorem (1.1) of (2)), which, after plodding through the quite intricate intricacies of the $K$-theory apparatus surrounding the Index Theorem, should grind out the desired answer (3), which is, in a sense a localized version of the Gauss-Bonnet Theorem.
What makes me unhappy with this is that the derivation of (1) up to stage
(3) is maybe on the level of a first year graduate course in Algebraic Topology,
wherea the application of the full force of the Index Theorem in (3) appears
like the proverbial cracking of a peanut with a sledgehammer. Now it is known that the Gauss-Bonnet Theorem is much more elementary than the Index Theorem
(which just illustrates it but is not needed for its proof), and also localization results come in various flavours, so my question is whether there exists a much more elementary proof of (1) somewhere in the world.


(1) Atiyah, M.F. & Singer, I.M.,
The Index of Elliptic Operators: I, Ann.of Math, Sec.Ser., Vol. 87, No. 3 (May, 1968), pp. 484-530.

(2) Atiyah, M.F. & Segal, G.B.,
The Index of Elliptic Operators: II, Ann.of Math, Sec.Ser., Vol. 87, No. 3 (May, 1968), pp. 531-545.

(3) Bryan, J. & Fulman, J.,
Orbifold Euler characteristics and the number of commuting n-tuples in symmetric groups,
(math/9712248) on $mathtt{arxiv.org}$

(4) Grothendieck, A.,
Sur quelques points d’algèbre homologique, II, Tohoku Math. J. (2)
Volume 9, Number 3 (1957), 119-221.

(5) Hirzebruch, F. & Höfer, T.,
On the Euler number of an orbifold, Math. Ann. 286, 255-260 (1990)

Euler and mid point method to estimate stability of system of ODE’s

I want to study the stability of this system of differential equations using the 1st order Euler and mid-point method:

dx/dt = -x +y
dy/dt = -100*y

Any suggestions?
Thanks!

programming challenge – Project Euler Problem #85 in Scheme (Guile)

I’ve decided to revitalize my Scheme knowledge coming from SICP, so I’ve started using Scheme for Project Euler problems I’ve already solved in Python. However, this proved to be difficult. It seems that I’ve become too accustomed to the “straightforwardness” of Python, so I can’t wrap my head around the Scheme way of thinking.

Here’s the link for 85th Project Euler problem

And here’s my code:

(define (nearestarea recs)

  (define upper 0)

  (define (recnumber width length)
    (define (combtwo n) (/ (* n (- n 1)) 2))
    (* (combtwo (1+ width)) (combtwo (1+ length))))

  (define (exists? rec)
    (do ((w 1 (1+ w)))
        ((> (recnumber w 1) rec) 0)
      (do ((l w (1+ l)))
          ((>= (recnumber w l) recs) (cons rec (* w l))))))

  (define (iterate down up)
    (let ((valup (exists? up))
          (valdown (exists? down)))
      (if (not (= valup 0))
        (if (not (= valdown 0))
          (if (> (- (car valup) recs) (- recs (car valdown))) (cdr valdown) (cdr valup))
          (iterate (- down 1) up))
        (iterate down (+ up 1)))))

  (iterate (- recs 1) (+ recs 1)))

(nearestarea 2000000)

So what I’m trying to do is

start from 2000000, iterate first the bigger and then the smaller numbers one at a time and see if it can be achieved using the classic combination method. I then record the rectangle number and the area of the grid it’s derived from as a pair, so in the end I can return the area of the grid that contains the “closest” amount of rectangles.

As a side note, this isn’t how I’ve originally solved the problem, I just wanted to try something different.

However my code just gets stuck in an infinite loop. As you can tell I’m not very proficient in Scheme (I’m new to programming in general), so I would appreciate your help.

python 3.x – Project Euler 8 – Largest product in a series

The four adjacent digits in the 1000-digit number that have the
greatest product are 9 × 9 × 8 × 9 = 5832.

73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
52584907711670556013604839586446706324415722155397
53697817977846174064955149290862569321978468622482
83972241375657056057490261407972968652414535100474
82166370484403199890008895243450658541227588666881
16427171479924442928230863465674813919123162824586
17866458359124566529476545682848912883142607690042
24219022671055626321111109370544217506941658960408
07198403850962455444362981230987879927244284909188
84580156166097919133875499200524063689912560717606
05886116467109405077541002256983155200055935729725
71636269561882670428252483600823257530420752963450

Find the thirteen adjacent digits in the 1000-digit number that have
the greatest product. What is the value of this product?

This is my solution to the problem above.

> def largest_product_series(n, series):
>     series = str(series)
>     largest = 0
>     for i in range(0,1000-n):
>         temp = np.prod((int(series(j)) for j in range(i,n+i)))
>         largest = max(temp, largest)
>     return largest

I am having a hard time figuring out what is wrong with my code. It works just fine with n = 4. But somehow it didn’t output the correct answer when n = 13.

Here’s the link to the problem. Euler 8

ac.commutative algebra – Elliptic Units as Euler systems

I’m trying to understand elliptic units in order to work with the Euler systems of the ableism extensions of quadratic imaginary number fields. I’ve looked at few references about the topic, but they define elliptic units from different perspectives. Can anyone suggest a short and comprehensive definition of elliptic units. Thank you.