Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

resolving equation expressing dataset in matrix

Status
Not open for further replies.

trosmo

Computer
Jul 8, 2004
3
Using the following setup i can interpolate values related to a two-column matrix:
X:=data(0) y:=data(1)
S:=cspline(X,Y)
fit(x):=interp(S,X,Y,x)
fit("value") = "returned value"

Is there any vay that i can get mathcad to return an equation expressing the dataset in my matrix ?



;-) mathcad-beginner

 
Replies continue below

Recommended for you

Mathcad can fit a function by regression- exponential, log, sin, power, ln, via genfit(), expfit(), logfit(), etc - see the user's guide for examples.


Bung
Life is non-linear...
 
Thanks for the reply!

The eksamples work but they don't give me an equation that I can use in another software to calculate y-values from a given x-value...?

Is there a way to get Mathcad to return the exact equation instead of general formulas and functions ?

(I want to get an equation that I can use in an HMI-system to calculate condensationtemp for gas at a meassured preassure)

;-) mathcad-beginner
 
I'm confused by what you're asking. Splines, by definition, are NOT closed-form equations. If you're resorting to splines, the implication is that there is no general equation.

Moreover, if you have "data", the implication is that the data is non-exact, due to measurement noise, etc., which means that splines are not the correct approach, since the purpose of the spline is to ensure that the generated curve tries to go through each data point, thus incorporating your process noise into the interpolation.

It's your data and process, so ONLY YOU can know what equation best fits the data. There are a number of functions that will tell the best fit to a particular equation that you provide, e.g., linfit and regress. These are described in the Mathcad help section on Curve fitting.

TTFN
 
The regression functions do give you the parameters of an equation that is a 'best fit' to the data points you supply. Mathcad may not write the equation down explicitly, but knowing the parameters that Mathcad calculates and the general form of the function used (see the manual), you can do it for yourself.

Of course, if your data does not conform to the type of curve you are trying to fit it to, you will get funny numbers - GIGO. Eg trying to fit data from an exponential function using logfit() is not productive. If you don't know what your data is, you can't expect any software to tell you. Mathcad will only do what you tell it to, and if you want it to fit an inappropriate function to your data it will do just that.



Bung
Life is non-linear...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor