5
$\begingroup$

After my last question I have worked through the math quite a bit and now I'm stuck again. This time my question is less wordy.

I have two equations for $t$, one with respect to each $a_{x}$ and $a_{y}$: \begin{align*} t&=\frac{-2(u_{x}^{A}-v_{x}^{B})\pm\sqrt{4(u_{x}^{A}-v_{x}^{B})^{2}-8a_{x}(c_{x}^{A}-c_{x}^{B})}}{2a_{x}}\\\ t&=\frac{-2(u_{y}^{A}-v_{y}^{B})\pm\sqrt{4(u_{y}^{A}-v_{y}^{B})^{2}-8a_{y}(c_{y}^{A}-c_{y}^{B})}}{2a_{y}} \end{align*}

Additionally $a_{x}$ can be specified as an inequality in terms of $a_{y}$: $a_{x}\leq\sqrt{a_{max}^{2}-a_{y}^{2}}$

All the variables except $t$, $a_{x}$ and $a_{y}$ are constants. How can I find a function to yield the values for $a_{x}$ and $a_{y}$ that give the lowest value for $t$?

EDIT: and this is how I arrived there:

$s_{x}^{A}, s_{y}^{A}, s_{x}^{B}, s_{y}^{B}$ : Functions for position of particles A and B on the x and y axis

$t$ : Time elapsed

$a_{x}^{A}, a_{y}^{A}$ : Acceleration of A on each axis

$a_{max}$ : Maximum magnitude of acceleration of A

$c_{x}^{A}, c_{y}^{A}, c_{x}^{B}, c_{y}^{B}$: Starting positions of A and B (constant)

$u_{x}^{A}, u_{y}^{A}$ - Starting velocity of A (constant)

$v_{x}^{B}, v_{y}^{B}$ - Velocity of B (constant)

$s^{A}=u^{A}t + \frac{a^{A}t^{2}}{2} + c^{A}$ : Function for position of A in terms of time and acceleration on one axis

$s^{B}=v^{B}t + c^{B}$ : Formula for position of B in terms of time on one axis

$a_{y}^{A}\le \sqrt{a_{max}^{2} - {a_{x}^{A}}^{2}}$ : Inequality yielding maximum acceleration on one axis in terms of acceleration on another

Optimize for t where $s^{A}=s^{B}$ on both axis: \begin{align*} s^{A}&=s^{B}\\\ u^{A}t + a^{A}t2/2 + c^{A} &= v^{B}t + c^{B}\\\ u^{A}t + a^{A}t2/2 - v^{B}t &= c^{B} - c^{A}\\\ 2u^{A}t + a^{A}t2 - 2v^{B}t &= 2c^{B} - 2c^{A}\\\ a^{A}t2 + 2t(u^{A}-v^{B}) + (2c^{A}-2c^{B}) &= 0 \end{align*} \begin{align*} t&=\frac{-2(u^{A}-v^{B})\pm\sqrt{4(u^{A}-v^{B})^{2}-8a(c^{A}-c^{B})}}{2a}&&\mbox{(quadratic formula)}\\\ t&=\frac{-2(u_{x}^{A}-v_{x}^{B})\pm\sqrt{4(u_{x}^{A}-v_{x}^{B})^{2}-8a_{x}(c_{x}^{A}-c_{x}^{B})}}{2a_{x}} &&\mbox{For X}\\\ t&=\frac{-2(u_{y}^{A}-v_{y}^{B})\pm\sqrt{4(u_{y}^{A}-v_{y}^{B})^{2}-8a_{y}(c_{y}^{A}-c_{y}^{B})}}{2a_{y}}&&\mbox{For Y} \end{align*}

By my questionable reasoning these functions for $t$ should give how long it will take to reach the target for a given acceleration. The two values for acceleration could be plotted on the X and Z axis in a 3D space, with $t$ on the Y axis. The constraints to maximum acceleration would reduce the function to a circular disc. The points where the acceleration would never reach the target will be undefined or infinite or something. The lowest positive point on the 'disc' on the Y axis is a point where there is a valid combination of accelerations in each direction to reach the target, and should be the fastest.

Have I gone wrong somewhere?

