I am trying to obtain, y, a function of x illustrated in the picture attached. I cannot obtain this function using polynomial fitting because of the peaking behavior. What is the best method for fitting the curve to obtain an equation whose output will be an explicit function of x?
Asked
Active
Viewed 349 times
2

Sterling Butters
- 1,024
- 3
- 20
- 41
-
1this is not really a python question... you could treat the left and right part separately. – hiro protagonist Apr 23 '17 at 06:41
-
1the peak moves left and right based on different parameters, I am essentially making something that is a function of multiple variables, a function of one variable. – Sterling Butters Apr 23 '17 at 06:50
-
i don't think anyone here can help you if you do not give more details. and this question may be better suited for https://mathoverflow.net/ . – hiro protagonist Apr 23 '17 at 06:54
-
1If you post a link to the data, I can try an equation search. – James Phillips Apr 23 '17 at 10:08
-
I am using the iapws97 module in Python for water at P=15.513 MPa and the temperature range you see – Sterling Butters Apr 23 '17 at 19:21
-
This doesn't really look like data, to smooth and the legend says 'exact'. So my question is, can you get the analytical model used to generate this plot and fit to that? – tBuLi Apr 24 '17 at 08:21
1 Answers
0
Modeling the left and right sides separately as noted above might be easily done programmatically with an if-else statement, as in "if x < [x value for max(y)] use model1 else use model2"

James Phillips
- 4,526
- 3
- 13
- 11
-
mmm yes I hadnt considered that suprisingly, do you think a simple polyfit would work for each side? – Sterling Butters Apr 24 '17 at 00:19
-
1