Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Sgeo/213a45eb90bb4507317cb4315279ce6a to your computer and use it in GitHub Desktop.

Select an option

Save Sgeo/213a45eb90bb4507317cb4315279ce6a to your computer and use it in GitHub Desktop.

Revisions

  1. Sgeo created this gist Jun 2, 2023.
    27 changes: 27 additions & 0 deletions gravityaction_differential_equation_derivation.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    r(t)^2 = x(t)^2 + y(t)^2 + z(t)^2

    x(t+h) = x(t) + h * f(t) * -x(t) / r(t)^2
    y(t+h) = y(t) + h * f(t) * -y(t) / r(t)^2
    z(t+h) = z(t) + h * f(t) * -z(t) / r(t)^2


    x(t+h) - x(t) = h * f(t) * -x(t)/r(t)^2

    x'(t) = -f(t)x(t)/r(t)^2

    r(t+h)^2 = [x(t)+h*f(t)*-x(t)/r(t)^2]^2 + [y(t)+h*f(t)*-y(t)/r(t)^2]^2 + [z(t)+h*f(t)*-z(t)/r(t)^2]^2
    https://www.wolframalpha.com/input?i=%5Bx%28t%29%2Bh*f%28t%29*-x%28t%29%2Fr%28t%29%5E2%5D%5E2
    r(t+h)^2 = (h^2*f(t)^2*x(t)^2)/r(t)^4 - (2*h*f(t)*x(t)^2)/r(t)^2 + x(t)^2 + ...
    r(t+h)^2 - r(t)^2 = (h^2*f(t)^2*x(t)^2)/r(t)^4 - (2*h*f(t)*x(t)^2)/r(t)^2 + ... (no x(t)^2+y(t)^2+z(t)^2)

    (r(t+h)^2 - r(t)^2)/h = h*2*f(t)^2*x(t)^2/r(t)^r - 2*f(t)*x(t)^2/r(t)^2 + ...

    lim h->0

    (d/dt)(r(t)^2) = -2*f(t)*x(t)^2/r(t)^2 - 2*f(t)*y(t)^2/r(t)^2 - 2*f(t)*z(t)^2/r(t)^2

    r'(t) = -f(t)x(t)^2/r(t)^3 - f(t)y(t)^2/r(t)^3 - f(t)z(t)^2/r(t)^3

    r'(t) = [-f(t)/r(t)^3][x(t)^2 + y(t)^2 + z(t)^2] = [-f(t)/r(t)^3][r(t)^2] = -f(t)/r(t)

    r'(t) = -f(t)/r(t)