Fitting 3D data to a Parabola

In summary: I'm sorry if this is too basic, but do you know where I could find more in-depth information about fitting a plane to my points?In summary, Homework Equations, linear regression, understanding the orientation of the curve needed for accurate results.
  • #1
lebronlin
8
0

Homework Statement



I'm trying to go about fitting some (x,y,z) coordinate data that I got out of a simulation to a parabola, but I'm not entirely sure how. Is there a general equation for a parabola that instead of having usual (x,y) coordinates has (x,y,z) coordinates?

Homework Equations


The Attempt at a Solution



I know how to create a system of equations for fitting (x,y) coordinate data to a parabola and using matrices to solve for the coefficients for the quadratic equation for the parabola that fits those points, but I have no clue on how to apply it to (x,y,z) data. I'm thinking that there may be calculus involved?
Just looking for some insight. Thanks!
 
Physics news on Phys.org
  • #2
hi lebronlin

do you want to fit a curve or a surface? you could do both using least squares regression.

a quadratic surface would be of the form
[tex]a.x^2+b.y^2+c.z^2+d.xy+g.yz+h.zx +i.x+j.y+k.z+l=0 [/tex]
 
  • #3
alternatively you could put it in matrix form
[tex]\textbf{x}^TA\textbf{x}=c [/tex]
 
  • #4
thanks for the reply, but I would like to fit the data to a curve
 
  • #5
ok, what is the form of the curve?

also any other info about the problem may help - if you know anything about specific directions it may make it easier to fit..

there's a few different way to represent a parabola in 3D, one is as a conic section
http://en.wikipedia.org/wiki/Conic_section
 
  • #6
I'm trying to write code to automatically fit positional data during a specific time frame of orbit for a body to a parabolic curve, so I don't think a conic section could fit my positional data
 
  • #7
a parabola is a conic section... but i understand they may not be the best tool here

if its a constant gravity problem, then you know the parabola will be in a vertical plane, I would first regress to find the plane in which all the points lie, then the optimum parabola within that plane

in fact this may be a good idea even if it is not a constant gravity problem

the key will be trying to stick to linear regression, as soon as you get into non-linear regression... not 100% but i think this will be the case when you know the orientation of the parabola (eg vertical, horizontal) but may get difficult if you don't know whether it is vertical, horizontal etc.
 
  • #8
Oops sorry then! Some more specifics about my problem: I'm launching a small body( with initial x,y, and z velocities) towards a much larger body, when the smaller body gets close to the larger body I'm treating its path during its closest encounter as a parabola and trying to fit the points of closest encounter to a parabola so that I may calculate the true minimum distance of encounter. I'm repeating this for many small bodies but with different initial positions and velocities, so I don't think in all situations the points of closest encounter would lie on a single plane, but I may be wrong :p

The points I'm using to fit to the parabola are the positions before, during, and after the closest encounter in my data. ( 3 points)Could you give me a few hints as to how to project my points onto a single plane so that I can fit them to a parabola?

Thanks!
 
Last edited:
  • #9
if this is a 2 body problem (preferably a single body problem with infinitesimal test mass), then pick the plane with that contains the test mass, main body and the initial velocity vector. As there are no forces outside that plane, the motion will remain planar, hence why you can fit a parabola which is a planar curve
 
  • #10
I got home today and was able to pull up some of the data from one trial I generated. Here are three points of the small body (before, at, and after the closest approach that I could see) (I translated its position to be relative to the main body)

(-0.000461,0.003841, -0.001400)
(0.000766, -0.002610, -0.001256)
(0.005331, -0.015542, -0.011193)

Could you give me an example of the process with these points?

Thanks for helping me out so much so far! :)
 
  • #11
ok, so i would first try and fit a plane to the motion, as there are only 3 points you could do this analytically (compute 2 difference vectors and you're pretty much there)

otherwise
ax+by+cz=d

then do linear regression to find a,b,c,d
 
  • #12
If its too long of an explanation, do you know where I could find good information about fitting a plane to my points? (I used google but couldn't find many good sources) I'm in high school and my math knowledge goes up to Calc BC, so I don't have much experience in 3-dimensional space
 
  • #13
do you have lots of points or just 3?

if its only 3 its quite easy to do and you only really need some vector addition (dot products and cross products would help but not necessary)

to understand the math behind linear regression you need some reasonable grip on matrix (linear algebra) and multivariate calculus...

however though its helps to understand the math (and you will have less chance of getting errors), its not required and it is pretty easy to implement in excel with the LINEST function
 
  • #14
I have a lot of other points, but these three are the only ones that are required to fit the parabola. Thanks for helping me out so far!
 
  • #15
ok so do you understand what a plane is and how to find the equation of one?
 
  • #16
I understand what a plane is, but not really how to find the equation of a specific one.

Thanks!
 
  • #17
I don't think three points is enough to determine a parabola even if you know what plane it is in. You need more information to determine its orientation. For example, take an equilateral triangle. You can make a parabola with any of the three vertices of the triangle as its vertex and passing through the other two vertices of the triangle. And I think there are a lot more than three parabolas that can be drawn through the three vertices of the triangle.
 
  • #18
lebronlin said:

Homework Statement



I'm trying to go about fitting some (x,y,z) coordinate data that I got out of a simulation to a parabola, but I'm not entirely sure how. Is there a general equation for a parabola that instead of having usual (x,y) coordinates has (x,y,z) coordinates?

Homework Equations





The Attempt at a Solution



I know how to create a system of equations for fitting (x,y) coordinate data to a parabola and using matrices to solve for the coefficients for the quadratic equation for the parabola that fits those points, but I have no clue on how to apply it to (x,y,z) data.


I'm thinking that there may be calculus involved?
Just looking for some insight. Thanks!

So, if I understand correctly, you have some data (x_i,y_i,z_i), for i = 1,2,...,n and you want to fit a quadratic curve (x,y,z) = (a1,a2,a3) + (b1,b2,b3)*t + (c1,c2,c3)*t^2 to the data. (Here, t is just a parameter that measures where we are on the curve; it is not necessarily time.) Assuming the data do not lie *exactly* on a quadratic curve, you need to specify some measure of goodness of the fit: what makes one fit better than another? A common criterion is a least-squares measure, where we take the sum of the squared deviations and try to minimize that by choosing appropriate values of the ai, bi and ci. However, in your case you need to worry about what a "deviation" actually is. The most natural measure of the deviation of a point (x_i,y_i,z_i) from the curve is the closest distance from that point to the curve, so we need to find the value of 't' that makes the point (x(t),y(t),z(t)) as close as possible to (x_i,y_i,z_i). Equivalently, we can minimize the squared distance, and doing that requires solution of a cubic equation in t with coefficients that involve the ai, bi, ci as well as x_i, y_i, z_i. You need to plug in the solution of the cubic back into the distance^2 formula to determine the contribution of the ith point to the total squared error. Then you need to sum over all i from 1 to n. The result will be a truly horrible function of the ai, bi and ci, which you would like to minimize. Good luck with that.

RGV
 
  • #19
well the simplest way is
ax + by + cz=d

each set of points if it lies on the plane must satisfy that equation

you can further simplify if d is nonzero (may need to check this case... do you expect the plane to pass thorough the origin)
(a/d)x + (b/d)y + (c/d)z=1
Ax + By + Cz=1

if you have 3 points you can write 3 equations, and solve for A,B,C simultaneously

as mentioned this is a bit easier if you know vectors and matricies
 

1. What is the purpose of fitting 3D data to a parabola?

Fitting 3D data to a parabola allows us to accurately represent and analyze a set of data points in a three-dimensional space. This can help us identify patterns and relationships within the data and make predictions or projections based on the parabolic curve.

2. How is 3D data fitted to a parabola?

The process of fitting 3D data to a parabola involves finding the best-fit parabola that passes through the given data points. This is done by using mathematical methods such as least squares regression to minimize the distance between the data points and the parabola.

3. What are the advantages of using a parabola to fit 3D data?

Using a parabola to fit 3D data can provide a simple and intuitive representation of the data. It allows us to visualize the data in a two-dimensional graph and easily identify any trends or patterns. Additionally, a parabola can accurately fit a wide range of data sets and is relatively easy to calculate.

4. Are there any limitations to fitting 3D data to a parabola?

While a parabola can accurately fit many types of data, it may not be the best choice for all data sets. In some cases, a parabola may not be able to accurately represent the data and alternative methods, such as fitting to a different curve, may be more appropriate.

5. How can I determine if a parabola is the best fit for my 3D data?

There are various metrics and tests that can be used to determine the goodness of fit for a parabola. These include measures such as the coefficient of determination (R-squared) and visual inspection of the data plot. It is also important to consider the nature of the data and whether a parabola is a suitable model for the underlying relationship.

Similar threads

  • Calculus and Beyond Homework Help
Replies
7
Views
663
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
3K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
10
Views
2K
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
4
Views
1K
  • STEM Educators and Teaching
Replies
5
Views
546
Back
Top