Wednesday, 28 November 2012

Chaotic Behavior in Moon-Earth-Sun Orbit System Using Runge Kutta Approximation


Runge-Kutta method for approximating differential equations

Methods for approximating the solutions of differential equations are useful, as most differential equations cannot be solved analytically. Sometimes it is extremely difficult to integrate the functions or provide explicit solutions.

We may then invoke approximating methods.

Such methods include the Euler method, Midpoint method and the Runge-Kutta method. The Euler method is the simplest:

It approximates the unknown function by a straight line i.e. Y=m(X-Xo) + Yo, where m = dy/dx. which is the gradient. We know from definition that dy/dx = f(x,y) (some function) which leads us to write 
Y=f(Xo,Yo)(X-Xo)+Yo. So we start off at some initial point values and head off in a direction. 

However we notice that the approximation would keep going in a straight line and it would not 'stick' to the true plot so we invoke an iterative method.

Yn+1= h f(Xn,Yn) + Yn








You notice that the Euler method is essentially too naive. We invoke a second method which uses the midpoint of the midpoint of the Euler method. So it is essentially correcting itself by 1 step which is a better approximation.

We then... you guessed it.... do more midpoints. We end up using a very good approximation which is known as the R-K approx.

The fundamental algorithm is:

Yn+1= Yn + k1/6+k2/3+k3/3+k4/6+O (h5)

where k1 = hf(Xn,Yn) , k2 = hf(Xn+1/2h, Yn + 1/2k1) , k3 =hf(Xn +1/2h, Yn + 1/2k2),
k4 = hf(Xn+h, Yn + k3)

Where K's are just co-efficients which aid in self correcting the algorithm in 'figuring' out the new gradient after an iteration.

We can apply this method in approximating SECOND-order differential equations if we write them in terms of first order differential equations. (If said differentials are coupled... meaning they depend on one another).

How to use coupled differentials to approx orbits

The fundamental algorithm of the R-K method is always the same. We just need to formulate 4 differential equations (2 for each dimension (X, Y)).

We can say define (X,Y,Velocity X, Velocity Y)  as quantities relating to Z(1), Z(2), Z(3) and Z(4) respectively.

We say X and Y are the distances the Earth's centre is from the origin (the sun).

From general laws of classical mechanics: dX/dt = Velocity X, dY/dt = Velocity Y, d(Velocity X)/dt = acceleration X direction and d(Velocity Y)/dt = acceleration in Y direction.

This means we have reduced d^2 X/dt^2 (second order) as first order differential.

We can set the acceleration X and acceleration Y in accordance with the laws of Keplar and Newton:

- Ms*X/(R^2)  (For X)  and -Ms*Y/(R^2) (For Y).... In cartesian co-ords :  R = Root (X^2 + Y^2)

but we have to times R^2 by another R as we are getting the magnitude (Basically using the definitions of unit vectors and changing the unit vector in the Rth direction as a value R)

So we finally end up... with our Z(4) arrays which relate to the x-y displacements and velocities of the earth
a sub function which looks like:


Dim Mass_Sun, Mass_Earth As Double
        Mass_Sun = 100 : Mass_Earth = 2

        dzdt(1) = z(3) '= Vel_X
        dzdt(2) = z(4) '= Vel_Y
        dzdt(3) = -(Mass_Sun * z(1)) / (z(1) ^ 2 + z(2) ^ 2) ^ (3 / 2) 'Accel earth X
        dzdt(4) = -(Mass_Sun * z(2)) / (z(1) ^ 2 + z(2) ^ 2) ^ (3 / 2) 'Accel earth Y


With these in place and with the CORRECT initial conditions and with some program which calls plots of points... you can simulate the earth orbiting around the sun.

You can also do this with the moon. Setting the Z(4) array to an Z(8) array as we need 4 more differential functions to map the moons orbit onto some plot.

Thinking about this... the moon is orbiting around the earth but it also feels an attractive force from the sun. So its acceleration will contain one force term from contribution from the Sun's mass and another for the earth's mass. To plot it in relation to the SUN's origin we need to think about the differences in distances between earths points and moons and use these distances to define a new radius from the earths centre to the moons but still in the co-ordinate system of the sun.

We get a function like:


dzdt(5) = z(7)
dzdt(6) = z(8)

dzdt(7) = -Sun contribution in X  - Earth contribution in X

 dzdt(8) = ''  '' for Y...

Note we have defined the Z array elements in a similar fashion to what we did with the earths.

Initial condition trial and error hence realizing the sensitivity of the systems behavior
on small deviations to initial conditions

