Saturday, May 28, 2016

How to lose weight without working out

Today, my son said: "Since we are spinning along with the earth, shouldn't the centrifugal force make us feel lighter?"  The answer is yes, since the centrifugal force cancels out a little bit of the gravitational pull of the Earth.  In fact, that is exactly what a satellite does.  It spins so fast around the earth that the centrifugal force cancels out the gravitational pull so it is "floating" in space. The centrifugal force is a virtual or fictitious force denoting the opposite of the force (the centripetal force) needed to achieve the circular motion and this centripetal force is supplied by the force of gravity. There is another interpretation where the satellite is forever falling towards earth, but the motion also has a velocity component that is perpendicular to the force of gravity and its direction changes (due to the gravitational acceleration), but the magnitude doesn't.

How much lighter do you weight on the equator, where you are spinning the fastest, versus on the poles where you are not spinning at all.  There are 2 reasons why you weight is different on the poles versus the equator.  The first reason is the centrifugal force described above.
This force is given by Newton's second law: $F = ma$ along with $a = \omega^2r$.  $\omega$ is the angular velocity of the earth rotation, i.e. $\frac{2\pi}{T}$, where $T$ is about 24 hours = $86400s$. The radius at the equator is about $r$ = 6378137 m. This results in a=0.03373 which is about 0.34% of the gravitational acceleration of $g =9.8 \frac{m}{s^2}$

The second reason is that the earth is not a perfect sphere but is squashed on the poles since the centrifugal force of the spinning earth pulls the matter of the earth from the center of mass and this happens more at the equator than at the poles.  Thus you are further away from the center of mass of the Earth on the surface of the equator than on the surface of the pole.  This affects the value of $g = \frac{MG}{r^2}$ where $M$ is the mass of the Earth and $G$ is the universal gravitational constant.  This adds another 0.67% to the difference resulting in you (and any mass) weighting about 1% less on the equator than at the poles.

Tuesday, May 3, 2016

Ironic song while driving this morning

While driving to work this morning, the sky was gray and overcast and there is a light drizzle. Sometime during the commute, the song "I can see clearly now" by Johnny Nash came on the music streaming service. I got a chuckle out of it as the lyrics are in direct contradiction to what I was seeing around me.

Thursday, April 14, 2016

Interesting number: 348588115

The number 348588115 = 5 × 23 × 3031201 has some interesting properties.  It is a sphenic number (i.e. it is the product of 3 distinct prime numbers).  Reversing the decimal digits also results in a sphenic number: 511885843 = 7 × 953 × 76733.  In addition, the decimal digits also are a concatenation of the decimal digits of 2 other sphenic numbers:
'348588115' = '34858' + '8115' and  34858 = 2 × 29 × 601, 8115 =  3 × 5 × 541.

Tuesday, March 15, 2016

Grocery shopping and Braess' paradox

Some time ago, our local grocery store introduced self-checkout, where we can scan our grocery items ourselves. My wife and I like to use this option since there are several stations open and not many people are using it, so we can get through the checkout quicker. However, recently we noticed that the lines at the self-checkout are getting longer, while the lines at the checkout clerks are sometimes shorter than the self-checkout lines. I believe this is an example of Braess' paradox.  Braess noticed that when a new road is added to a network of existing roads, the congestion can actually increase. His reasoning is that each driver follows a selfish routing algorithm and chooses the shortest route to the destination.  If the new road is a shortcut, then everyone who can use this road will choose it, and this can actually increase the congestion through the network. This seems to be happening with the self-checkout lines as well. Everyone assumes it is quicker to use them and this leads to longer lines. One way to achieve optimal throughput in a road network is if there is a centralized control to route each driver, but this would require information about the speed and travel plans of all drivers and it might favor some drivers over others for the overall good. To implement this would require cars to talk to each other using technologies such as connected vehicles, vehicle-to-vehicle communications and dedicated short range communication (DSRC).

Back to our grocery shopping trips.  Yesterday the self-checkout lines was quite long so we went to the checkout clerk who is much faster than us in scanning the groceries (plus there was an additional clerk to bag our groceries), and we got done much quicker than if we had used the self-checkout line.  Sometimes one or more of the self-checkout stations are out of order which is similar to lane closures on a multi-lane highway.  If more people realize that regular checkout is faster, we could have another Braess' paradox in the making and lead to longer lines at the regular checkout lines.  In the long run, this can lead to cycles of short and long lines forming alternately at the self-checkout lanes and at the regular checkout stations!  Fortunately this is unlikely to happen since the 2 types of checkout lines are in close proximity so the shopper has a good sense of the congestion of the entire system. But imagine a mega-store where for some odd reason the regular checkout lines are far away from the self-checkout lines!  The shopper needs to decide which line is more optimal based on incomplete information and what other shoppers would do.  On the other hand, the speed of checkout may not be the only objective.  Some people prefer self checkout because they feel like they don't make mistakes and make better bagging decisions (like not having eggs at the bottom of the bag) if they do it themselves.

Monday, March 14, 2016

Happy Pi Day 2016!

Today, March 14, is Pi Day.  As I wrote in an earlier post this year's Pi Day is specially nice since 3.14.16 is Pi rounded to 4 places after the decimal point.

Saturday, February 27, 2016

Van der Pol Oscillator

