use of PI in amsat development practice
Hi, Pi-Day is today (3/14/2010) also we just sprang forward by 1 hour. (http://www.cnn.com/2010/TECH/03/12/pi.day.math/index.html?hpt=C2) and apparently it's also Einsteins Birthday! (http://en.wikipedia.org/wiki/Albert_Einstein)
Wow a lot of key dates here.
My question is: in amateur satellite design/planning how many significant digits are used to calculate the value of pi? Is there a significant difference in results between (4 decimal poinits) and (3 decimal points).
In professional space missions, such as NASA, what is the practice with regards to use of Pi ? Are there any published standards?
Using Excel, is there any way to generate a large range of pi ?
-samudra N3RDX
On 2010-03-14 17:22, Samudra Haque wrote:
Hi, Pi-Day is today (3/14/2010) also we just sprang forward by 1 hour. (http://www.cnn.com/2010/TECH/03/12/pi.day.math/index.html?hpt=C2) and apparently it's also Einsteins Birthday! (http://en.wikipedia.org/wiki/Albert_Einstein)
Wow a lot of key dates here.
Unfortunately Pi-day can not be celebrated in Europe as we have no month 14 over here. ;-)
My question is: in amateur satellite design/planning how many significant digits are used to calculate the value of pi? Is there a significant difference in results between (4 decimal poinits) and (3 decimal points).
In professional space missions, such as NASA, what is the practice with regards to use of Pi ? Are there any published standards?
Using Excel, is there any way to generate a large range of pi ?
I have often used the expression
pi = 4 * arctan(1)
to get Pi with full machine accuracy in a program.
73, Bent
Date: Sun, 14 Mar 2010 18:01:14 +0100 From: Bent OZ6BL oz6bl@fern.dk
On 2010-03-14 17:22, Samudra Haque wrote:
Hi, Pi-Day is today (3/14/2010) also we just sprang forward by 1 hour. (http://www.cnn.com/2010/TECH/03/12/pi.day.math/index.html?hpt=C2) and apparently it's also Einsteins Birthday! (http://en.wikipedia.org/wiki/Albert_Einstein)
Wow a lot of key dates here.
Unfortunately Pi-day can not be celebrated in Europe as we have no month 14 over here. ;-)
To a reasonable approximation, you can celebrate on 22/7.
73, doug
Pi to over a million places in ASCII can be found at Project Gutenberg:
< http://www.gutenberg.org/cache/epub/50/pg50.txt >
For your accurate use, here are the first 3,142:
Pi 3.
1415926535 8979323846 2643383279 5028841971 6939937510 5820974944 5923078164 0628620899 8628034825 3421170679 8214808651 3282306647 0938446095 5058223172 5359408128 4811174502 8410270193 8521105559 6446229489 5493038196 4428810975 6659334461 2847564823 3786783165 2712019091 4564856692 3460348610 4543266482 1339360726 0249141273 7245870066 0631558817 4881520920 9628292540 9171536436 7892590360 0113305305 4882046652 1384146951 9415116094 3305727036 5759591953 0921861173 8193261179 3105118548 0744623799 6274956735 1885752724 8912279381 8301194912 9833673362 4406566430 8602139494 6395224737 1907021798 6094370277 0539217176 2931767523 8467481846 7669405132 0005681271 4526356082 7785771342 7577896091 7363717872 1468440901 2249534301 4654958537 1050792279 6892589235 4201995611 2129021960 8640344181 5981362977 4771309960 5187072113 4999999837 2978049951 0597317328 1609631859 5024459455 3469083026 4252230825 3344685035 2619311881 7101000313 7838752886 5875332083 8142061717 7669147303 5982534904 2875546873 1159562863 8823537875 9375195778 1857780532 1712268066 1300192787 6611195909 2164201989
3809525720 1065485863 2788659361 5338182796 8230301952 0353018529 6899577362 2599413891 2497217752 8347913151 5574857242 4541506959 5082953311 6861727855 8890750983 8175463746 4939319255 0604009277 0167113900 9848824012 8583616035 6370766010 4710181942 9555961989 4676783744 9448255379 7747268471 0404753464 6208046684 2590694912 9331367702 8989152104 7521620569 6602405803 8150193511 2533824300 3558764024 7496473263 9141992726 0426992279 6782354781 6360093417 2164121992 4586315030 2861829745 5570674983 8505494588 5869269956 9092721079 7509302955 3211653449 8720275596 0236480665 4991198818 3479775356 6369807426 5425278625 5181841757 4672890977 7727938000 8164706001 6145249192 1732172147 7235014144 1973568548 1613611573 5255213347 5741849468 4385233239 0739414333 4547762416 8625189835 6948556209 9219222184 2725502542 5688767179 0494601653 4668049886 2723279178 6085784383 8279679766 8145410095 3883786360 9506800642 2512520511 7392984896 0841284886 2694560424 1965285022 2106611863 0674427862 2039194945 0471237137 8696095636 4371917287 4677646575 7396241389 0865832645 9958133904 7802759009
9465764078 9512694683 9835259570 9825822620 5224894077 2671947826 8482601476 9909026401 3639443745 5305068203 4962524517 4939965143 1429809190 6592509372 2169646151 5709858387 4105978859 5977297549 8930161753 9284681382 6868386894 2774155991 8559252459 5395943104 9972524680 8459872736 4469584865 3836736222 6260991246 0805124388 4390451244 1365497627 8079771569 1435997700 1296160894 4169486855 5848406353 4220722258 2848864815 8456028506 0168427394 5226746767 8895252138 5225499546 6672782398 6456596116 3548862305 7745649803 5593634568 1743241125 1507606947 9451096596 0940252288 7971089314 5669136867 2287489405 6010150330 8617928680 9208747609 1782493858 9009714909 6759852613 6554978189 3129784821 6829989487 2265880485 7564014270 4775551323 7964145152 3746234364 5428584447 9526586782 1051141354 7357395231 1342716610 2135969536 2314429524 8493718711 0145765403 5902799344 0374200731 0578539062 1983874478 0847848968 3321445713 8687519435 0643021845 3191048481 0053706146 8067491927 8191197939 9520614196 6342875444 0643745123 7181921799 9839101591 9561814675 1426912397 4894090718 6494231961
5679452080 9514655022 5231603881 9301420937 6213785595 6638937787 0830390697 9207734672 2182562599 6615014215 0306803844 7734549202 6054146659 2520149744 28
On Sun, Mar 14, 2010 at 1:22 PM, Samudra Haque samudra.haque@gmail.com wrote:
Hi, Pi-Day is today (3/14/2010) also we just sprang forward by 1 hour. (http://www.cnn.com/2010/TECH/03/12/pi.day.math/index.html?hpt=C2) and apparently it's also Einsteins Birthday! (http://en.wikipedia.org/wiki/Albert_Einstein)
Wow a lot of key dates here.
My question is: in amateur satellite design/planning how many significant digits are used to calculate the value of pi? Is there a significant difference in results between (4 decimal poinits) and (3 decimal points).
What an interesting question! As many of you know, I'm having fun porting the G3RUH's Plan13 algorithm to the Atmel platform. One of the first things you want to be able to do in programs like this is to convert degrees to radians; and that means pi.
In the appropriate header pi is defined thus: #define M_PI 3.141592653589793238462643 But I use 4-bit precision floating values. (This platform *can* use 8-bit, but because it is Harvard architecture, I come pretty close to killing my stack if I do 8-bit math with the 2kB SRAM.) With this ruby oneliner, I can see the resulting bytes:
[3.141592653589793238462643]].pack("f").each_byte {|c| print c.to_s(16), ' '}
db f 49 40 (This is using the ruby command-line interpreter 'irb'). By paring off numbers from the end, I can see that the my code is actually using roughly the following decimal value: 3.14159265
The resulting accuracy can be attested in this (previously posted) video, beginning at about 1:30 http://www.youtube.com/user/VE9QRP#p/a/u/0/TP_fq_frqKw
Here's something people might not know about the letter pi. It is closely related in ancient Greek to the letter 'phi'. While, we (at least the Western European 'we') pronounce phi as an 'ffff', in ancient Greek it was a 'p' sound with a bit of a puff of air after it, 'p' + 'huh'. There was a similar relationship in Greek between kappa and chi.
73, Bruce
Here's something people might not know about the letter pi. It is closely related in ancient Greek to the letter 'phi'. While, we (at least the Western European 'we') pronounce phi as an 'ffff', in ancient Greek it was a 'p' sound with a bit of a puff of air after it, 'p' + 'huh'. There was a similar relationship in Greek between kappa and chi.
73, Bruce
Yeah, Ancient Greek is an interesting language. Modern Greek too. We native English speakers get taught the "Greek alphabet" in our math and physics classes, and most of the letters are pronounced all wrong for Modern Greek.
For example, all the letters ending in "eye" (Pi, Xi, Phi, etc) are pronounced in Greek ending in "eee". So, Pi is not a big round thing with fruit in a crust, but rather "Pea", the small orb-like vegetable. Sorry, Pi-day folks. You're baking the wrong food.
To make things worse, the letter that looks like a "B" (beta) is not a "bee" sound, but rather it's a Vee. Veeta, like the cheese. The "v"-looking letter sounds like an "n". The "n" letter is actually an "eee" sound. The "e" looking letter is, oddly enough, pronounced like an "eee", one of 6 "eee"s, counting some double-letter combinations. I don't recall any long-I sounds at all, come to think of it.
And they say English is hard to learn...
The best summaries I've found are here: http://www.youtube.com/watch?v=ZSpbpOtF9qI and here: http://greekfood.about.com/od/glossary/a/alphabet.htm
Greg KO6TH (Grandparents came over on "the boat")
_________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. http://clk.atdmt.com/GBL/go/210850553/direct/01/
Bruce
What an interesting question! As many of you know, I'm having fun porting the G3RUH's Plan13 algorithm to the Atmel platform. One of the first things you want to be able to do in programs like this is to convert degrees to radians; and that means pi.
FWIW I used 32 bit accuracy (equivalent to IEEE754 single precision) in my PIC LVB Tracker 2 code (based on G3RUH Plan13 too) without any significant difference in results over 64 bit. Although the accuracy did cause some anomalies, they were small and inconsequential for amateur purposes, typically a second or two in predictions. I tested this by running the same code on a PC and carefully coding constants, stored values and datatypes with #defines so I could recompile on demand and see the differences in the results.
I was lucky, ISTR I had 3.5KB, but even that was a struggle, although I did have the additional dimension of having to deal with manual bank switching too of the PIC18 - you might not have this on your device. And the compiler I used, although generating very compact code, wouldn't compile anything slightly complex, so I had to manually split the statements into simpler steps.
If I did it again, I'd head for at least a 16 bit and probably a 32 bit device, and a different compiler. But five plus years ago we didn't have such devices or capabilities!
73, Howard G6LVB
On Mon, Mar 15, 2010 at 12:30 PM, Howard Long howard@howardlong.com wrote:
Bruce
What an interesting question! As many of you know, I'm having fun porting the G3RUH's Plan13 algorithm to the Atmel platform. One of the first things you want to be able to do in programs like this is to convert degrees to radians; and that means pi.
FWIW I used 32 bit accuracy (equivalent to IEEE754 single precision) in my PIC LVB Tracker 2 code (based on G3RUH Plan13 too) without any significant difference in results over 64 bit. Although the accuracy did cause some anomalies, they were small and inconsequential for amateur purposes, typically a second or two in predictions. I tested this by running the same code on a PC and carefully coding constants, stored values and datatypes with #defines so I could recompile on demand and see the differences in the results.
That's reassuring, and helpful (as was all your Plan13 LVB code!)
In October, I did something similar. In real-time, I compared a day's results tracking a cubesat with Predict and my (32-bit) code compiled on a PC, spitting SSP latitude and longitude into a spreadsheet. The blog post (with spreadsheet) on the experiment is here: http://ve9qrp.blogspot.com/2009/10/testing-plan13.html
The upshot was that they never differed in SSP by more than 35 km, and I'm pretty sure some of the larger excursions were due to the computer flipping over a second between doing the Predict calculation and the P13 one.
More pragmatically, for the last two weeks I've had my latest project revision hooked up to a FT-817 in the basement under our dining room with the volume cranked up. Having 10 CW beacons programmed into it, there are lots of opportunities to listen for tone shifts through a pass, but I haven't noticed anything more than 100 Hz or so.
I was lucky, ISTR I had 3.5KB, but even that was a struggle, although I did have the additional dimension of having to deal with manual bank switching too of the PIC18 - you might not have this on your device. And the compiler I used, although generating very compact code, wouldn't compile anything slightly complex, so I had to manually split the statements into simpler steps.
If I did it again, I'd head for at least a 16 bit and probably a 32 bit device, and a different compiler. But five plus years ago we didn't have such devices or capabilities!
73, Howard G6LVB
You're absolutely right that these devices keep getting more capable.
I started with the Atmeg328, since its the basis of the Arduino platform, in the hopes of making this a useful library for students and so forth. Programming it feels less like a micro-controller, and more like a microcomputer of my school days (Commodore 64 era)!
My final target may be a Atmega644p, which has a 4kB SRAM, 2kB of EEPROM (good for about 20 satellites and their modes) and a luxurious 64kB of program space. That's an additional 32kB to doddle around in. I'm wondering if Predict's algorithm can't be ported.
73, Bruce VE9QRP
participants (7)
-
Bent OZ6BL
-
Bruce Robertson
-
Doug Faunt N6TQS +1-510-655-8604
-
Greg D.
-
Howard Long
-
James Duffey
-
Samudra Haque