Skip to main content
1-Visitor
March 27, 2024
Question

Form an equation from table data

  • March 27, 2024
  • 3 replies
  • 1611 views

Hi, 

 

I have a table of data as given below. I want a function or equation of the data. So that I can find the y value for desired x value.

Please guide me how to do that in Mathcad. I'm using Mathcad Prime 9.0

 

xy
6.2215
9.1153
13111
1597
1882
2267
2462
2755
3050
3346
3642
3939
4335
4733
5130

3 replies

ttokoro
21-Topaz I
21-Topaz I
March 27, 2024

Check Prime help of minner. It shows how to do it.

image.pngimage.pngimage.pngimage.png

t.t.
1-Visitor
March 27, 2024

Hi,

 

Thank you for the detail.

 

When I re-calculate Y using f(x) function, I'm getting values with +/-1.6 error. How to minimize the error further?

 

xy
(Existing data)
Y
(Calculated data using function f(x))
Error (y-Y)
6.2215216.6173939-1.617393929
9.1153152.01122220.9887777664
13111109.37073781.629262187
159795.838194611.161805388
188280.994277151.005722847
226767.29994691-0.2999469128
246262.10633191-0.1063319106
275555.70858169-0.7085816934
305050.54613325-0.5461332521
334646.28949998-0.2894999786
364242.71728555-0.7172855481
393939.6751177-0.6751176959
433536.25596522-1.255965218
473333.39831321-0.3983132065
513030.97302218-0.9730221783
ttokoro
21-Topaz I
21-Topaz I
March 27, 2024

Change the assuming function Y(x):=ax^b such as ax^b+c, ax^3+bx^2+cx^1+d, etc.. 

t.t.
5-Regular Member
April 1, 2024
Hi @MP_10748008 
It looks like you have some responses from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.
25-Diamond I
April 3, 2024

Basically you have the choice between an interpolation or a function fit.

 

In case of an interpolation in Prime you have the choice between linear interpolation and cubic spline interpolation. An interpolated function runs exactly through all the given data points, but its behaviour inbetween might not always be as expected or desired.

 

In case of a function fit (regression) usually you get a function whose graph may not include any of the given data points exactly (as in Terrys appraoch) but gives an overall good fit. You have to guess which function type may apply as Prime provides not means to autoselect an appropriate function type like specialized programs like CurveExpert Pro will do.

 

If you need further help, come back here and ask and don't forget to attach your worksheet.

 

So first you will have to decide if you need an interpolation or a regression.

Here are a few examples for both:

Werner_E_0-1712161689816.pngWerner_E_1-1712161705182.png

Werner_E_2-1712161750958.png

Werner_E_3-1712161783188.png

Werner_E_4-1712161820234.png

Werner_E_5-1712161852705.png