Showing posts from March, 2015

Gravitational redshift

Before I talk about gravitational redshift, let me just briefly talk about doppler shift.Doppler shift is a high school concept that most of us have learnt at some point or the other in our lives. If you haven’t learnt it, safe to say you’ve surely experienced it. Say you’re on a platform and a train is approaching you. The train is sounding a horn, to catch the attention of passengers on the platform. The increase in the pitch of the horn as the train is approaching you and the decrease in pitch as the train is moving away is the phenomenon of doppler shift.The same can happen to light. Say a source of light is moving towards you, the frequency you perceive the light to be at is not the same as the frequency of light emitted by the source. This is because of the fact that a clock in the frame of the source ticks slower than your clock, which is at rest. This is the phenomenon of time dilation.Venturing further now, the Schwarzschild metric describes the spherically symmetric curved s…

A bit of fortran and GR

I finally got off my ass and figured out how to use arrays and matrices in fortran, beginning from how to write them and read them and so on. I was trying to implement a simple linear algebra solution, that we had already done in C and python. I was frustrated most of the time because of the inconsistency in using the various loops, in defining variables and so on. I don't know how much ANSI C has changed in the last 10 years but from the looks of it, Fortran has. But I did find an interesting implicit method to read arrays in the in the mess, very functional and minimalistic.

On the other hand, as I've been doing over the weekend, I shall continue to write about the various metrics used in GR and their relevant christoffel connection symbols, reimann tensors and ricci tensor and ricci scalars. I read grtiny.pdf or the No-Nonsense introduction to general theory of relativity by Sean Carroll and was spurred on by it a little. But in general, I want to document all of this, pre…

Gravitational lensing and CMB photons

I wanted answers to two questions at the beginning of the semester, both of which are related to general relativity and cosmology. Both of the questions are related to gravitational lensing, a phenomenon where light bends around massive objects. Gravitational lensing was one of the predictions of Einstein's General theory of relativity and was observed during a solar eclipse.

The first of my questions is related to how distant galaxies are lensed by galaxy clusters in our line of sight. Conventional optics governs that if two sources of light are placed behind one another, the farther one will be obscured by the closer one. General relativity, on the other hand, allows for light emitted by the distant source to get bent around the closer source to reach us. It has been observed to happen that multiple images of the distant galaxy are formed due to a lens in the line of sight. Einstein's cross is one such example. Now, having covered the topics of curvature and geodesics in th…

The week that wasn't (written about)

To be exact, it's been almost 10 days since I last wrote. It's not that I don't have anything to say anymore, I've been talking about menial, day-to-day, conventionally boring stuff all along, it's just that I lost interest in telling people how (conventionally) boring my days were. I can say that I needed a break from writing. I can say that I was busy with work. I can say that I was not interested in writing anymore but I guess none of them are the true reason. I guess I just stopped caring. I don't really have much of a reason as to why I stopped writing and why I am starting again.

It's been a productive week I guess, compared to the same week last year that is. I got tired of having to solve the same problem over and over again so I decided to latex my solutions. I was also getting frustrated/irritated because I wasn't finding practice problems at my level. And because most textbooks don't have a solution sets. One long term goal that I've…

Another one bites the dust

Not much to say today other than for the fact that there were a couple of interesting classes in the morning, one on estimating the fraction of radiation emitted by a body that is received by another (referred to as view factor) and another on ultra-short pulses and how they can be characterized in the frequency space using phase which is a linear, quadratic or higher order functions of time. It's hard to put in words but I'll try make a simulation as I have earlier. I am still trying to swallow the fact that the leading and the trailing edge of the pulse can be at a different frequency!

Symbolic computation in python

I now have a working code that can compute the christoffel symbols for a given metric. I have computed them for two kinds of metrics here. I intend to extend it to be able to compute the riemann and the ricci tensor and eventually the ricci scalar, which is representative of the curvature of a manifold. Hopefully. I will need some help though. Well, I wouldn't mind help...

Back on the wagon

