Post Reply 
[VA] SRC #012f - Then and Now: Angle
05-04-2023, 06:31 PM (This post was last modified: 05-04-2023 07:36 PM by J-F Garnier.)
Post: #4
RE: [VA] SRC #012f - Then and Now: Angle
I'm impressed by the performance and quality of the solution from Fernando.
He found all the 6 shortest paths, as far as I can verify them, and some were not easy to catch.
There are probably many more, but much more complex and longer.

At first, I was not sure that integrating the motion equations would work well, because the trajectories are likely to be chaotic. Small changes in the initial angle may produce radically different trajectories, also going too close to a star may produce large acceleration, so integration may not be accurate enough.

So my analysis was looking at other aspects.
One aspect was to consider that the particle (the planet) was free, so the sum of its kinetic energy v²/2 and potential energy (sum of the -1/di quantities for each star at distance di) must be constant.

This gives the value of the final speed:
Initial energy (vi=1 speed) = 1/2 - ( 2/sqr(5) + 1/2 + 2/sqr(10) + 1/3 ) = -1.860
Final energy (vf speed) = 1/2*vf^2 - ( 1/1 + 1/2 + 1/sqr(2) + 2/sqr(5) + 1/sqr(8) )
we get final speed vf = 1.786
Also, since the energy is negative, the planet is bound to the star system and can't escape and may, soon or later, cross the position (4,1) possibly many times.

However, I didn't come to anything really useful for a full solution.

So I was wrong, motion integration was the way to go, and my (small) contribution here will be a few optimizations of Fernando's program.

I noticed that some time consuming fine searches were useless.
I added these 2 tests to avoid them:

- a consistency check of the final speed against the value I calculated above, this protects against some cases where the trajectory goes too close to a star and the integration becomes completely wrong:
    235 IF ABS(V)>2 THEN 320 ! If abnormal final speed, skip
- a better test to avoid testing too close trajectories, that can't be realistic:
    220 IF D5<E(J)+.02 THEN 320 ! If too close from a root angle already found, skip
With these changes, I obtained the same results as Fernando but in 30% less time (223s instead of 326s on my Emu71/Win system).

J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #012f - Then and Now: Angle - J-F Garnier - 05-04-2023 06:31 PM



User(s) browsing this thread: 3 Guest(s)