The Web Site of L.A.P.

Roulette Curves with GNU/Linux

1) We now consider a complex roulette that requires a numerical rather than an analytical solution: Ellipse Rolling on Line

An ellipse rolls on a line, with the fixed curve being the real axis (or x-axis). Again, a familiarity of the basic methods of roulette generation from the introduction is recommended. Maxima/wxMaxima is used to perform the "dirty work" of extensive derivation.

We first define the fixed curve (using the parameter t), its derivative, and its arc length. The fixed curve is the real axis (x-axis).
(%i3) fx ( t ) : = t + %i · 0 ;
define ( dfx ( t ) , diff ( fx ( t ) , t ) ) ;
define ( sfx ( t ) , integrate ( cabs ( dfx ( t ) ) , t ) ) ;

\[\operatorname{ }\operatorname{fx}(t)\operatorname{:=}t+i 0\]

\[\operatorname{ }\operatorname{dfx}(t)\operatorname{:=}1\]

\[\operatorname{ }\operatorname{sfx}(t)\operatorname{:=}t\]

The rolling curve is an ellipse in standard form (a > b) with parameter u and sits with center at a above real axis.
The mapping has to start from 0, 0 (not b, a) hence the parameter u is shifted back by %pi/2.
We also derive the first derivative and the arc length.
(%i6) define ( ro ( u , a , b ) , ev ( trigsimp ( b · cos ( u %pi / 2 ) + %i · a · sin ( u %pi / 2 ) + %i · a ) ) ) ;
define ( dro ( u , a , b ) , diff ( ro ( u , a , b ) , u ) ) ;
define ( sro ( u , a , b ) , integrate ( cabs ( dro ( u , a , b ) ) , u ) ) ;

\[\operatorname{ }\operatorname{ro}\left( u\operatorname{,}a\operatorname{,}b\right) \operatorname{:=}b \sin{(u)}-i a \cos{(u)}+i a\]

\[\operatorname{ }\operatorname{dro}\left( u\operatorname{,}a\operatorname{,}b\right) \operatorname{:=}i a \sin{(u)}+b \cos{(u)}\]

\[\operatorname{ }\operatorname{sro}\left( u\operatorname{,}a\operatorname{,}b\right) \operatorname{:=}\int {\left. \sqrt{{{a}^{2}} {{\sin{(u)}}^{2}}+{{b}^{2}} {{\cos{(u)}}^{2}}}du\right.}\]

2) A Plot Of The Intitial Condition

(%i8) load ( draw ) $
set_draw_defaults ( grid = true , nticks = 200 , background_color = light_yellow , proportional_axes = xy ,
xlabel = "Real Axis" , ylabel = "Imaginary Axis" ) $
(%i11) a : 2 ; b : 1 ;
wxdraw2d ( xrange = [ 2 , 10 ] , yrange = [ 2 , 10 ] ,
   color = red , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , 2 , 10 ) ,
   color = blue , parametric ( realpart ( ro ( u , a , b ) ) , imagpart ( ro ( u , a , b ) ) , u , 0 , 2 · %pi ) ,
   title = "Ellipse on Line Initial Condition" ) $

\[\operatorname{(a) }2\]

\[\operatorname{(b) }1\]

\[\operatorname{ }\]

 (Graphics)

3) Determine The Relation Between Arc Length Parameters

(%i12) kill ( a , b , t , u ) $
The arc length of the rolling curve is an elliptic integral and, although Maxima is somewhat Risch complete, it cannot solve such integrals. But from other sources (e.g. Wolfram Alpha) the arc length of the rolling curve is:
(%i13) sro ( u , a , b ) : = b · elliptic_e ( u , 1 a ^ 2 / b ^ 2 ) ;

\[\operatorname{ }\operatorname{sro}\left( u\operatorname{,}a\operatorname{,}b\right) \operatorname{:=}b \operatorname{elliptic\_ e}\left( u\operatorname{,}1-\frac{{{a}^{2}}}{{{b}^{2}}}\right) \]

The paramaterization in terms of t is found by inverting t = b * elliptic_e(u, 1-a^2/b^2). This cannot (easily) be done analytically so we use a root solver.

