.. role:: raw-latex(raw) :format: latex .. contents:: :depth: 3 ================ The Euler spiral ================ The first example in the beautiful book :raw-latex:`\cite[pp.~1~ff.]{havil}` is the *Euler spiral*, which is a *clothoid*, i. e. a curve with a curvature depending linearly on the arc length. Clothoids play a significant role in road and railway track construction. Imagine driving along a straight road, approaching a curve. If the straight part of the road was directly connected to an arc of a circle forming the curve, one would have to switch from a steering angle of zero to a non-zero steering angle instantaneously, which is impracticable even at rather low speeds. Therefore, a safe curve in a road has a curvature that starts at zero, rises to a maximum and then falls back to zero again when the next straight segment of the road is entered. This can be done by using clothoids and many curves encountered on highways and railway tracks are based on this type of curve. Generally, a curve parameterized by some functions :math:`x(t)`, :math:`y(t)` has a slope .. math:: m=\frac{\mathrm{d}y}{\mathrm{d}x}=\frac{\dot{y}}{\dot{x}},\label{equ_slope_1} :label: euler01 an arc length .. math:: l=\int\limits_{t_0}^{t_1}\sqrt{\dot{x}^2+\dot{y}^2}\,\mathrm{d}t,\label{equ_arc_length_1} :label: euler02 and a curvature .. math:: \kappa=\frac{\dot{x}\ddot{y}-\dot{y}\ddot{x}}{\sqrt{\left(\dot{x}^2+\dot{y}^2\right)^3}}.\label{equ_curvature_1} :label: euler03 Using the general parameterization .. math:: \begin{aligned} x(t)&=\int\limits_0^T\cos\left(f(t)\right)\,\mathrm{d}t\text{~and}\\ y(t)&=\int\limits_0^T\sin\left(f(t)\right)\,\mathrm{d}t \end{aligned} yields the following time derivatives: .. math:: \begin{aligned} \dot{x}&=\cos\left(f(t)\right)&\dot{y}&=\sin\left(f(t)\right)\\ \ddot{x}&=-\dot{f}\sin\left(f(t)\right)&\ddot{y}&=\dot{f}\cos\left(f(t)\right) \end{aligned} Inserting these into **(1)**, **(2)** and **(3)** yields .. math:: \begin{aligned} m&=\frac{\sin\left(f(t)\right)}{\cos\left(f(t)\right)}=\tan\left(f(t)\right),\\ l&=\int\limits_0^T\sqrt{\cos^2\left(f(t)\right)+\sin^2\left(f(t)\right)}\,\mathrm{d}t=\int\limits_0^T\mathrm{d}t=T,\text{~and}\\ \kappa&=\frac{\dot{f}\left(\cos^2\left(f(t)\right)+\sin^2\left(f(t)\right) \right)}{\sqrt{\left(\cos^2\left(f(t)\right)+\sin^2\left(f(t)\right)\right)^3}}=\dot{f}. \end{aligned} The Euler spiral satisfies :math:`\kappa=t`, i. e. :math:`\dot{f}=t` yielding :math:`f(t)=\frac{t^2}{2}` from which its parameterization .. math:: \begin{aligned} x(t)&=\int\limits_0^T\cos\left(\frac{t^2}{2}\right)\,\mathrm{d}t\text{~and}\\ y(t)&=\int\limits_0^T\sin\left(\frac{t^2}{2}\right)\,\mathrm{d}t \end{aligned} follows. This looks pretty straightforward to implement on an analog computer but classic function generators for :math:`\sin(\varphi)` and :math:`\cos(\varphi)` have a limited interval for :math:`\varphi`, typically :math:`[-\frac{\pi}{2},\frac{\pi}{2}]`. If more than a very short segment of the Euler spiral is to be generated by an analog computer, a trick must be employed. The idea is to use a quadrature generator [1]_ which gets :math:`\dot{\varphi}` instead of :math:`\varphi` as its input. Such a generator, basically consisting of two integrators, two multipliers (to introduce :math:`\dot{\varphi}` into the underlying DEQ) and an inverter. Figure 1 shows the analog computer program for generating an Euler spiral. The quadrature output output signals :math:`\cos\left(\frac{t^2}{2}\right)` and :math:`\sin\left(\frac{t^2}{2}\right)` are fed to integrators yielding :math:`x(t)` and :math:`y(t)`, while :math:`\dot{\varphi}` is obtained by another integrator generating a linear ramp from :math:`-1` to :math:`+1`. .. list-table:: :widths: 75 :header-rows: 0 * - .. figure:: circuit01.png * - Figure 1: Analog computer program for generating an Euler spiral =========== ================= ============= Coefficient Description Typical value =========== ================= ============= P1 :math:`x` scaling :math:`0.6` P2 :math:`x` shift :math:`0.87` P3 :math:`y` scaling :math:`0.6` P4 :math:`y` shift :math:`0.75` P5 ramp slope :math:`0.1` =========== ================= ============= Figures 3 and 4 show the actual implementation of the program on *THE ANALOG THING* and a typical curve display as seen on an oscilloscope screen. The analog computer was set to repetitive operation and the operation time was set so that the output of the integrator yielding :math:`\dot{\varphi}` is a ramp from :math:`-1` to :math:`+1` which corresponds to roughly :math:`20` ms. .. list-table:: :widths: 75 75 :header-rows: 0 * - .. figure:: euler_setup.jpg :width: 400 - .. figure:: euler_result.jpg :width: 400 * - Figure 2: Setup for generating an Euler spiral Figure 3: Typical output of the Euler spiral pro- on THE ANALOG THING - Figure 3: Typical output of the Euler spiral program Increasing the operating time slowly allows to show the growth of the Euler spiral on the oscilloscope screen. Ideally, all integrators are run with the highest time scale factor :math:`k_0` selected. [2]_ References ========== [Havil(2019)] Julian Havil, *Curves for the Mathematically Curious – an Anthology of the Unpredictable, Historical, Beautiful, and Romantic*, Princeton University Press, 2019 [Ulmann(2020)] Bernd Ulmann, *Analog and Hybrid Computer Programming*, DeGruyter, 2020 .. [1] Cf. :raw-latex:`\cite[pp.~60~ff]{ap2}`. .. [2] On THE ANALOG THING this corresponds to :math:`k_0=10^3`.