corrections from lee
This commit is contained in:
parent
1407bcc3d2
commit
bb92ba25c1
|
@ -19,7 +19,7 @@ So how does Kerbal Space Program do it?
|
|||
|
||||
Kepler's laws make a simplification known as the two-body problem.
|
||||
More complex systems, such as Sun-Earth-Moon or the entire Solar System can be modelled as a composition of several two-body systems, rather than the _n_-body systems they really are.
|
||||
This conveniently sidesteps the requirement to accumulate forces and therefore error over time.
|
||||
This conveniently sidesteps the requirement to use approximate forces and therefore accumulate error over time.
|
||||
The two body problem describes the motion of one body around another, or more precisely a common barycentre.
|
||||
In the case of one massive and one tiny object, the barycentre is approximately in the same position as the centre of the larger object and can therefore be ignored.
|
||||
In a two-body system, an orbit is perfectly stable and cyclical.
|
||||
|
@ -28,15 +28,15 @@ A body's position can thus be calculated directly as a function of time.
|
|||
The ability to calculate positions directly as a function of time has some extremely valuable properties.
|
||||
One of the many challenges faced in deep space exploration is the sheer duration required by such voyages - the Voyager probes were launched nearly half a century ago, and even reaching Mars takes the better part of a year.
|
||||
To be of any real use, then, interactive astrodynamic simulations need a level of time control.
|
||||
Kerbal Space Program has time warp feature, allowing players to navigate missions taking years of simulated time in an evening of real time.
|
||||
Kerbal Space Program has a time warp feature, allowing players to navigate missions taking years of simulated time in an evening of real time.
|
||||
|
||||
This would not be possible in with an iterative physics simulation, as the accuracy of the result is directly dependent on the resolution of the time step.
|
||||
This would not be possible with an iterative physics simulation, as the accuracy of the result is directly dependent on the resolution of the time step.
|
||||
Games have to produce several frames per second to both sell the illusion of motion and stay responsive, meaning each frame must be computed in a small fraction of a second.
|
||||
Depending on the platform, target frame rates can vary from as low as 30Hz, for a mobile device preserving its battery, to 120Hz and beyond for competitive or virtual reality applications.
|
||||
This means most games have about 10ms to compute each frame.
|
||||
|
||||
Processing limitations are of particular interest in games, which are severely constrained in the amount of processing they are able to complete in a single rendered frame.
|
||||
In practice, each sub-systems comprising a game has significantly less than 10ms, since it must use its budget conservatively to allow other sub-systems to use the same resources.
|
||||
In practice, each sub-system comprising a game has significantly less than 10ms, since it must use its budget conservatively to allow other sub-systems to use the same resources.
|
||||
An astrodynamics physics simulation may be allowed only a single millisecond or less in which to calculate the paths of objects, due to constraints imposed by resourcing requirements of other sub-systems.
|
||||
|
||||
Simulating physics to a high degree of accuracy with an iterative model requires high-resolution time steps.
|
||||
|
@ -68,7 +68,7 @@ With a lower number of iterations, the calculated value for _E_ is erratic and i
|
|||
|
||||
This presents a massive problem in a real-time system like a game.
|
||||
To be fit for purpose a physics simulation needs to be stable in all reasonable cases the player might encounter, so a Newton-Raphson-based approach would need to be given the resources to run as many iterations as needed to determine a suitably accurate value for _E_.
|
||||
Since the behaviour is of an exponential increase in computation as orbits become increasingly eccentric, the worst-case performance many orders of magnitude worse than the best- or even average-case performance.
|
||||
Since the behaviour is of an exponential increase in computation as orbits become increasingly eccentric, the worst-case performance is many orders of magnitude worse than the best- or even average-case performance.
|
||||
Even if the worst case could be computed accurately while maintaining the target frame rate, in the majority of cases the simulation would use but a fraction of the resources allocated to it.
|
||||
This inefficiency comes at the cost of taking resources away from other sub-systems that could do with it, impacting the quality of the whole application.
|
||||
|
||||
|
@ -122,7 +122,7 @@ Translated to pseudo-C from BASIC source.
|
|||
---
|
||||
|
||||
This approach, while obtuse and archaic, has the property of running in a predictable, constant amount of time, and computes a result to a particular level of precision determined by the number of iterations.
|
||||
On average, it performs worst than Newton-Raphson, taking more runtime to arrive at a result of similar accuracy.
|
||||
On average, it performs worse than Newton-Raphson, taking more runtime to arrive at a result of similar accuracy.
|
||||
However, in the worst-case, it performs just as well in terms of accuracy and runtime as the best-case, which makes it suitable for real-time applications in a way that Newton-Raphson is not.
|
||||
Instead of having to pad the physics budget to account for a worst-case scenario, we can make much more efficient use of a smaller budget, despite the algorithm almost always costing more.
|
||||
|
||||
|
|
Loading…
Reference in New Issue