The original neon-bulb oscillator circuit studied by Van der Pol and Van der Mark in their 1927 paper consists of a neon-bulb connected to a capacitor, resistor, a bias voltage source and a sinuosoidal signal voltage source.  The operation of this circuit without the sinusoidal signal can be described as follows: the neon bulb is not conducting and the voltage source charges up the the capacitor until a certain point at which the neon bulb starts conducting (and glowing) and discharges the capacitor until the voltage is low enough to turn off the neon bulb and the cycle starts anew.  Looking at the $v$-$i$ characteristic of the neon bulb we see that it is a function with two local extrema just like the cubic polynomial.  The role of the bias voltage source is to add power to the system, since the neon bulb by itself does not supply any power.  In particular, by looking at the equivalent $v$-$i$ characteristic of the neon bulb in parallel with the bias voltage, it effectively shift the characteristic so it looks more like the cubic and thus can oscillate.

Except for the external driving source, this circuit is similar to the circuits considered in a previous post.  To write state equations, we model the neon-bulb as a nonlinear resistor in parallel with an small linear inductor and a small linear capacitor.

When the sinusoidal source is turned off, the oscillator oscillates freely with a frequency $\omega_1$.  The addition of the sinusoidal voltage source add another frequency $\omega_2$ to the system.  One can think of the Poincaré map (generated by sampling the flow at frequency $\omega_2$) as a map on the circle, the circle being the limit cycle.  In fact, for certain parameters, we see behavior similar to those obtained from the circle map.

The complete state equations of the circuit is given by:
\[ \begin{array}{lcl} \frac{dv}{dt} & = &
-\frac{1}{RC}v - \frac{1}{C}i + \frac{E}{RC} \\
\frac{di}{dt} & = & \frac{1}{L}v - \frac{f(i)}{L}
- \frac{E_0 \sin(\omega t)}{L}
\end{array}
\]

By adjusting the capacitor $C$, we change the free running frequency of the oscillator, i.e. changing the ratio between the two frequency. We observe frequency locking where the oscillator oscillates at a submultiple of the driving frequency for a range of capacitor values.  If we vary the driving frequency, we observe the Devil's staircase, similar to the one observed in the circle map.

References:
Van der Pol, B. and Van der Mark, J., “Frequency demultiplication”, Nature, 120, 363-364, 1927.
Kennedy, M. P. & Chua, L. O., “Van der Pol and chaos,” IEEE Trans. Circuits Syst. CAS-33, 974–980, 1986.
Kennedy, M. P., Krieg, K. R. & Chua, L. O., “The Devil’s staircase: The electrical engineer’s fractal,” IEEE Trans. Circuits Syst. CAS-36, 1133–1139, 1989.


Triangular numbers

A triangular number $T(n)$ is defined as $n(n+1)/2$.  It is equal to the binomial coefficient $\left(\begin{array}{c}n+1\\2\end{array}\right)$ and is also equal to  $0+1+2+\cdots+n$. When is an integer $m\geq 0$ equal to a triangular number $T(n)$ for some integer $n\geq 0$?  We have $n(n+1) = 2m$. Using the quadratic formula to solve the quadratic equation $n^2+n-2m = 0$ for $n$, we obtain one solution for $n$:
$$ n = \frac{\sqrt{8m+1}-1}{2} $$
The other solution for $n$ is negative (or complex) so we will not use that.
If $8m+1$ is not the square of an integer, then $n$ is not an integer.  If $8m+1$ is the square of an integer, then $8m+1$ is odd and thus $\sqrt{8m+1}$ is odd as well. This means that $n = \frac{\sqrt{8m+1}-1}{2}$ is an integer. Thus $m$ is a triangular number if and only if $8m+1$ is the square of an integer.

Sunday, February 14, 2016

What not to listen to while driving

We were driving on the road today and listening to "In the shadow of the mountain king" from Peer Gynt by Edvard Grieg when my son remarked: "This is not a good piece of music to listen to when driving, it makes you drive faster and faster."  My wife replied: "The same is true for Bolero".  I tend to agree.  Luckily, my driving is not affected by the tempo of the music and we reached our destination safely.

Friday, February 12, 2016

The curse and blessing of exponential growth

Exponential growth is a common phenomena occurring all around us.  Sometimes it is good, other times not.  Simply speaking, we talk about exponential growth if some quantity is increasing as an exponential function of another quantity, i.e. y = abx.

The Good:
  1. Typically when you put your money  in the bank, your banks pays you interest as a percentage of your money, i.e. if you have \$100 in the bank and the bank pays you 5% interest a year, then you will have 1.05$\times$\$100 = \$105 after one year.  Assuming the interest rate is constant, if the next year, the bank only pays you 5% of the original \$100, then your gain will be \$5 year after year, i.e the money in the bank is 100+5n after n years.  But because of compound interest, i.e. your interest will also earn interest, you will receive 5% of \$105 = \$5.25 in interest the second year and the money in the bank will be will be \$100*1.05n after n years, i.e. an exponential growth.  If you can appreciate how fast exponential growth is, this is the best reason for anyone to save money early.
  2. In cryptography, making the number of possibilities that an encryption key can take on large is an important idea to make cryptographic techniques secure.  This is akin to choosing a long password.  The number of combinations grows exponentially with the number of digits.  For instance, a n-digit decimal number has $10^n$ possible combinations.
The not so Good:
  1. In the analysis of computer algorithms, many known algorithms for solving hard NP-complete problems (such as 3SAT) have time complexity exponential in the problem size.  This means that the size of the problem that can be solved will be limited.
  2. Many models of growth assumes an exponential growth rate, but this cannot be sustained indefinitely in a finite universe.  Some examples are Moore's Law or models of population growth.  Models of chaotic systems such as the Lorenz system and Chua's circuit also experience exponential divergence of trajectories on a small scale, but on a larger scale the trajectories remain bounded.