Commit 6a7bb75e authored by Erik Strand's avatar Erik Strand

Document initial diff sim stable orbit study

parent 2740192e
......@@ -64,9 +64,9 @@ void GlutGrapher::display() const {
void GlutGrapher::idle() {
bool const wait_to_start = false;
if (wait_to_start && frame_ == 0) {
std::cout << "Press enter to start a 20 second countdown" << std::endl;
std::cout << "Press enter to start a 10 second countdown" << std::endl;
do {} while (std::cin.get() != '\n');
for (uint32_t i = 20; i > 0; --i) {
for (uint32_t i = 10; i > 0; --i) {
std::cout << i << "... " << std::flush;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
......
......@@ -80,3 +80,19 @@ particular particle.
$$
a_i = \sum_{j \neq i} G m_j \frac{x_j - x_i}{|x_j - x_i|^3}
$$
To start, let's consider two particles. I'll make one 100 times heavier than the other, and our goal
will be to find a stable circular orbit by varying the initial velocity of the satellite. As a
baseline, here's a really bad trajectory, in which the satellite gains escape velocity and doesn't
end up orbiting at all.
<video width="480" height="320" controls="controls" muted plays-inline>
<source type="video/mp4" src="../assets/mp4/diffsim_bad_orbit.mp4">
</video>
Differentiating through the simulation makes it very easy to find the desired solution. This orbit
was found by gradient descent, but Nelder Mead finds the same optimum.
<video width="480" height="320" controls="controls" muted plays-inline>
<source type="video/mp4" src="../assets/mp4/diffsim_good_orbit.mp4">
</video>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment