Physics
Submitted by vyvy on 2007, April 12 - 2:12pm
1. Background and The Problem
When you want to prepare a cup of tea, it's best to put the leaves into the water with a good temperature. If the temperature is too low, the tea would not be brewed sufficiently; If the temperature is too high, some of the good nutritions will be gone. However, how to prepare a glass of water with desired temperature? Note that the requirement is not very strict. After all, an error of only a few degree Celsius won't cause a big problem here.
An easy answer: Probe the water with a thermometer. Unfortunately, a thermometer is not always available, and you probably don't want to appear too special or look stupid probing your water each time in front of your friends or colleagues. You may not be experienced enough to tell the rough temperature of the water too. What to do? I thought of a simple method a few years ago. I shouldn't be the first one who discovered this, as the method is derived only with high-school physics. However, I haven't seen anybody talking about this method before, so I write it down here.
2. The Method
This method requires only some hot and some cold water with known temperatures. To prepare some water with a target temperature, just mix some cold and some hot water with a correct ratio. You can calculate the rough ratio with a very simple formula.
Bookmark/Search this post with:
Submitted by vyvy on 2007, February 7 - 5:22pm
I have been writing my own ephemeride program for my own interest. However, I encounter a problem when I use it to generate Chinese lunisolar calendar. While the program succeeds to produce the Chinese calendar for year 1929-2043 correctly (verified against official ones), it fails for year 1979. In particular, what's the exact time of Dahan [en.wikipedia.org] (大寒; major cold) in year 1979?
By definition, the major cold begins when the apparent longitude of the sun (with respect to the mean equinox) reaches 300°. (Is this definition correct?) To find out the exact answer, we can refer to some accurate ephemeride such as the JPL Horizons On-Line Ephemeris System that makes use of DE405/DE406/DE413, which are generally considered the most accurate ephemerides to date.
Examine the apparent longitude of the sun of every minute (in Terrestrial Time) on 20th Jan 1979, we can find that:
- At 1979-Jan-20, 16:00 TT, the longitude was 299.9994615°;
- At 1979-Jan-20, 16:01 TT, the longitude was 300.0001683°.
By doing a parabolic interpolation with five tabular values, we can find that the longitude turned 300° at 1979-Jan-20, 16:00:45.712 TT (Terrestrial Time). At that time, the value of Delta-T [en.wikipedia.org] (= UT - TT) is 50.184s. Thus, the event happened at 1979-Jan-20, 15:59:55.528 UT (Universal Time). Note that the absolute difference of UT and UTC (Coordinated Universal Time) is no more than 0.9s. Therefore, in Beijing of China, which is within the UTC+8 time zone, the event happened no later than 1979-Jan-20, 23:59:57.
However, from many resources on Chinese lunisolar calendar I have checked, the Dahan for year 1979 fell on Jan-21 00:00 --- less than one minute but also one day later than the calculation above! Why is there such a discrepancy? More findings about this issue:
- If you use the JPL Horizons system to check the apparent longitude of the sun at 1979-Jan-21 00:00:00 UT, it shows that the longitude is at 300.0000526°, or 300° 0' 0".1894. So it means that Dahan should happened before that time.
- From the previous point, to calculate this Dahan accurately, an algorithm or an ephemeride with an accuracy better than 0".1894 is required. Was such an ephemeride available that time? Nonetheless, observatory equipments with such an accuracy should be available that time.
- The Chinese lunisolar calendar had been 'wrongly' calculated especially before year 1929, due to the lack of accurate ephemeride. But this mismatch happened in year 1979, which is considered quite recent. Why?
- I found that an open-source Chinese lunisolar calendar program 'correctly' (or incorrectly?) calculated that the Dahan fell on Jan-21. Further examination shows that the program misused the Terrestrial Time instead of the Universal Time to perform the calculation. So I suppose that the result is not correct. We need to use UT instead of TT, right?
I have not found an explanation to the discrepancy. I need it to solve the problem in my own ephemeride program. Is there anything wrong in my calculation? Tell me if you know, thanks!
Bookmark/Search this post with:
Submitted by vyvy on 2006, December 14 - 3:07pm
1. Introductions
This is a rough guide on how to build or implement your own ephemeris program or library routines. There are some existing programs (and some of them are free) to do such a job. However, there are a few advantages if you build your own one.
- It's your thing. You have complete control of the licensing and the copyright of the program. You can also improve the programs anyhow you like.
- Good way to learn Spherical Astronomy. Of course, you need to like mathematics and astronomy. If you have no interest in these subjects at all, it's better to use an existing program or libraries routines for your purpose.
- Extend it for many other purposes. Since you are familiar with your program, you can easily extend it for many purposes such as (a) calculating the phase of the Moon; (b) predicting eclipses; (c) building your birth charts for many different traditions of astrology; (d) creating calendars (such as the Chinese calendar) that are based on astronomical events; (e) many other things.
While these sound interesting, you have to note that building your very own ephemeris is not for the faint of heart! If you are not familiar with spherical astronomy, be ready to learn a lot of concepts and technical terms related to the subject. As for implementation, expect to write
- a few hundred lines just for very basic set of features and low-precision calculations;
- a few thousand lines for more features and satisfactory accuracy;
- a few ten thousands lines for more complete features and high-precision calculations.
There are some easier ways to tackle this problem. For example, you can interpolate the positions of the planets from some existing ephemerides (such as DE405, DE406). Such an approach is definitely feasible and realistic. But here we focus more on performing the calculations "from scratch" which is useful in many cases. E.g., to calculate just the rough rising and setting time of the sun for a few centuries, it's better to stick to a simpler and less space-consuming low-precision calculation rather than to make use of the gigantic ephemerides.
Let's start.
2. Knowledge Required
Before starting your implementation, there are many concepts you need to understand and study. Here's a list of some important ones.
Mathematical Software Library Routines. In particular, you need to dial with a lot of trigonometric and logarithm calculations. Be very familiar with these to avoid making stupid mistakes. For example, a trigonometric function generally expect an angle expressed in radians, so don't use an angle expressed in degrees directly.
Concepts in Spherical Astronomy. You need to know a lot of thing specific to this subject. Knowing some popular concepts in astronomy like the big bang or the dark energy won't help you here, as we are dealing with locations here! Below is a list of some common concepts just to give you an idea what to expect. Note that the list is NOT exhaustive! The higher precision you want to calculate and implement, the more and the deeper of these concepts you need to understand.
- Time Tracking. TT/TDT (Terrestrial Time); ET (Ephemeris Time); ST (Sidereal Time); UTC (Coordinated Universal Time); UT (Universal Time); Delta-T; Julian day; Julian ephemeris day; Gregorian calendar; etc.
- Coordinate Systems. Horizontal coordinates (altitude, azimuth); Equatorial coordinates (right ascension, declination, equinox, solstice, hour-angle, transit, meridian); Ecliptic coordinates (longitude, latitude, obliquity); Galactic coordinates; Heliocentric; Geocentric; Topocentric; etc.
- Reference Frames. ICRF (International Celestial Reference Frame); FK5 (Fundamental Katalog 5); epoch; mean equator and equinox, etc.
- Orbital Elements. Perihelion; Aphelion; Perigee; Apogee; Eccentricity; Kepler's equation; Mean longitude; Mean anomaly; True anomaly; Equation of the center; etc.
- Miscellaneous. Astronomical Unit; Radius Vector; Aberration; Precession; Nutation; Parallax; Refraction; Twilight; Conjunction; Opposition; True/Geometric position; Mean position; Apparent position; etc.
Mathematics. To understand some basic calculations, you need only high-school mathematics. Be ready to deal with a lot of trigonometric functions and analytical geometry. But to deal with very high precision calculations, you may need to know more on calculus and astrophysics.
Where can you learn these concepts? Look for some good books or Internet resources related to this subject. I myself have learned a lot from [PDS] and various Internet resources. To learn spherical astronomy seriously, you can start with [WMS].
3. Guides for the Algorithms
3.1. Notes on Accuracy
Decide carefully the level of precision you need based on the purpose of your implementation. If you just want to use it to draw a simple sundial, then low-precision calculations are sufficient. But if you want to launch a rocket to the Moon or to visit your ET friends many light years away, then stick to the best algorithms known to human beings.
You may wonder, why don't we just go straight to the 'exact'/'perfect'-precision implementation? With such an implementation, we can then extend it anyhow we like. It's true, but there are some pragmatic issues. First, the state-of-the-art theories generally involve a lot of tedious calculations. E.g., ELP2000-82B is one of the best theories for calculating the position of the Moon. To calculate the position of the Moon in any given instant, you need to perform over 30 thousand trigonometric calculations. So... Second, storing such information takes space. You may not want to include such data especially for a portable device. Third, implementing the best solutions involves much more efforts in implementation and testing.
We will briefly mention the kind of applications you can do for calculations with different levels of precision. An interesting trade-off on the precision is to implement some calculations with different levels of precisions. Use only the one you need for your applications. E.g., to predict solar eclipse, you can first estimate the date and time a solar eclipse may occur by using low-precision (but faster) calculations. Then, use high-precision (but slower) algorithms to calculate the exact times related to the eclipse.
Last but not least, you need to know the maximum error introduced by each algorithm. With this, you can tell when the algorithm fails. For example, if an algorithm tells you that a new Moon starts from 11.59pm tonight, but its precision is low and may incur up to 10 minutes of maximum error in time, then you can't tell whether a new Moon starts today or tomorrow. Such a case may not affect you if you want to observe other stars on a new Moon night, but it can be extremely important if you want to calculate an astronomical lunar calendar. To resolve such a case, you need to resort to high-precision calculations.
3.2. Low-Precision Algorithms
To find out the rough locations of the planets at night, to design a normal sundial, to include a cute moon phase indicator in your PDA, to design a compass based on the sun and moon positions, or to know the rough rising and setting time of the sun and the moon, low-precision calculations are sufficient.
There are a few good places to learn such calculations. The book [PDS] covers a lot of useful concepts and low-precision algorithms. The following websites contain good resources too: Approximate astronomical positions, How to compute planetary positions.
With this level of precession, you normally don't need to distinguish between the TT (Terrestrial Time) and UTC (Coordinated Universal Time), among the various reference frames, and you need only simple linear interpolation.
3.3. High-Precision Algorithms
To calculate an accurate birth chart for the modern western astrology or chinese astrology, to calculate lunar and solar eclipses with satisfactory results, or to calculate a calendar that is based on astronomical events, you may need high-precision algorithms. In particular, knowing the maximum possible error that can incur could be critical for some applications.
A good book that includes such algorithms is [JM]. The book introduces various important concepts. The calculations of the planet positions are based on an bridged version of the VSOP87 theory, which is one of the best planetary theories we have. While the calculations of the moon position is based on an abridged version of the famous ELP 2000/82 lunar solution.
You need to distinguish among the time systems here. Don't get confused between TT and UTC. You need to implement the routines to convert between them. A proper interpolation may be necessary to obtain good conversion results. You also need to distinguish among the true, mean, and apparent positions. Be careful to deal with nutation, precession, aberration, parallax, refraction, etc.; and convert among the different reference frames properly.
3.4. "Platinum" Algorithms
If the calculations above don't suit your purpose because you want to design a bullet-proof astrological birth chart, to calculate astronomical calendars, to predict eclipses to an accuracy in the order of milliseconds, or to navigate your spacecraft to another galaxy, then you need to study more and implement very high-precision algorithms.
You can find a lot of great resources from the wonderful Internet. Some useful web sites are listed here.
There are more things you need to take care of. A cubic spline interpolation for Delta-T (= TT - UT1) would be great. You may also want to learn more about astrodynamics and numerical integration.
4. References
[JM] Jean Meeus. Astronomical Algorithms. 2nd Edition. December 1998. ISBN 0-943-39661-1.
[PDS] Peter Duffett-Smith. Practical Astronomy with Your Calculator. Third Edition. March 1989. ISBN 0-521-33699-7.
[WMS] W. M. Smart. Textbook on Spherical Astronomy. 6th Edition (Revised by G.M. Green). 1977. ISBN 0-521-21516-1/0-521-29180-1.
Also take a look at the links I've bookmarked under the Astronomy category on this site.
Bookmark/Search this post with:
Submitted by vyvy on 2006, September 26 - 4:30pm
In the classic science fiction 2001: Space Odyssey (written in 1968 before men stepped on the Moon) by Arthur C. Clarke, the artificial gravities on the Space Station One and the spaceship Discovery are generated with the centrifugal force. Some technical figures of the centrifuges being used are given in the novel.
I wonder whether the figures given are realistic in that they satisfy the laws of physics in our universe, or are simply fictional. I believe that they should be realistic or the author won't care to give such figures to 'challenge' the readers. Anyway, I still carried out the calculation to verify them. Here it goes.
1. Centrifugal Force and Artificial Gravity
You can read the Wikipedia entry on centrifugal force to learn a lot about it. To create an artificial gravity as described in the novel, we use a rotating disk or drum. For our calculations, we need to know the following formula:
\[ F=ma_\mathrm{centrifugal}=m \omega^2 r \]
Bookmark/Search this post with:
Submitted by vyvy on 2006, September 5 - 3:53pm
In an earlier post, I have analyzed and tested the time required by an electrical kettle to boil water. Let's focus on a more practical money issue here: how much do you need to pay for boiling water?
Theoretical Derivation of the Estimation Formula
First of all, we need to know that many electricity providers worldwide use the unit kWh (kilowatt-hour) to calculate the energy usage and charges. It is defined to be the multiplication of kilowatt (1,000W) and hour. Therefore, it would be convenient if we can derive a formula that expresses the energy in kWh.
To calculate the energy required to boil water, we don't need to reinvent the wheel but to use the result obtained from an earlier post. In particular, the time required to boil water is
$!t \approx \frac{4200 \times V \times (100-T_i)}{P} \; \mathrm{seconds}$
where we use units second, watt, litre, and celsius for the time required $t$, the power rating $p$, the volume of the water $V$, and the initial temperature $T_i$ respectively.
Rewrite the formula to calculate the energy $W$ consumed:
$!W = Pt \approx 4200 \times V \times (100-T_i)$.
To express the energy with the unit kWh, we can change $P$ and $t$ to use kilowatt and hour respectively. In this case, we have
$!W = \frac{1}{1000}P \cdot \frac{1}{60\cdot 60} t \approx \frac{1}{3600000} \cdot 4200 \times V \times (100-T_i) \; \mathrm{kWh}$.
By taking approximation and by substituting $V=1$, we obtain the energy required to boil one litre of water:
$!W \approx \frac{100-T_i}{850} \; \mathrm{kWh}$
Great! It looks simple enough for rough estimation.
Some Examples
Every country has its own billing system for electricity. Let's consider the case in Malaysia. According to the domestic rate imposed by Tenaga Nasional Berhad [www2.tnb.com.my] as of this writing (it has been rumored for quite some time to be raised soon), every kWh (of the first 200kWh per month) is charged for RM0.218. When $T_i=28$ (Celsius), which is common here, boiling one litre of water requires about
$!\frac{100-28}{850} \times \mathrm{RM}0.218 \approx \mathrm{RM}0.0184$.
Well, just about 2 Malaysia cents, not bad.
How about Singapore? According to the domestic rate imposed by Singapore Power [www.singaporepower.com.sg] as of this writing (valid from 1st July until 31 March 2006), every kWh is charged for S\$0.2115. When $T_i=28$ (Celsius), which is common in Singapore, boiling one litre of water requires about
$!\frac{100-28}{850} \times \mathrm{S\$}0.2115 \approx \mathrm{S\$}0.0179$.
Well, about 2 Singapore cents, not bad too.
Doctors advise us to drink at least 2 litre of water everyday. So, if you drink boiled water, you spend about RM0.04 or S$0.04 everyday.
You can perform similar calculation for other electrical appliances. The concept and the calculation are not difficult if you studied high-school physics before. Bookmark/Search this post with:
Submitted by vyvy on 2006, September 5 - 3:18pm

Introduction
I have been wondering how long an electrical kettle [en.wikipedia.org] takes to boil water. There are thousand types of kettles in the world, but they have simple and similar circuit designs. If you have a kettle, you can check its power rating and its maximum capacity easily. With these figures, along with the initial temperature of the water (which is normally equal to the room temperature), you should be able to make a good estimate of the time it takes.
The concept behind working out a good estimate should not be too difficult, and involves only high-school physics. However I have neither seriously sat down to do the calculation nor any experiment. A few months ago, I decided to do all these to see what I can get.
I think that the calculation here is very educational to high-school science students. Wonder why I didn't see similar exercises from my physics textbooks.
Theoretical Derivation of the Estimation Formula
The amount of electrical energy $W$ supplied to a kettle with a power rating $P$ within time $t$ is given by
$!W=Pt$.
Unless you have a lousy kettle, most (probably more than 95%) of the energy here should be converted to heat for boiling the water. When you heat up the water, a small amount of the energy will be 'wasted' for heating up the kettle, for controlling other components of the kettle (e.g., LED status indicators), for the heat leaked to the air around the kettle, etc. However, the total mass and the specific heat of the kettle components are very little compared to those of the water. Moreover, a good kettle has (and should) been designed to minimize the wasted energy. Therefore it is generally safe to neglect the 'wasted' energy in our estimation. (However, when we round up some figures later to get a simpler formula later, we round up in the way that would somehow account for the 'wasted' energy.)
By neglecting the little energy not used for heating up the water, the amount of energy $Q$ for heating up the water is:
$!Q \approx W = Pt$.
Thus,
$!t \approx \frac{Q}{P}$.
To heat up some water with an increase in temperature of $\triangle T$, the amount of energy required is
$!Q=mc\triangle T$,
where $m$ and $c$ are the mass and the specific heat of the water respectively. To boil the water, we have
$!\triangle T = T_b - T_i$,
where $T_i$ and $T_b$ are the initial temperature and the boiling point of the water.
The mass of the water with volume $V$ is
$!m=\rho V$,
where $\rho$ is the density of the water.
Combining the formulas above, we obtain
$!t \approx \frac{\rho Vc(T_b-T_i)}{P}$
The specific heat of pure water, $c$, is $4.184 \times 10^{3}\mathrm{J}\,\mathrm{kg}^{-1}\mathrm{K}^{-1}$. The water we boil is hardly pure and generally contains a lot of minerals, and even bacteria and viruses. However, since we are dealing with rough estimation, we assume that we are using pure water and stick to this value.
The density of pure water, $\rho$, varies with its temperature. When we boil water, the initial temperature normally varies from a few Celcius (in winter) to 35 degree Celcius (in summer). The density of the water within this range of temperature varies from $999.8 \mathrm{kg}\,\mathrm{m}^{-3}$ to $995.6 \mathrm{kg}\,\mathrm{m}^{-3}$ (refer to, say, here [www.simetric.co.uk]). Since the density doesn't change much and we are only doing rough estimation, it's reasonable to stick to a value of, say, $997 \mathrm{kg}\,\mathrm{m}^{-3}$ (ok for 24-27 degree Celsius).
The boiling point of pure water, $T_b$, varies with the pressure applied on it. Well, most people boil water near the ground level (unless you stay in Tibet or other high terrains), so we can assume that the pressure applied is one standard atmosphere pressure [en.wikipedia.org]. With this assumption, most people know that water boils at 100 degree Celsius, or 373.15K.
By substituting these values in to the formula above, we obtain:
$!t \approx \frac{997 \times V \times 4.184 \times 10^{3} \times (373.15\mathrm{K}-T_i)}{P}$.
Let's choose the units that are convenient for our calculation and usage. Let's use litre for water volume $V$, degree Celsius for temperature $T_i$, watt for power rating $P$, and second for time $t$. After some manipulation, we obtain
$!t \approx \frac{4171 \times V \times (100-T_i)}{P} \; \mathrm{seconds}$.
A bad thing about this formula is the 'odd' figure 4171. It's good if we can round it to a multiple of a hundred. Throughout the derivation, we know that we have underestimated the time taken. (In particular, more time and thus more energy is required to heat up the whole kettle, to control other components, etc.) So we can round it up and obtain
$!t \approx \frac{4200 \times V \times (100-T_i)}{P} \; \mathrm{seconds}$
This formula looks handy enough for the estimation. Let's try it with a real-world kettle to check how well it works.
Experimental Verification of the Formula
I use my kettle to test the formula. First, check the power rating.
I stay in Malaysia, and the AC voltage here is 240V. It corresponds to the power rating of 2200W. If you use 220V, then the power rating should be 1850W. You can actually find out the relationship between the power rating and the AC voltage easily. Let see.
The main component of a kettle is a heating rod. The resistance $R$ of the heating rod varies only a little under different operating voltages and temperatures. Since the heating rod should consume most electrical power, we have
$!P \approx \frac{V^2}{R}$,
where $P$ is the power rating and $V$ is the operating voltage. If we fix $R$, and manipulate this formula, we get
$!\frac{P_1}{P_2} \approx \frac{{V_1}^2}{{V_2}^2}$.
Let's check the specification with this formula, with $V_1=220V$, $V_2=240V$, $P_1=1850W$, and $P_1=2200W$. The LHS is $\frac{1850W}{2200W} \approx 0.8409$, while the RHS is $\frac{(220V)^2}{(240V)^2} \approx 0.8403$. So the figures here are quite consistent. Great!
Back to our estimation. Now check the maximum capacity of the kettle. It reads 1.7L.
A room temperature of 28 degree Celsius is common here. By substituting $P=2200W$, $V=1.7L$, $T_i = 28^{\circ}\mathrm{C}$ into the formula, we get:
$!t \approx \frac{4200 \times 1.7 \times (100-28)}{2200} \mathrm{s} \approx 234 \mathrm{s} = 3\mathrm{min}\;54\mathrm{s}$
I then took a stop watch and boiled 1.7L of water. I have timed it a few times over a few days, and the time I get lies within 230-250 seconds. So the estimation of 234 seconds is good enough. (If we had used 4171 instead of 4200 in the formula, we get about 232 seconds, which doesn't differ much.) It also shows that the kettle is rather energy efficient.
How about yours?
Related Post: How expensive does a kettle boil water? Bookmark/Search this post with:
|