What I mean is that I'm back to my practice of blogging everyday so you can calm down now. I took some time off this weekend, plus yesterday. A classmate of mine visited so we hung out over the weekend and the rest of the time I spent watching the anime one piece. Either way, I finally wanted to get off my ass yesterday but I still needed side projects to keep me occupied, as I was over the last month. And I finally came up with one, to compute the christoffel symbols that I learnt in the course on general relativity. It's not as common as the rest of them have been so far but it's something that im really interested in now. There is already a mathematica script that can compute them but as always, I wanted to implement them in python. I needed to carry out symbolic differentiation and I needed a way to create matrices with non-numeric entries. SymPy was the way to go and after a day of scratching my head, I have been able to put together a small piece of code. I need to …

SHO, DHO and a week filled with popular talks

Since I learnt how to use ipywidgets to make small visualizations, I've wanted to make a model of simple and damped harmonic oscillators, using euler's or runge-kutta methods to solve the second order differential equation. And I finally make them, here and here.

Otherwise, it's been a week filled with popular science talks. I attended a talk on tuesday on the landau theory describing fermi liquids. On wednesday, there was a talk on light that twists inside optical fibers, followed by a talk on particle physics and the Belle detector in Japan. The first talk was about modes of polarization and the methods to be able to generate vortex beams in fibers. He then talked about how vortex modes can be used advance communication technologies. In the following talk on high energy physics, the speaker talked about how the BELLE detector upgrade will help in understanding the CP violation, to study dark matter and how the new instrument is a huge upgrade on it's predecessor.


Runge-Kutta methods of differential equation solvers

I knew that the difference would be large but not this large. Above is a plot of the estimates from a standard 4th order runge-kutta method compared with two other adaptive runge kutta routines. Adaptive runge-kutta routines vary the step size depending on the difference between mth order and nth order runge-kutta estimates, where m and n are usually 4 and 5. The Cash-Karp implementation of the runge-kutta fehlberg method, which is adaptive in nature, is one of the popular stepper routines in use. Each of these routines compares the error in the estimates from the nth and mth order routines with a preset tolerance and increase or decrease the step size appropriately. The above is a plot of the numerical solution of a first order ODE, the analytical solution to which is a narrow gaussian. And you can clearly see how wrong we are. The gaussian has a center at 2 and a width of 0.075 so one will have to start with a very small value to h to begin with, if one is interested in coming up w…

Matrix multiplication and GR

I forgot to mention yesterday that I had also implemented a way to parallelize matrix multiplication. It's trivial and I'm sure a lot of people have done it but I still wanted to try it myself. And no, before you think that I used openmp or mpi, umm, nope. I used the multiprocessing library in python. It was easier that way and way more intuitive to implement. Here is an implementation, with a lot of mess around it. Tonight I need to implement other adaptive runge kutta methods. By other, I mean methods with coefficients other than the RK (4,5) method.

Coming to GR, every class blows my mind and I'm slowly coming around to liking or being able to live with the sheer number of alphabets and greek letters involved! But it's also a lot to remember or grasp. A lot of the properties are slipping my mind and I guess practice will take care of this problem. Time and effort. The only two things that matter. I wish someone had hit me in the head at the end of my first year and…

Runge Kutta methods

I spent my three day weekend coding (again) the solutions to ordinary differential equations, using the runge kutta methods, for example the simple and damped harmonic oscillators which are second order ODEs and a first order ODE whose solution is a shifted gaussian. The shifted gaussian is an interesting problem because RK2 or RK4 methods using constant step size will not be able to sample the trailing edge of the gaussian well. Adaptive runge kutta methods, where one varies the step size depending on the different between the estimate one obtains from RK4 and from RK5, are needed to solve this problem. As usual, the codes are available on my github repositories, here.

One interesting thing that I came across as I was writing these solutions was that fortran has a limit on the number of characters in a line. I found this because I was getting an error, upon compilation, that I missing a bracket and no matter how much I checked, I couldn't find a mistake! I don't know why the…

Estimating the radius of the Sun - The medieval way

I still don't quite understand the whole process but I'll talk about what I do! But if you don't want to listen to me talk, you can go ahead and read my reference. And before we measure the radius of the Sun, we need to measure the distance to the Sun. Or atleast that's how it was done in the olden days.

So, to start, Halley envisioned a way to estimate the distance to the Sun, using the transit of Venus across the Sun. Depending on what latitude one observes from, the time taken by Venus to cross the Sun is different. If one records the time taken and has an estimate of the drift velocity of Venus, in radians per sec, one can estimate the distance between the two paths Venus takes across the Sun's surface. How to estimate the drift velocity of Venus you ask? Well, we know that it takes the Earth 365 days to complete 360 degrees and that it takes Venus 242 days to do the same. We can therefore estimate the relative velocity with which Venus drifts away or comes to…

Estimating the radius of the Moon - The medieval way

TL;DR I myself learnt the method from this page here.
Having estimated the radius of Earth, the next step, celestially speaking, would be to estimate the radius of the Moon, our satellite and closest neighbor. And before we proceed any further, let me just point out the fact that the distances or sizes in astronomy are measured in angles and not in meters. From Earth, it looks to us as though the astronomical objects are moving on a celestial sphere and therefore, their motion can be quantified in terms of angular motion and sizes in angles. How to measure these angles you say? Well using a telescope of course! A telescope can be calibrated such that one can move it along or perpendicular to the horizon with milli-degree accuracy, helping us therefore to estimate the angular size of objects in the sky.

Now that we've cleared that, let's look at quantities in the Earth-Moon-Sun system that can actually be measured. We already know the radius of Earth. We can estimate the angula…

Estimating the radius of the Earth - The medieval way

I had an interesting discussion with a couple of friends yesterday and we stumbled upon the topic of various astronomical scales, ranging from the radius of the earth to the distance to the sun and how ancient astronomers estimated them. Specifically, let's talk about the radius of the Earth and how it's measured.

But before we get to it, I have a few tangential questions to ask you. What causes seasonal changes on Earth and what is special about the Tropic of Cancer and Tropic of Capricorn i.e 23 and 1/2 degrees north and 22 and 1/2 degrees south? Quite a few people think that the apparent change in the distance between the Sun and the Earth as the Earth moves along it's elliptical orbit is what causes the seasons. In reality, if you look at the numbers, you will see that the ratio of the light that earth receives at it's perigee is 0.94 times that it receives at it's apogee, not large enough to change the temperature significantly. What causes the seasons is in …

Volume of an n-sphere

As i mentioned earlier, I am trying to estimate the volume of an n-sphere, both using the normal newton-cotes methods of integration and using the monte carlo integration methods. I finally figured out how to do measure the volume of a 2 sphere or a sphere in 3 dimensions. I was being stupid and I hadn't put enough thought into the problem, which was evident in the amount of time I wasted implementing faulty methods and second guessing coincidentally approximate results. Moving on to higher dim spheres now!

Radiative heat transfer

I've wanted to simulate the temperature variation of a surface using a multitude of factors - incident radiation, absorption, emission, transmission and reflection coefficient and convection or conduction if relevant. This is one of the main reasons I wanted to take a course on atmospheric sciences last semester and this is one of the many reasons I am currently doing a course on radiative heat transfer. And we finally came to that point this last week, being taught how to estimate total hemispherical emission or absorption coefficients depending on the frequency or angular dependence of radiation and on the angular, spectral dependence of directional, spectral coefficient of emission or absorption. So far, in class, we've been doing relatively simple problems, which don't necessitate the use of a computer. But I want to start pulling at this string now, the string that will eventually lead me to simulate how the emission spectrum of a hollow sphere looks, one with a perf…

The week that wasn't

Time is flying by fast and I can hardly comprehend where the week got spent. Atleast the day was spent well, redoing problems from a course on general relativity that I am currently sitting through. The concept of killing vectors is slowly sinking into me and I honestly can't get enough of the course, I wish he'd take classes everyday. It's surprising the amount of material the prof covers in a single hour and the last two weeks of classes have simply been mind blowing. Starting with the derivation of the equations of motion from the line element ds, it has been one blow after another.

On the other hand, I spent a bit of time thinking about simple integration problems that I could try the monte carlo method on and compare the errors that I would get with the errors from simpson's rule or trapezoid rule. One easy question that I could come up with was the volume of an n-dimensional sphere. It is fairly straight forward to convert a code that measures the area of a circ…