Skip to main content
10-Marble
July 27, 2023
Solved

How to solve for the polynomial expression of a simple data matrix

  • July 27, 2023
  • 4 replies
  • 4755 views

Newbie question...if I have a matrix of data values as shown below, how can I get Mathcad to solve for the actual polynomial (or exponential) expression ?

 

Or stated another way...can Mathcad provide the actual polynomial formula that would produce the graphed curve below based on the data provided.

 

TC_0928_0-1690482924116.png

I am using MathCad V9.0.

Best answer by Werner_E

I tried the site suggested by DJf (I knew the site as ZunZun from former times) and it was indeed able to find the best fit so far

Werner_E_4-1690551907460.png

I added it to my sheet

 

With free eyes you hardly can spot a difference to the best so far.

Werner_E_2-1690551636077.png

Main difference seems to be at the front values

Werner_E_3-1690551691875.png

 

 

4 replies

25-Diamond I
July 27, 2023

Probably the data is not exactly fulfilling a polynomial or exponential equation, so would rather use a fitting function.

Look up expfit, polyfit or genfit in the help pages.

If you need more help, come back again, attach your worksheet and state which version of Prime you are using.

From the pic it doesn't seem to me that a polynomial or an exponential would be a good fit - but you are the one who should know what process the data stems from and what kind of function can be expected.

 

BTW, from the spreadsheet screenshot it looks like you had chosen the wrong plot type in Excel as the x values are shown equidistant which they actually aren't.

23-Emerald IV
July 27, 2023

My guess is:

LucMeekes_0-1690494585753.png

with

LucMeekes_1-1690494606613.png

LucMeekes_2-1690494696955.png

So use genfit.

 

Success!
Luc

TC_092810-MarbleAuthor
10-Marble
July 27, 2023

Thanks Luc...

 

Are you able to share any more of the details of your approach ? Apologies, but I'm new to the curve fitting functions in the Mathcad.

I will begin by looking at the genfit details in the help section as Werner suggested.

 

Can I assume that genfit produce these...

TC_0928_0-1690498037677.png

 

 

How did you arrive at this formula...

 

TC_0928_1-1690498069650.png

 

25-Diamond I
July 27, 2023

@TC_0928 wrote:
...

How did you arrive at this formula...

...

 

 


As Luc wrote - he guessed based on his experience that this type of function might give a good fit (and it looks like it actually does).

 

Still missing your worksheet with the data.

23-Emerald I
July 28, 2023

Attached is my cheat sheet for a least squares fit for a polynomial.  I apologize-- it's messy, You can pick the order of polynomial you want to fit and see how well it looks.  Runs in Prime 4 Express and higher.

Werner_E25-Diamond IAnswer
25-Diamond I
July 28, 2023

I tried the site suggested by DJf (I knew the site as ZunZun from former times) and it was indeed able to find the best fit so far

Werner_E_4-1690551907460.png

I added it to my sheet

 

With free eyes you hardly can spot a difference to the best so far.

Werner_E_2-1690551636077.png

Main difference seems to be at the front values

Werner_E_3-1690551691875.png

 

 

TC_092810-MarbleAuthor
10-Marble
July 30, 2023

Thanks for the help Werner...much appreciated !!