In Maxima, we have a choice of using either "find_root()" or "newton()" as solvers but we'll use both for this example.
(%i14) load ( newton1 ) $
Check if this works using a=2, b=1.
First, we find u for a given t using both solvers.
(%i19) t : 9 $ a : 2 $ b : 1 $
u1 : root1 : find_root ( b · elliptic_e ( u , 1 a ^ 2 / b ^ 2 ) = t , u , 0 , 10 ) ;
u2 : root2 : newton ( b · elliptic_e ( u , 1 a ^ 2 / b ^ 2 ) t , u , t , 1e-10 ) ;

\[\operatorname{(u1) }5.683783113001842\]

\[\operatorname{(u2) }5.68378311299735\]

Check if this works by substituting the root u into the ellipse arc length formula. The result should be the original t.
(%i21) b · elliptic_e ( u1 , 1 a ^ 2 / b ^ 2 ) ;
b · elliptic_e ( u2 , 1 a ^ 2 / b ^ 2 ) ;

\[\operatorname{ }9.0\]

\[\operatorname{ }8.99999999999372\]

OK. It works.
(%i22) kill ( t , u , a , b , u1 , u2 ) $
Since we have no analytical expression for u = u(t) we cannot re-define dro() in terms of u(t). We need to find a value for dro() at every step. How is this done?

The magnitudes, cabs(), of the derivatives of the fixed curve and the rolling curve must be equal for t > 0. This gives a way to find dro() at each step.

We find d/dt [ro(u)] and equate that to sfx(t) and then solve for du/dt. This provides a factor, du/dt, to determine dro(t) at each step. The following illustrates this method.
(%i25) depends ( u , t ) $
assume ( u > = 0 , t > = 0 ) $
magdro : factor ( cabs ( diff ( ro ( u , a , b ) , t ) ) ) ;

\[\operatorname{(magdro) }\sqrt{{{a}^{2}} {{\sin{(u)}}^{2}}+{{b}^{2}} {{\cos{(u)}}^{2}}} \left| \frac{d}{d t} u\right| \]

Now, we determine the magnitude of the derivative of the fixed curve.
(%i26) magdfx : cabs ( dfx ( t ) ) ;

\[\operatorname{(magdfx) }1\]

We equate the two and solve for du/dt:
(%i27) define ( dudt ( u , a , b ) , rhs ( solve ( magdro = magdfx , diff ( u , t ) ) [ 1 ] ) ) ;

\[\operatorname{ }\operatorname{dudt}\left( u\operatorname{,}a\operatorname{,}b\right) \operatorname{:=}\frac{1}{\sqrt{{{a}^{2}} {{\sin{(u)}}^{2}}+{{b}^{2}} {{\cos{(u)}}^{2}}}}\]

Thus, dro(u(t)) = dro(u) * dudt(u,a,b), where u is found from a given t as above. We determine this at each step of the roulette generation.

4) Generate Some Roulettes

(%i28) kill ( t , u , a , b , p ) $
(%i29) M : zeromatrix ( 400 , 2 ) $
We use newton() as the root finder, but, as seen above, find_root() would be acceptable as well.

The generating point, p, is set as the upper focus of the ellipse.
(%i36) a : 2 $ b : 1 $
p : %i · ( a + sqrt ( a ^ 2 b ^ 2 ) ) ;
t : 0 $ tinc : 0 . 05 $
e : 1 a ^ 2 / b ^ 2 $
for i : 1 thru 400 step 1 do (
u : newton ( b · elliptic_e ( uu , e ) t , uu , t , 1e-10 ) ,
roul : fx ( t ) ( ro ( u , a , b ) p ) · dfx ( t ) / ( dro ( u , a , b ) · dudt ( u , a , b ) ) ,
M [ i , 1 ] : float ( realpart ( roul ) ) ,
M [ i , 2 ] : float ( imagpart ( roul ) ) ,
t : t + tinc
) $

\[\operatorname{(p) }\left( \sqrt{3}+2\right) i\]

(%i38) kill ( t , u ) $
wxdraw2d ( xrange = [ 2 , 20 ] , yrange = [ 2 , 10 ] ,
   color = blue , parametric ( realpart ( ro ( t , a , b ) ) , imagpart ( ro ( t , a , b ) ) , t , 0 , 2 · %pi ) ,
   color = red , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , 2 , 20 ) ,
color = darkgreen , point_size = 1 , point_type = 7 , points ( [ [ realpart ( p ) , imagpart ( p ) ] ] ) , point_type = 0 , points_joined = true , points ( M ) ,
   title = "p = 0 + %i * (a+sqrt(a^2-b^2))"
) $

\[\operatorname{ }\]

 (Graphics)
In this case, the generator, p, is at one focus of the ellipse. Such roulettes are known as Delaunay curves and have been much studied.

Let's now move p in between the center and the upper focus.
(%i45) a : 2 $ b : 1 $
p : %i · 3 ;
t : 0 $ tinc : 0 . 1 $
e : 1 a ^ 2 / b ^ 2 $
for i : 1 thru 400 step 1 do (
u : newton ( b · elliptic_e ( uu , e ) t , uu , t , 1e-10 ) ,
roul : fx ( t ) ( ro ( u , a , b ) p ) · dfx ( t ) / ( dro ( u , a , b ) · dudt ( u , a , b ) ) ,
M [ i , 1 ] : float ( realpart ( roul ) ) ,
M [ i , 2 ] : float ( imagpart ( roul ) ) ,
t : t + tinc
) $

\[\operatorname{(p) }3 i\]

(%i47) kill ( t , u ) $
wxdraw2d ( xrange = [ 2 , 20 ] , yrange = [ 2 , 10 ] ,
   color = blue , parametric ( realpart ( ro ( t , a , b ) ) , imagpart ( ro ( t , a , b ) ) , t , 0 , 2 · %pi ) ,
   color = red , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , 2 , 20 ) ,
color = darkgreen , point_size = 1 , point_type = 7 , points ( [ [ realpart ( p ) , imagpart ( p ) ] ] ) , point_type = 0 , points_joined = true , points ( M ) ,
   title = "p = 0 + %i * 3"
) $

\[\operatorname{ }\]

 (Graphics)
As a last variation, we set p = -b + i * a
(%i54) a : 2 $ b : 1 $
p : b + %i · a ;
t : 0 $ tinc : 0 . 1 $
e : 1 a ^ 2 / b ^ 2 $
for i : 1 thru 400 step 1 do (
u : newton ( b · elliptic_e ( uu , e ) t , uu , t , 1e-10 ) ,
roul : fx ( t ) ( ro ( u , a , b ) p ) · dfx ( t ) / ( dro ( u , a , b ) · dudt ( u , a , b ) ) ,
M [ i , 1 ] : float ( realpart ( roul ) ) ,
M [ i , 2 ] : float ( imagpart ( roul ) ) ,
t : t + tinc
) $

\[\operatorname{(p) }2 i-1\]

(%i56) kill ( t , u ) $
wxdraw2d ( xrange = [ 2 , 20 ] , yrange = [ 2 , 10 ] ,
   color = blue , parametric ( realpart ( ro ( t , a , b ) ) , imagpart ( ro ( t , a , b ) ) , t , 0 , 2 · %pi ) ,
   color = red , parametric ( realpart ( fx ( t ) ) , imagpart ( fx ( t ) ) , t , 2 , 20 ) ,
color = darkgreen , point_size = 1 , point_type = 7 , points ( [ [ realpart ( p ) , imagpart ( p ) ] ] ) , point_type = 0 , points_joined = true , points ( M ) ,
   title = "p = -b + %i * a"
) $

\[\operatorname{ }\]

 (Graphics)

5) Final Comments

Even though the use of an ellipse as the rolling curve leads to intractable (i.e. not analytical) expressions, we can use the numerical methods of Maxima to approximate the necessary quantities.

The next examples show even more complex (mathematically if not visually) roulettes that are handled using this same method.

Created with wxMaxima.
Modified and embedded by L.A.P.