Replies: 2 comments
-
The reason I do that is to dramatically decrease errors introduced by using a finite time step Δt to approximate an infinitesimal dt. They are not redundant calls because the first call calculates accelerations at a rough estimate of the next position, while the second call calculates accelerations at a much more accurate position estimate. It looks like it could be optimized, but the weird thing is that this is the optimization, LOL! If you try to eliminate the double calculation, the first thing you will notice is that the accuracy drops off a cliff. The only way to get the accuracy back is to decrease Δt so much that the whole thing takes far longer than what you started with. If the performance is really a problem, perhaps the Python version isn't the best fit for your application. It is by far the slowest of all the programming languages Astronomy Engine supports. |
Beta Was this translation helpful? Give feedback.
-
I wondered if that was what you were doing. Thanks for the insight.
…On Thu, Jun 22, 2023 at 5:32 AM Don Cross ***@***.***> wrote:
The reason I do that is to dramatically decrease errors introduced by
using a finite time step Δt to approximate an infinitesimal dt. They are
not redundant calls because the first call calculates accelerations at a
rough estimate of the next position, while the second call calculates
accelerations at a much more accurate position estimate.
It looks like it could be optimized, but the weird thing is that this *is*
the optimization, LOL!
If you try to eliminate the double calculation, the first thing you will
notice is that the accuracy drops off a cliff. The only way to get the
accuracy back is to decrease Δt so much that the whole thing takes far
longer than what you started with.
If the performance is really a problem, perhaps the Python version isn't
the best fit for your application. It is by far the slowest of all the
programming languages Astronomy Engine supports.
—
Reply to this email directly, view it on GitHub
<#312 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARPYOQVWVP4EJNEMH5EITX3XMQ3L7ANCNFSM6AAAAAAZPTCKSQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
In Update(), defined ~around line 10345 of astronomy.py, _CalcBodyAccelerations() is called twice, once before acceleration vectors are computed and once immediately after. I BARELY understand what's going on in that file, but that apparent 'redundancy' feels weird to me - is there no way to squeeze that out of Update()?
Beta Was this translation helpful? Give feedback.
All reactions