EDIT 2: It would be really super great if someone could point me in the right direction to learn about optimisation in 3D. Even if you think I'm approaching the problem presented in my other question wrong, I'd still like to know how to do it, which is why I phrased this question the way I did.

  • 0
    If I choose the $+$ branch on the first equation, do I also have to chose the $+$ branch in the second one?2011-03-10
  • 0
    And what is $a_\text{max}$? And how you make sure that $t$ does not become a complex number (if the term inside the sqrt becomes negative)?2011-03-10
  • 0
    In the context of the original problem $a_{max}$ is the maximum acceleration of $A$. Consider it a constant. I don't know the answer to your other questions, I'm really just stumbling through here trying to learn as I go. I guess where $t$ yields a complex number it is not a valid solution. I suspect this happens when the acceleration is in the wrong direction.2011-03-10
  • 0
    I read through the old post. I think it would be helpful, if you would add some sentences about the problem you are solving and what the different parameters in your equations mean in terms of this problem. I guess $a$ are acceleration, $v$ velocity, $t$ time. But what is $c$?2011-03-10
  • 0
    Also not knowing what sign of the branch you chose, tells that you already don't understand something in the equations. So it would be good to sketch the approach how you obtain the equations (with which equations do you start?).2011-03-10
  • 0
    $c$ is starting position. You're absolutely right, I don't really understand my own equations, but I think I've arrived at them properly. I'll type up how I got to them shortly. I don't really understand why it's important to know what the constants 'mean'. My approach was simple though: start with an equation for the position of each particle on each axis ($s_{A}=u_{A}t+\frac{at^{2}}{2}+c_{A}$ and $s_{B}=v_{B}t+c_{B}$), put $s_{A}=s_{B}$ which turns out to be a quadratic, rearrange in terms of $t$ using the quadratic equation, scratch head, wonder what next.2011-03-10
  • 0
    Understanding what formulas mean often help with the solution. I understand now everything and try to post an answer shortly (if I can solve the problem).2011-03-10
  • 0
    Did you give up the the maximal allowed speed now?2011-03-10
  • 0
    I didn't give it up, I just don't think it enters into this specific question - the speed can be limited 'externally' so to speak: that is, the acceleration yielded by the function will be applied to the particle's speed, and if the resulting speed is above the maximum it will be scaled back without affecting the direction. Thus the capacity to change direction is unaffected and, I think, given the acceleration function is calculated continuously, this is optimal behaviour and there is no need to build a maximum velocity into this particular solution.2011-03-10

1 Answers 1

1

It is very simple to convince yourself (at least intuitively, but also a proof can be given if necessary) that in order to have the time $t$ as small as possible, it is best to have the largest acceleration possible. Thereby, $a_x^2+a_y^2=a_\text{max}^2$. The equations which should be fulfilled are given by $$\frac{a_x t^2}{2} + v^A_x t+ c^A_x = v^B_x t+ c^B_x \qquad \frac{a_y t^2}{2} + v^A_y t+ c^A_y = t v^B_y + c^B_y.$$ Replacing $a_y$ by $a_y = \sqrt{a_\text{max}^2 - a_x^2}$, we obtain $$\frac{\sqrt{a_\text{max}^2 - a_x^2} t^2}{2} + v^A_y t+ c^A_y = t v^B_y + c^B_y.$$ Solving the first equation for $a_x$, and plugging everything the result into the second equation yields $$\frac{\sqrt{a_\text{max}^2 - \left[\frac{2 (c^A_x- c^B_x +t (v^A_x -v^B_x)}{t} \right]^2} t^2}{2} + v^A_y t+ c^A_y = v^B_y t + c^B_y.$$

After some manipulations the last equation can be brought into the form $$\begin{multline} \frac{a_\text{max}^2}{4} t^4 + [(v^A_y- v^B_y)^2 - (v^A_x- v^B_x)^2] t^2 - 2[(c^A_x - c^B_x)(v^A_x - v^B_x)+ (c^A_y - c^B_y)(v^A_y - v^B_y)] t\\ -(c^A_x -c^B_x)^2 - (c^A_y -c^B_y)^2 =0. \end{multline}$$ Solving this equation for $t$ gives the optimal (minimal) time required. Note however that this is a quartic equation such that the solution becomes quite messy and that is why I will not write it down here.

  • 0
    This seems quite a bit more complicated than my suggested solution, which admittedly may be wrong. Before I get into expanding quartic equations can you identify what's wrong with mine? I've added how I arrived at the optimisation question to the original post.2011-03-10
  • 0
    I think it is the same. Finding the lowest point on the disk should be equivalent to solving this equation.2011-03-10
  • 0
    Interesting. I'll experiment with it a bit and see if that works. Thanks.2011-03-10
  • 0
    There should be a $t^{2}$ on the denominator of your rearrangement of the first equation. I imagine this will change your final formula significantly. Your substitutions don't seem right to me - imagine for some impossible value of $t$, $a_{x}$ is calculated from your first equation to be above the limit, such that the proportionate $a_{y}$ you calculate from it in your first substitution is imaginary. The next thing you do is square it, so now you can get real answers coming from impossible values of t! I don't know what the values of t this equation produces would mean at all.2011-03-11