Archive

Archive for the ‘Mathematica’ Category

Harmony on a Donut

April 29, 2017 Leave a comment

“Harmony” was my sloppy look at the Kuramoto model. Looking at 2 oscillators:
\dot{\theta_1}=\omega_1+ k\sin (\theta_2-\theta_1)\\\\ \dot{\theta_2}=\omega_2+ k\sin (\theta_1-\theta_2)

The following starts “knotted” 2:3 with k=0, i.e. no coupling and then increasing the coupling…another visualization of harmony.

msesynchr.gif

Visualizing as motion on a circle:

 
msekuramoto

Multiplication

February 14, 2017 Leave a comment

This is my homage to Mathologer’s wonderful video. The following is multiplication (2x to 100 x) modulo 200 represented on circle:

 

multiplication.gif

Hewing Prime Ladder from Zeta

December 13, 2016 Leave a comment

56uxk

 

This post is based on this question on Mathematica Stackexchange.

 

Riding the Wild Zeta Line

December 12, 2016 Leave a comment

The following gif shows the Riemann Zeta function map of Re[z]=1/2 with -30<Im[z]<30:

riemann

Categories: Mathematica, Mathematics

Trade-offs

November 25, 2016 Leave a comment

The brachistochrone problem is classical example used to illustrate the use of calculus of variations. In some ways it illustrates the trade-off between shortest distance (straight line) and greatest speed for a time minimization problem. The solution curve is a cycloid. In addition to the time minimization, no matter where start on the curve you will reach the end point in the same time.

brachistochrone

tautochrone

Categories: Mathematica, Mathematics

Breaking Sticks

November 21, 2016 Leave a comment

This post is based on a probability puzzle. What is the probability that breaking a straight stick at 2 random points will result in 3 segments that can form a triangle.

Consider the resulting segment lengths: x_i, i \in \{1,2,3\}. Let the stick length =1.

Now,

\sum_{j=1}^3 x_j=1

To form a triangle

 x_i+x_j>x_{6-i-j}, i\neq j for all {i,j}\in \{1,2,3\}

These constraints reduce to: x_1+x_2>1/2 , x_1<1/2,x_2<1/2

You can visualize this as follows. As there are only 2 degrees of freedom, consider only space of x_1,x_2. The space of allowable x_1, x_2 is the region of the unit square: x_1+x_2<1 . Within this space the values of x_1,x_2 that form a triangle with lengths (x_1,x_2,1-x_1-x_2) is the region satisfying the constraint above.

The probability is then: (1/8)/(1/2)=1/4.

 

Just for fun:

 

msestick

 

The light blue triangle is the region of x_1,x_2 that can form triangle and the pink triangle encloses the allowable stick segments.

The triangles on the right have been rescaled to be circumscribed by the unit circle. The relative lengths pertain not the absolute lengths.

Australian Mortality Data

November 13, 2016 Leave a comment

The Human Mortality Database provides access to world mortality data. This post looks at life expectancy, hazard rates, survival data for Australia from 1921 to 2011 (from the HMD Australian data).

ausmd

The following plot shows the time course of “approaching” the 2011 life expectancy curve by area between curves referenced to area between 2011 and 1921 curves. There seems to have been “accelerated” progress around 1970’s.

ausmdr

Categories: Mathematica