1
$\begingroup$

I'd like to find a way of determining if the distance from the origin of a parametric parabolic path falls below a certain value within a given range of the parameter. The parabola is expressed as:

$$x = a_xt^2+b_xt+c_x$$ $$y = a_yt^2+b_yt+c_y$$

So I'm looking for $x^2+y^2=d^2$ for $t_1 \leq t \leq t_2$.

Obviously I can plug in the first $2$ equations into the third, solve the quartic and test if any of the four solutions for $t$ lies within the range, but I would like to see if there is a faster test for this. My idea is to formulate it as a constrained optimization problem with constraints $x^2+y^2-d^2=0$, $-t \leq t_1$ and $t \leq t_2$ but I'm not sure how to proceed. I don't need the to know the exact minimum point, just whether the distance falls below $d$ with the range.

Am I on the wrong path?

Thanks.

$\endgroup$
1
  • $\begingroup$ I don't need the to know the exact minimum point, just whether the distance falls below d with the range. In other words you want to find out if a given $4$-th degree polynomial has real roots in a given interval. I would just implement Sturm criterion for the degree that low. You should be a bit careful with how you do it but at least you do not need to rely on the minimizers to catch the true global minimum instead of a local one or to search for all roots. Just my 2 cents :-) $\endgroup$
    – fedja
    Commented May 26, 2018 at 2:11

1 Answer 1

2
$\begingroup$

I don't know whether this is faster, but here is a way to solve it as an "optimization" problem.

I first show how to formulate an optimization problem to determine the minimum distance. I then show how to instead formulate it as a feasibility problem, which may execute faster. In all cases, global optimization is used.

Minimize $x^2+y^2$ with respect to $t$ subject to $t_1 \le t \le t_2$

However, if you, only care whether the minimum distance falls below a threshold $d$, but not by how much, you can formulate the feasibility problem:

Minimize $0$ with respect to $t$, subject to $x^2+y^2 - d^2 \le 0, t_1 \le t \le t_2$. The problem will either be reported feasible or infeasible.

Here is sample YALMIP code (running under MATLAB) using the BARON global solver (free demo mode of BARON is sufficient given the small size of the problem):

t = sdpvar;
x = t^2 + t + 1;
y = 2*t^2 + t + 2;
% Minimum distance determination version
optimize(1<=t<=2,x^2+y^2,sdpsettings('solver','baron'))

which reports optimal objective value of 34, which is the minimum distance

% Feasibility version. [] is used instead of 0 for the objective, which accomplishes the same thing
optimize([1<=t<=2,x^2+y^2-33<=0],[],sdpsettings('solver','baron'))

with the result that the problem is reported infeasible. If 35 is used instead of 33, a solution is reported, i.e., the problem is feasible.

$\endgroup$
1
  • $\begingroup$ For these particular values the human brain is faster: the function is (obviously) increasing in $t$ and it takes 2 seconds to compute $x(1)^2+y(1)^2$. Try something with two local minima and see if it works then. $\endgroup$
    – fedja
    Commented May 26, 2018 at 2:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .