Method of least square: initial position & velocity

In summary, the point is moving linearly with constant velocity and the movement is x=a+vt. The method of least square is used to find the initial position and velocity.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

A point is moving linearly with constant velocity $v$ and the movement is $x=a+vt$.
The below information is given:

View attachment 9678

Find the initial position $a$ and the velocity using the method of least square. Could you give me a hint how we use this method here? Couldn't we use the data of the matrix and get a $2\times 2$ linear system? (Wondering)
 

Attachments

  • a_v.JPG
    a_v.JPG
    4.5 KB · Views: 100
Physics news on Phys.org
  • #2
mathmari said:
A point is moving linearly with constant velocity $v$ and the movement is $x=a+vt$.
The below information is given:

Find the initial position $a$ and the velocity using the method of least square.

Could you give me a hint how we use this method here?

Hey mathmari!

The method of least squares is that we minimize the sum of the squared deviations $\sum\limits_{i=1}^n (x_i - x(t_i))^2$, isn't it? (Wondering)

We should be able to find formulas for it somewhere, either in matrix form or in formula form.
Or we can derive those formulas ourselves.
Or we can use a tool like Excel to do it for us. (Thinking)

mathmari said:
Couldn't we use the data of the matrix and get a $2\times 2$ linear system?

Which $2\times 2$ linear system do you mean? (Wondering)
 
  • #3
Klaas van Aarsen said:
The method of least squares is that we minimize the sum of the squared deviations $\sum\limits_{i=1}^n (x_i - x(t_i))^2$, isn't it? (Wondering)

We should be able to find formulas for it somewhere, either in matrix form or in formula form.
Or we can derive those formulas ourselves.
Or we can use a tool like Excel to do it for us. (Thinking)

Ah I think now I have an idea how we have to apply the method in this case.

From the matrix we have the exact values of $x_i$'s and from the formula of the movement we get an approximation $x(t_i)$, or not?

So we get \begin{align*}\sum\limits_{i=1}^5 (x_i - x(t_i))^2&=(x_1 - x(t_1))^2+(x_2 - x(t_2))^2+(x_3 - x(t_3))^2+(x_4 - x(t_4))^2+(x_5 - x(t_5))^2 \\ & =(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2\end{align*}

(Wondering)
 
  • #4
What do you mean by "the initial position"? I would think that would be x(0) but the table itself tells you that x(0)= 1. There is no calculation at all required for that!
 
  • #5
mathmari said:
Ah I think now I have an idea how we have to apply the method in this case.

From the matrix we have the exact values of $x_i$'s and from the formula of the movement we get an approximation $x(t_i)$, or not?

So we get \begin{align*}\sum\limits_{i=1}^5 (x_i - x(t_i))^2&=(x_1 - x(t_1))^2+(x_2 - x(t_2))^2+(x_3 - x(t_3))^2+(x_4 - x(t_4))^2+(x_5 - x(t_5))^2 \\ & =(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2\end{align*}

Yep.
We can minimize that with respect to $a$ and $v$ can't we? (Wondering)

HallsofIvy said:
What do you mean by "the initial position"? I would think that would be x(0) but the table itself tells you that x(0)= 1. There is no calculation at all required for that!

The value of $x(0)$ given in the table is a measurement.
The approximation of $a$ is the approximation of $x(0)$ based on a linear least square interpolation.
The question asks for $a$, which should be a more accurate version of the position at time $t=0$.
 
  • #6
Klaas van Aarsen said:
Yep.
We can minimize that with respect to $a$ and $v$ can't we? (Wondering)

For that we use the gradient, don't we? (Wondering)

\begin{align*}S(a,v)=&(-11 - [a-2v])^2+(-5 - [a-v])^2+(1 - a)^2+(5 - [a+v])^2+(10 - [a+2v])^2 \\ =&11^2 +22[a-2v]+ [a-2v]^2+5^2 +10[a-v]+ [a-v]^2+1 -2a+ a^2+5^2 -10[a+v]+ [a+v]^2\\ & +10^2 -20[a+2v]+ [a+2v]^2 \\ =&121 +22a-44v+ a^2-4av+4v^2+25 +10a-10v+ a^2-2av+v^2+1 -2a+ a^2\\ &+25 -10a-10v+ a^2+2av+v^2+100 -20a-40v+ a^2+4av+4v^2 \\ =& 5a^2+10v^2-104v+272 \end{align*}

The partial derivatives are:
\begin{align*} & \frac{\partial{S}}{\partial{a}}= 10a \\ & \frac{\partial{S}}{\partial{v}} = 20v-104 \end{align*}

We set these partial derivatives equal to zero and we get \begin{align*} & \frac{\partial{S}}{\partial{a}}= 0 \Rightarrow 10a=0 \Rightarrow a=0 \\ & \frac{\partial{S}}{\partial{v}} = 0 \Rightarrow 20v-104=0 \Rightarrow v=\frac{104}{20} \Rightarrow v=5.2 \end{align*} Is everything correct? (Wondering)
 
  • #7
mathmari said:
We set these partial derivatives equal to zero and we get \begin{align*} & \frac{\partial{S}}{\partial{a}}= 0 \Rightarrow 10a=0 \Rightarrow a=0 \\ & \frac{\partial{S}}{\partial{v}} = 0 \Rightarrow 20v-104=0 \Rightarrow v=\frac{104}{20} \Rightarrow v=5.2 \end{align*} Is everything correct?

The answer is correct so I think the intermediate steps are correct as well. (Nod)
 
  • #8
Klaas van Aarsen said:
The answer is correct so I think the intermediate steps are correct as well. (Nod)

How did you get the correct answer? Is there also an other method we can use? Or is there an online tool? (Wondering)
 
  • #9
mathmari said:
How did you get the correct answer? Is there also an other method we can use? Or is there an online tool?

I entered the data in Excel and used the [M]LINEST[/M] array function to get the result. (Thinking)

View attachment 9682
 

Attachments

  • linest.jpg
    linest.jpg
    11.2 KB · Views: 87
  • #10
Klaas van Aarsen said:
I entered the data in Excel and used the [M]LINEST[/M] array function to get the result. (Thinking)

Ahh! Interesting! Thank you! (Yes)(Malthe)
 

FAQ: Method of least square: initial position & velocity

1. What is the Method of Least Squares?

The Method of Least Squares is a mathematical technique used to find the best fit line or curve for a set of data points. It minimizes the sum of the squared differences between the actual data points and the predicted values from the line or curve.

2. How is the initial position and velocity calculated using the Method of Least Squares?

The initial position and velocity can be calculated by using the data points and the equation of motion. The Method of Least Squares finds the line or curve that best fits the data points, and the initial position and velocity can be determined from the slope and intercept of this line or curve.

3. What is the significance of using the Method of Least Squares for initial position and velocity?

The Method of Least Squares allows for a more accurate determination of the initial position and velocity by taking into account all of the data points and minimizing the error between the predicted values and the actual data. This helps to reduce any bias or random errors in the data.

4. Can the Method of Least Squares be used for non-linear motion?

Yes, the Method of Least Squares can be used for non-linear motion. It can be used to find the best fit curve for any type of data, including non-linear data. However, the equation of motion used to calculate the initial position and velocity may be more complex for non-linear motion.

5. Are there any limitations to using the Method of Least Squares for initial position and velocity?

One limitation of the Method of Least Squares is that it assumes the data points have equal weight and that the errors are normally distributed. If this is not the case, the results may not be as accurate. Additionally, the method may not work well for highly non-linear data.

Back
Top