Mathematica: Generate Surface Equation

In summary: It seems like the conversation is about finding an equation for a surface given a 3D array and using regression techniques to fit the equation to the surface. The person also mentions using another program that automatically finds the best fitting equation from a database of basic equations. They are wondering if Mathematica can do the same.
  • #1
mattmatt
4
0
Hi there,
I just began using Mathematica today and I was wondering if there is a way to make the program generate an equation of a surface given a 3d array?

What I need it to do is to give me an equation of the surface so that given any two variables I can find the value of the third one.

Any advice will be highly appreciated.

Here is a screenshot of what the surface looks like:

attachment.php?attachmentid=63229&stc=1&d=1382478716.png


And here is the array:

4 1000 0.10331
4 1250 0.08479
4 1500 0.07125
4 2000 0.05700
4 3000 0.04133
4 5000 0.02921
4 10000 0.01995
4 15000 0.01660
4 20000 0.01510
9 1000 0.11400
9 1250 0.09476
9 1500 0.08265
9 2000 0.06698
9 3000 0.05201
9 5000 0.03919
9 10000 0.02993
9 15000 0.02630
9 20000 0.0245
16 1000 0.12754
16 1250 0.10901
16 1500 0.09690
16 2000 0.08123
16 3000 0.06555
16 5000 0.05344
16 10000 0.04418
16 15000 0.04235
16 20000 0.04075
25 1000 0.14250
25 1250 0.12683
25 1500 0.11400
25 2000 0.09904
25 3000 0.08336
25 5000 0.07125
25 10000 0.06199
25 15000 0.06070
25 20000 0.05920
36 1000 0.16388
36 1250 0.14963
36 1500 0.13538
36 2000 0.12041
36 3000 0.10474
36 5000 0.09263
36 10000 0.08336
36 15000 0.08250
36 20000 0.08115
49 1000 0.19024
49 1250 0.17100
49 1500 0.16031
49 2000 0.14535
49 3000 0.12968
49 5000 0.11756
49 10000 0.10830
49 15000 0.10750
49 20000 0.10600
 

Attachments

  • Screen Shot 2013-10-22 at 5.48.30 PM.png
    Screen Shot 2013-10-22 at 5.48.30 PM.png
    63.7 KB · Views: 710
Physics news on Phys.org
  • #2
That's generally a very hard problem, unless you already know the basic equation of the surface.
In those situations where the basic equation is known, you can use your surface data to fit the equation to the surface using regression techniques. Still a lot of number crunching though, and what if the equation doesn't pass through the surface data in one or more regions?
 
  • #3
Taming surfaces to keep them from extending beyond where they are intended to go is a black art. I used to model 3D surfaces on an IBM 360 in FORTRAN on punch cards. It was ... educational.
 
  • #4
The equation doesn't have to be perfect, as long as it's a close approximation.
I found another program that can do this. It has a database of hundreds of basic equations and it fits the best one automatically for you. I was wondering if Mathematica can do this.

In the case of this example it spat out the following:

attachment.php?attachmentid=63240&stc=1&d=1382502107.jpg
 

Attachments

  • graph.jpg
    graph.jpg
    40.5 KB · Views: 550
  • #5



Hi there, it is possible to generate an equation of a surface in Mathematica using the "Fit" function. This function allows you to fit a polynomial equation to a set of data points, such as the ones provided in your array. Here's an example of how you can use this function:

1. First, import your data into Mathematica using the "Import" function. In this case, you can use the "Table" format to import your data as a 3D array.

2. Next, use the "Fit" function to fit a polynomial equation to your data. You can specify the degree of the polynomial you want to fit, for example, a quadratic equation would have a degree of 2. The syntax for the "Fit" function is: Fit[data, {x^n, y^n}, {x, y}], where n is the degree of the polynomial.

3. Once you have your fitted equation, you can use it to find the value of the third variable given any two variables. For example, if you have x and y values, you can use the equation to calculate the z value.

I hope this helps and let me know if you have any further questions. Good luck with your work!
 

1. How do I generate a surface equation in Mathematica?

To generate a surface equation in Mathematica, you can use the Plot3D function. This function takes in an equation or a mathematical expression as input and produces a 3D plot of the surface.

2. What is the syntax for the Plot3D function in Mathematica?

The syntax for the Plot3D function is Plot3D[expr, {x, xmin, xmax}, {y, ymin, ymax}], where expr is the equation or mathematical expression, and xmin, xmax, ymin, and ymax define the range of values for the variables x and y.

3. How can I customize the appearance of the surface generated by the Plot3D function?

You can use various options within the Plot3D function to customize the appearance of the surface, such as PlotStyle to change the color or texture, Mesh to add a mesh grid, and PlotRange to adjust the range of values shown on the axes.

4. Can I generate a surface equation from a set of data points in Mathematica?

Yes, you can use the ListPlot3D function to generate a surface equation from a set of data points. This function takes in a list of coordinates and corresponding values and creates a surface that passes through those points.

5. How can I export the surface equation generated in Mathematica?

You can use the Export function to save the surface equation as an image or a file in various formats, such as PNG, JPEG, or PDF. You can also copy and paste the plot directly into another application, such as Microsoft Word or PowerPoint.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Programming and Computer Science
Replies
4
Views
9K
  • Programming and Computer Science
Replies
16
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Quantum Physics
Replies
9
Views
5K
  • Linear and Abstract Algebra
Replies
2
Views
7K
  • Programming and Computer Science
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
Back
Top