Create 3d function with a set of points

In summary, you are asking for a program to recover the equation of a function from a set of points. The problem is that the function can be anything.
  • #1
CjStaal
7
0
I'm creating a computer program and I need to see what's most efficient. I need another program [lol] that I can input 3d points in and have it create the function.
the points are this v e t
100 500 3
300 3000 28
500 1000 3
1000 5000 45
1000 10000 330
 
Physics news on Phys.org
  • #2
Cannot be done unless you know what sort of function to expect.
 
  • #3
I can get much more points if that's what it needs. Pretty much I need to be able to put in v and e and get t out of it
 
  • #5
Off your first post - you have a bunch of data points which are from some function f(x,y,z) right? You have asked for a program to recover the equation of f(x,y,z) from the set of ordered triples {(xi,yi,zi)}. The problem is that f(x,y,z) can be anything.

Look at the simpler example in 2D ... if I have ordered pairs {(1,1),(2,1),(3,1),...} we could say that the curve is y=1 ... but it could also be y=cos(kx): k=2pi, so which is it? There are an infinite number of possible cosine curves... then there are other periodic functions ... and, in this case, there are infinite data points. If there were finite data points, then I could also fit polynomials. Then there are all the possible irregular functions, peicewise functions and on and on and on. In 3D f(x,y,z) could even loop back on itself.

Programs like MATLAB have built-in assumptions that they use to do interpolation - they do not, in general, find the equation of the generating function.
gridfit, your example, for instance, assumes the data corresponds to a surface z=f(x,y)... and makes assumptions about the nature of the surface.

For the 2D case I could use the polyfit function - but I have to also input the order of the polynomial I want to fit.
 
Last edited:
  • #6
Given any finite number of points, there exist an infinite number of functions that give those points. In fact, given n points, there exist an infinite number of polynomials of degree n that give those points.
 
  • #7
Well its more t=f(v,e)
 
  • #8
CjStaal said:
Well its more t=f(v,e)
Doesn't help.
Basing a mathematical model purely on datapoints, without reference to the underlying physics (or whatever), is an exercise in numerology. In any real environment you should have some preconception of the relationship, even if it is only smoothness and asymptotic behaviour.
In most cases, a first order approximation (over a limited range of values) will be a linear fit. Standard regression tools will allow you to get the best such fit to the data. But beware of trying to extrapolate beyond the range of datapoints unless you have information regarding asymptotes.
Beyond that, smoothness assumptions could justify the use of splines, etc. You should avoid feeding in more arbitrary constants to achieve the fit than are justified by the number of datapoints and their precision. There are standard tests for that. G--gle parameter estimation model chi-square.
 

1. What is a 3D function?

A 3D function is a mathematical representation of a 3-dimensional surface or shape. It maps input values from three variables to an output value, creating a visual representation of a three-dimensional object.

2. How do I create a 3D function with a set of points?

To create a 3D function with a set of points, you can use specialized software or programming languages like MATLAB, Python, or R. These tools allow you to input your set of points and generate a 3D function graph or surface plot.

3. Can I create a 3D function without a set of points?

Yes, it is possible to create a 3D function without a set of points by using mathematical equations. You can define the function using variables and their corresponding coefficients to create a 3D surface or shape.

4. What is the significance of creating a 3D function?

Creating a 3D function allows us to visualize and analyze complex data or objects in a three-dimensional space. It is widely used in fields like engineering, physics, and computer graphics to model and understand real-world phenomena.

5. Are there any limitations to creating a 3D function with a set of points?

Yes, there are limitations to creating a 3D function with a set of points. The accuracy and complexity of the function may be limited by the number of points provided. Additionally, the function may not accurately represent the entire object if the points are not evenly distributed.

Similar threads

  • Programming and Computer Science
Replies
9
Views
991
Replies
2
Views
991
Replies
4
Views
965
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
722
  • Programming and Computer Science
Replies
1
Views
735
  • Precalculus Mathematics Homework Help
Replies
3
Views
869
  • Programming and Computer Science
Replies
1
Views
1K
Replies
3
Views
998
Replies
2
Views
863
Back
Top