1
$\begingroup$

I have a curve defined by an equation: $y = f(x)$

In my case, the equation is a polynomial $y = ax^3 + bx^2 + cx + d$.

I also have $2$ boundary conditions. Point $A$ and Point $B$. I know the velocity and position of $A$ and $B$ and I know the time taken to travel from $A$ to $B$ along the curve. With some simple calculus I have been able to the determine the variables, $a$, $b$, $c$, $d$. This means I know $\dfrac{\dot{y}}{\dot{x}}= f'(x)$ and $y=f(x)$.

What I really want to know is position and velocity as a function on time: \begin{align*} \dot{x} &= v_x(t) \\ \dot{y} &= v_y(t) \\ x &= x(t) \\ y &= f(x(t)) \end{align*}

How would I determine this for either my polynomial or for an equation $y=f(x)$?

  • 0
    What properties of $A$ and $B$ is known? velocity, . .2017-01-19
  • 0
    Yes, we know the position and velocity at both points $A$ and $B$. We also know the time taken to travel from $A$ to $B$2017-01-20

1 Answers 1

1

Using cubic spline:

\begin{align*} p(x) &= \frac{x-b}{a-b}f(a)+\frac{x-a}{b-a}f(b) \\ & \quad + (x-a)(x-b)\left \{ \frac{x-b}{(a-b)^{2}} \left[ f'(a)-\frac{f(a)-f(b)}{a-b} \right]+ \frac{x-a}{(b-a)^{2}} \left[ f'(b)-\frac{f(b)-f(a)}{b-a} \right] \right \} \\[5pt] p'(x) &= \frac{x-b}{a-b}f'(a)+\frac{x-a}{b-a}f'(b)+ 3(x-a)(x-b)\left \{ \frac{f'(a)+f'(b)}{(b-a)^2}-\frac{2[f(b)-f(a)]}{(b-a)^3} \right \} \end{align*}

Note that $p(x) \equiv f(x)$ if $f(x)$ is a cubic (or lower) polynomial, else $p(x)$ is just an interpolating polynomial.

Boundary conditions:

  • $A=\begin{pmatrix} a \\ f(a) \end{pmatrix}$

  • $B=\begin{pmatrix} b \\ f(b) \end{pmatrix}$

  • $\boldsymbol{v}_A=\dfrac{v_A}{\sqrt{1+f'(a)^2}} \begin{pmatrix} 1 \\ f'(a) \end{pmatrix}$

  • $\boldsymbol{v}_B=\dfrac{v_B}{\sqrt{1+f'(b)^2}} \begin{pmatrix} 1 \\ f'(b) \end{pmatrix}$

where $y$ is a single-valued function of $x$.

Caution: $a$, $b$ here are NOT the coefficients of the cubic polynomial but two distinct boundaries.

In general for space curve, \begin{align*} \boldsymbol{p}(t) &= \frac{t-b}{a-b}\boldsymbol{x}(a)+\frac{t-a}{b-a}\boldsymbol{x}(b) \\ & \quad + (t-a)(t-b) \left \{ \frac{t-b}{(a-b)^{2}} \left[ \boldsymbol{x}'(a)-\frac{\boldsymbol{x}(a)-\boldsymbol{x}(b)}{a-b} \right]+ \frac{t-a}{(b-a)^{2}} \left[ \boldsymbol{x}'(b)-\frac{\boldsymbol{x}(b)-\boldsymbol{x}(a)}{b-a} \right] \right \} \end{align*}

  • 0
    I assume you are using the same cublic spline equation i described above. Why is the solution independent of variables $c$ and $d$? How do I use this solution to find $\dot{x}$ and $\dot{y}$?2017-01-19
  • 0
    Sorry for ambiguity, regard $a$ and $b$ as $x_1$ and $x_2$. Answer updated.2017-01-19
  • 0
    Great - that has cleared it up a lot. You are an absolute champion. I think one final question. The final equation returns $p(t)$. The position should be defined by both an $x$ and $y$ coordinate. What exactly is $p(t)$ and how can be used to give $x$ and $y$?2017-01-20
  • 0
    Just repeat the procedure component by component: $$\boldsymbol{p}(t)=\begin{pmatrix} p_x(t) \\ p_y(t) \\ p_z(t) \end{pmatrix}$$ $$\boldsymbol{x}(t)=\begin{pmatrix} x(t) \\ y(t) \\ z(t) \end{pmatrix}$$2017-01-20