32 bit or 64 bit?

Christian Heimes lists at cheimes.de
Sun Jun 15 16:30:04 EDT 2008


ram.rachum at gmail.com wrote:
> I have a physical system set up in which a body is supposed to
> accelerate and to get very close to lightspeed, while never really
> attaining it. After approx. 680 seconds, Python gets stuck and tells
> me the object has passed lightspeed. I put the same equations in
> Mathematica, again I get the same mistake around 680 seconds. So I
> think, I have a problem with my model! Then I pump up the
> WorkingPrecision in Mathematica to about 10. I run the same equations
> again, and it works! At least for the first 10,000 seconds, the object
> does not pass lightspeed.
> I concluded that I need Python to work at a higher precision.

I conclude that your algorithm is numerical wrong. It probably suffers
from a rounding error which increases itself in every iteration.
Increasing the precision doesn't solve your problem. It's only going to
hide the fact that your algorithm doesn't do its job.

Please don't get me wrong. I don't want to imply that you are an idiot
who doesn't know what he is doing. :] Most likely you weren't taught how
to write numerical sound algorithms. Let's all blame your school or
university. *g*

Numerics is a complex area and it took me more than a year to learn the
basics. Don't be embarrassed!




More information about the Python-list mailing list