Skip to content

Instantly share code, notes, and snippets.

@Sgeo
Created January 28, 2020 03:43
Show Gist options
  • Save Sgeo/94ab959609ec1280fbd30933f57f7574 to your computer and use it in GitHub Desktop.
Save Sgeo/94ab959609ec1280fbd30933f57f7574 to your computer and use it in GitHub Desktop.
let x(t) = distance from dest on x
let y(t) = distance from dest on y
let z(t) = distance from dest on z
let r(t)^2 = x(t)^2 + y(t)^2 + z(t)^2
let f(t) = force
x(0) initial condition
y(0) initial condition
z(0) initial condition
f(t)
let h -> 0
x(t+h) = h * x(t) * f(t) / r(t)^2
x(t+h) - x(t) = h * x(t) * f(t) * [1 / r(t)^2]
dx =
Simplying assumption: y(t) and z(t) = 0, one-dimension case considered only
r(t) = x(t)
x(t+h) = x(t) - h * x(t) * f(t) / x(t)^2
x(t+h) = x(t) - h * f(t) / x(t)
x(t+h) - x(t) = -h * f(t) / x(t)
dx/dt = -f(t)/x(t)
@Sgeo
Copy link
Author

Sgeo commented Jan 28, 2020

x(t) = sqrt(k - bt^2 + 2ct)
x(0) = sqrt(k)

k = x(0)^2

x(t) = sqrt(x(0)^2 - bt^2 + 2ct)

sqrt(k - bt^2 + 2ct) = dt+e
k - bt^2 + 2ct = (dt+e)^2
k - bt^2 + 2ct = d^2t^2 + 2dte + e^2

0 = (d^2+b)t^2 + (2de-2c)t + e^2 - k

b = -d^2
c = de
k = e^2 = x(0)^2

Therefore, to achieve x(t) = dt+e, f(t) = -d^2t + de; f(0) = e; d must equal 1??

@Sgeo
Copy link
Author

Sgeo commented Jan 30, 2020

dx(t)/dt = -f(t)/x(t)

f(t) = bt+c
x(t) = dt+e

d = -(bt+c)/(dt+e)
d(dt+e) = -bt - c
d^2 * t + de = -bt - c

b = -d^2
c = -de

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment