tvarnish / alevel-sombrero

Sombrero is my A-Level Computer Science project focusing on the simulation of the N-Body Problem [Archive]
0 stars 0 forks source link

Output Writing Random Data to File [20 Sep 2016] #6

Closed tvarnish closed 6 years ago

tvarnish commented 6 years ago

When the simulation is started from a user-generated file (e.g. solar_system.txt) the system will start with the correct x, y, etc. After the simulation has finished (but before the array is "cleaned up") the data has been altered significantly. 0 is changed to -1.06e6 for example! This could be a conversion error in ToStandardForm().

Initially opened on 20 September 2016

tvarnish commented 6 years ago

I haven't yet implemented rounding, support for numbers 0 < n < 1, and negative numbers. The negative number issue may be the source of the error.

Initially commented on 20 September 2016

tvarnish commented 6 years ago

As the program is still technically "working" through the problem when the data is saved, it shouldn't round the output values. This will hopefully simplify the problem.

Initially commented on 21 September 2016

tvarnish commented 6 years ago

Support has now been added for numbers 0 < n < 1 and negative numbers. Rounding has been removed. "Errors" are still occurring, although it now seems to be when loading the values into instances of bodies.

Initially commented on 21 September 2016

tvarnish commented 6 years ago

So far, I have realised that I had forgotten to save the position values in AU (for example). I have now corrected this, but the problem still exists. Perhaps there is an offset problem (related to pixels)? It should maybe save positions in metres, just to keep things simple.

Initially commented on 27 September 2016

tvarnish commented 6 years ago

Removing units (i.e. now using metres) has solved the problem! Once multiple .mp4 files have been generated, use the following command to concatenate them. MP4Box -cat file1.mp4 -cat file2.mp4 -new mergedFile.mp4

Initially commented and closed on 28 September 2016