You should have a nice initial condition for the Earth for a stable orbit. The moons orbit is much more complicated and you will find that it takes a while to see why. If you set the distance between moon and earth as too large the moon will not feel enough force to orbit the earth it will orbit the sun or fly off (if it has initial velocities). I will not say the appropriated initial conditions. This spoils the exercise. 

I will however comment on the fact that, if one changes the initial velocity in a direction by a small amount.. say 1 part in 10 (+- 0.1) the system will look similar to the one before however over time the orbit will look completely different... what happened to me was that it would orbit for a small time say 1/4 of the earths orbit round the sun... then it would somehow get closer and closer to the earths centre.... its period value increases and then it just flies off at a tangent. 

The system depends strongly on initial conditions which is a character of chaotic behavior (butterfly effect). Two body gravitational systems are complicated and we see in other star systems that planets orbits vary greatly and the moons orbits differ greatly too compared to others.

If the earth was slightly lighter or slightly further away from the sun we could see very different orbits from the one we are in now (over a long period of time). 

It was an interesting observation. It also highlights the fact that objects orbiting other objects are actually statistically rare. Objects can fly past planets (asteroids, planet debris etc.) but not come into orbit, it takes some special cases for things to start orbiting planets and stars. Our universe and galaxy is sooooo large however that the actual occurrences of  orbits will increase.






Wednesday, 21 November 2012

Unveiled Syrian Woman Goes Viral

Dana Bakdounis

Winston in George Orwell's novel 1984 experienced a dream about Julia, his love and a rebel to the absolute dictatorship that governed them, ripping her bland garments off in an open field. He thought to himself, that she was... with one sharp motion of the arm freeing herself from Big Brothers chains. 

This picture reminded me of this great moment in the book, as it is completely analogous to it. Dana Bakdounis who is a 20 year old Syrian woman posted a facebook photo of herself without her head garment and showed her passport photo which represented herself within the system. The system is of course the Muslim Sharia-law system, where religious dogma are installed into the so called justice system. The system, generally, is a fundamentalist-anti-equality one which puts men as the superior and women as their demeanor...  a classic patriarchal society based on no evidence. (No such society can be founded on evidence as there is none!)

Bakdounis is brave. It is extremely disrespectful.. almost heretical to unveil oneself in public (according to Muslim preachers). In some parts of the middle east such unveiling would result in the death penalty or beatings and humiliation. However she is not the only one pushing away from this tradition, universities in Syria are banning full face veils as the staff of the universities such as, Kinda al-Shammat (a law professor) are saying that it contradicts the universities academic values.

"We have never gone to the extreme left or the extreme right," - Kinda al Shammat

The photo was placed on a feminist facebook page: http://www.facebook.com/intifadat.almar2a?fref=ts which has 71,905 likes!!!!  Lot's of support was given by women from Syria who are religious and they respected her audacity and her determination to rightfully claim the freedoms they deserve.

What I would like to see is Bakdounis' renewed passport with a photo of her without her head veil. I say this because your passport is your international identity, having to wear a head veil is implying that it is part of who you are... the fact is it shouldn't be. It is mere cloth, it is an accessory. What is intrinsic to you is your body and your brain (and all the wonderful thoughts and memories that come with it).

Is this another crack in the dam of a fundamentalist society holding back the natural flow of freedom and honesty? Yes. Ideas that are false, made up to numb society will be found out by reason and the need to progress. Society cannot progress when its basis in law and in the community is founded upon religious dogma.

"I want justice because I already have my freedom, 
and I'm not afraid of anything now, now I can do 
whatever I believe it is right to do” - Dana Bakdounis








Saturday, 17 November 2012

Hormone Oxytocin Could Help Stop Male Partners Cheating


Rene Hurlemann, MD, PHD, of the university of Bonn is leading a study into the effects of the hormone Oxytocin on heterosexual males in committed relationships. They placed the hormone into the system of a male in a committed relationship (Called M-r) through a nasal spray and 45 minutes later they introduced an unknown attractive female (U-f). The female would move closer to M-r but M-r had to say when the distance between them was uncomfortable. They conducted this test with Oxytocin introduced in heterosexual  single males (M-s) and they also, for comparison, introduced a placebo into M-s and M-r.

They found that with an increase in Oxytocin levels the minimum distance between M-r and U-f was greater than with M-s with Oxy, M-s no Oxy, M-r no Oxy. With repeated results and minimization of errors, they had shown a relationship between the hormone and infidelity.

Oxytocin is produced in the hypothalamus (Figure 1) and it is produced by magnocellular neurosecretory  cells which are large cells in the supraoptic nucleus (abbreviated - SON  shown in Figure 2) within the hypothalamus. SON contains around 3,000 neurons.


