1
$\begingroup$

Recall "gravitational"-type force functions, by which I mean anything of the form:

$f(x,y,z) = \frac{k}{((x-x_0)^2+(y-y_0)^2+(z-z_0)^2)^p}, p\in\Re_{>0}, k\in\Re, (x,y,z) \neq(x_0,y_0,z_0)$
(e.g., for gravity, $p=1,k=G m_1 m_2$)

Define a function $g(x,y,z) = f_1(x,y,z) + f_2(x,y,z) + f_3(x,y,z) +\cdots+f_n(x,y,z)$ (a sum of several force functions, presumably each with different $k$ (though probably not $p$).

I have two points $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$ such that $g(x_1,y_1,z_1) and $g(x_2,y_2,z_2)>a$. My problem is to find the location $(x_3,y_3,z_3)$ such that $g(x_3,y_3,z_3)=a$ where $(x_3,y_3,z_3)$ lies on the straight line between $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$. If it helps, I know that exactly two of the xs, ys, and zs are equal.

I'm currently solving this numerically, but it will eventually be solved on an OpenCL kernel where I would very much like a closed form solution.

However, I am having trouble getting such a solution. I'm not even sure it's possible. I tried inverting $g$, but got basically nowhere. Ideas? Thanks.

  • 0
    The usual gravitational potential is actually $p = \frac12$ in your formulation, because your denominator represents the *square* of the distance between the two points.2012-06-16
  • 0
    In any case, I doubt there will be a closed-form solution for general $p$. Nonlinear equations usually can't be solved analytically.2012-06-16
  • 0
    Nope should be 1 :-) It's over r^2, but in calulating r I'm using the Pythagorean theorem, which has a square root, so the 1/2 and 2 powers cancel. Anyway, I figured it would be unsolvable, but I wanted to check just in case. It should be easy to solve if you have only one term, but of course I have several . . .2012-06-16
  • 0
    The magnitude of the [gravitational *force*](https://en.wikipedia.org/wiki/Newton%27s_law_of_universal_gravitation) is proportional to $1/r^2$. The corresponding *[potential](https://en.wikipedia.org/wiki/Gravitational_potential)*, which the force is a derivative of, is proportional to $1/r$.2012-06-16
  • 0
    Ackkk that's what I meant (you probably mean the derivative the other way). I've edited the question. Thanks!2012-06-16
  • 0
    (1) No, I didn't. The force is proportional to the derivative of the potential. $-1/r^2$ is the derivative of $1/r$. (2) You probably shouldn't call what you're computing a force. A force is a vector, not a scalar; in that context, what you're doing is adding up the magnitudes of the forces, which doesn't correspond to anything meaningful in terms of the forces themselves.2012-06-16
  • 0
    (1) You're right. I looked at it again, and I switched it around in my head too many times. This is what I get for coding so late. (2) I suppose. "Scalar field" then?2012-06-16
  • 0
    The original word "potential" was fine; potentials are usually scalar fields. You can just either say that for gravity, $p=\frac12$, or change the exponent in the equation to $p/2$. If you don't want to do either for whatever reason, well, it doesn't really matter.2012-06-16

1 Answers 1

1

Let us consider an extremely simplified version of the problem: $p=1$ and just two terms centered at $(0,\bar y_1,0)$ and $(\bar x_2,\bar y_2,0)$, with the line on which the unknown point lies being $y_1 = y_2 = 0$ and $z_1 = z_2 = 0$. Then you want to solve the equation $$\frac{k_1}{x^2+\bar y_1^2} + \frac{k_2}{(x-\bar x_2)^2+\bar y_2^2} = a,$$ which expands to the fourth-degree polynomial equation in $x$, $$k_1\big((x-\bar x_2)^2+\bar y_2^2\big) + k_2\big(x^2+\bar y_1^2\big) = a\big(x^2+\bar y_1^2\big)\big((x-\bar x_2)^2+\bar y_2^2\big).$$ Mathematica finds an analytical solution that I cannot reproduce here because its $\LaTeX$ code has 11887 characters in it. If you have more than two terms, of course, you'll get a polynomial equation of degree greater than five, and those are known to have no analytical solutions in general.

  • 0
    Okay. I'll take this to mean that there probably isn't an analytical solution for the general case. I'll just keep using an L1 or L2 approximation. Thanks for the help (and putting up with my mistakes)!2012-06-16