On Jun 15, 11:30 pm, Christian Heimes <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] 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!

I'll try to read some. But I used mpmath to pump up the precision in
my code, and now the problem doesn't happen. So I think it's okay for
now.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to