Skip to main content
1-Visitor
April 27, 2016
Solved

Curve and surface fitting

  • April 27, 2016
  • 6 replies
  • 5082 views

Hi,

I have several series of points (x, y) and I have fitted each series in an exponential curve using expfit function.

Each series of x and y points has the same z.

Now, what I am trying to do is getting a general equation (x, y, z)  to relate x, y and z in one equation.

I tried to create a surface with CreateMesh (using regress and interp with all the points, not the fitted curves) but it seems that I do not have access to the equation which links the points. Is it possible to get an equation of the surface?

I tried to do something with the fitted curves instead of the raw points but I have not found how to do it. s there a function in Mathcad 15 to do that?

I am attaching two files with the fitted curves and the surface created.

Could anyone help me?

Thanks in advance

Best answer by Werner_E

So your question is, how to get a look at the equations itself, right?

If you are happy with the polynomial approximation of second order you did in your file with regress, its easy to get the equation because the 6 coefficients are part of the vector vs you create using "regress".

If you look at the help for regress you will find a link to a quicksheet at the end of the text. This quicksheet tells you, how to extract the correct coefficients.

In your case (2 variables and order 2) you may do like this:

6 replies

23-Emerald I
April 27, 2016

For problems were a polynomial fit is acceptable, regress works to create a surface fit.

Werner_E25-Diamond IAnswer
25-Diamond I
April 27, 2016

So your question is, how to get a look at the equations itself, right?

If you are happy with the polynomial approximation of second order you did in your file with regress, its easy to get the equation because the 6 coefficients are part of the vector vs you create using "regress".

If you look at the help for regress you will find a link to a quicksheet at the end of the text. This quicksheet tells you, how to extract the correct coefficients.

In your case (2 variables and order 2) you may do like this:

erguezga1-VisitorAuthor
1-Visitor
April 28, 2016

Thanks!

Is there a way to use an exponential fit instead of a polynomial one in 3D?

25-Diamond I
April 28, 2016

Enrique Rodriguez Garcia wrote:

Thanks!

Is there a way to use an exponential fit instead of a polynomial one in 3D?

Not out of the box as we have it for 2D, but you can always set up your desired function, define the residuals and minize them using the "minerr"  function.

Which 3D-function du you have in mind when you say "exponential fit" in 3D?