Figure 1 - Overall cross section of head and magnification of Hypothalamus (Green)

Figure 2- Map showing SON which is shaded.

The hormone plays roles within females such as Lactation (Let down effect) and Uterine contraction. Also: 

"Previous animal research in prairie voles identified oxytocin as major key for monogamous fidelity in animals," Hurlemann said. "Here, we provide the first evidence that oxytocin may have a similar role for humans."

Read more at: http://medicalxpress.com/news/2012-11-hormone-affects-distance-men-unknown.html#jCp
So the hormone has an effect on fidelity (even in mammals that are not human or prime-ape)   and some motherly processes in female humans. This research is now showing it has effects on males in committed relationships. Hurlemann's team also conducted an experiment between M-r with Oxy and U-m (unknown males) and this did not follow the same pattern, nothing interesting happened. What Hurlemann's team could do for future research is conduct the same experiment on homo sexual men in committed relationships and vice versa and see if this has the same effect.

Obviously do not try and introduce this hormone into your boyfriends system without his consent, but maybe in marriage counselling where promiscuity is a problem... they may recommend a nasal spray of oxytocin before a night out so the man is less likely to cheat. (Assuming no knowledge of trust between partners).


Stay tuned for more science news!







Thursday, 8 November 2012

On Why Politics Should Become Scientific



Politics is not a scientific field. It is a field based largely on ideology, philosophy, economics and some extra little science which is chosen at will. A lot of politicians ignore science, evidence that they may need to collate and they sometimes ignore people who have experience or expertise in a given field.

Here for instance is a video of Sir Alan Sugar presenting his speech about the economy, he presents his views clearly, honestly and presents some 'tangible' real implementations.. such as Duty on diesel reduction, tax revenue deduction etc. for small-medium businesses which are employing more people and taking part in good, fair business.


Sir Alan Sugar has become a peer of the house of lords. He will no doubt use his business knowledge to inform the Lords on legislation. His knowledge was gained from real experience (experience should 99% of the time  be respected and valued as experience teaches us about what we have experienced, in Sugar's case it is the world of business and finance).

Here is a video of the worst of the houses of parliament, here we witness disorder and chaos in a place where ordered, specific and careful debate should take place (as what the houses implement within the state affects the economy and the lives of it's citizens):


There are many more instances of chaos like this... many instances of name-calling, heckling and just outright useless jabbering. However, many MPs genuinely care about their constituency but a lot of them care more about their wage, their social status and their ego to really spend most of their focus on solving problems.

We must question whether MPs and politicians in general have the right tool kits to solve complicated problems within complicated systems. Most of the issues arising are to do with the economy, with education and health. These are all systems which can be modeled by mathematics and science (or regulations and changes can be based upon evidence and testing).

How can this field become a field where problems are solved due to evidence and tested assumptions?

Society is complex. Politicians, Lords etc. have a hard job of putting legislation, initiatives and programs in to effect the motion of society in such a way as to begin to improve problems. However most politicians have no training in modelling complex systems in a specific way. They are not trained to completely separate their moral, religious and emotional values from the facts. Scientists are trained to do this everyday, if they don't do this efficiently then they will soon see more failures than successes within their research as their morals may steer them away from evidence or away from some possible theory which does not sit well with their previous intuition.

This field can become more scientific if future politicians have scientific training or are able to solve problems like a scientist. It is not enough for MPs to refer to other working scientists (as they are busy) and these MPs may still pick and choose data or conclusions to fit their view of the problem or just to stay in the game (money for themselves). 

In the house of lords we want to see projectors which show presentations of data collections or tests on different methods of teaching and showing each successes or failures of methods. We need to be more specific in politics as changing or analyzing complex systems, ignoring or not taking time to find details, will lead to great uncertainties and deviations. 

Take for example economic theory, it ignores some basic facts about human psychology and the environment. These all have parts in the function which defines the system. 

So at the heart of this is educating a large volume of the youth in solving problems scientifically and mathematically and using practicality, equality and reason to run the government and houses of parliament.

But politics is still governed by a certain class, from a certain education system and holds many a person who just wants wealth. 

This class is the upper classes from  private/public schools where traditional history, politics etc. is taught rather than pure problem solving and using quantitative ideas/techniques to test assumptions and predictions.

What this nation, more importantly this world, needs is people who can solve problems to increase financial success, knowledge and healthy and solve them god damn well. These people are in demand but the field of politics is so convoluted that nobody apart from posh-upper-class-eton-latin-reading-philosophical-bullshitters who want duck houses is going to go in it.