dong0179
(Zoeyy Dong)
October 6, 2022, 9:17pm
1
data1 = {0,2244}, {3.5, 2134}, {7, 2250}, {10.5, 2435}, {14,
17.2}, {17.5, 16.8}}
data2= {0,0}, {3.5, 2.6}, {7, 5.5}, {10.5, 6.2}, {14,
6.6}, {17.5, 7.8}}
I have these two data sets in one graph, the same x but two y axis. Now I want to fit my data. I can do polynomial fit for data2, but what function can I use for data1? Any help would be appreciated!
Hi Zoeyy,
A polynomial would be a very bad fit to the values in data1
ListPlot[{data1, data2},
Joined -> True,
Mesh -> All,
MultiaxisArrangement -> All]
Are you sure the values are correct?
dong0179
(Zoeyy Dong)
October 7, 2022, 3:57am
3
Hi Rohit, thanks for the help. Yeah I will need another function for data 1, but I don’t know what might be a good function equation.
hdolhaine
(Hans Dolhaine)
October 7, 2022, 10:21am
4
Hello Zoeyy,
you don’t say anything about the background (physics) of your data, so I have no idea of a reasonable fit. What do you think of this?
fff = FindFit[data1, a (1 - b Erf[x - c]), {{a, 2200}, {b, 3}, {c, 12}}, x]
h = a (1 - b Erf[x - c]) /. fff
Plot[h, {x, 0, 18}, PlotRange -> {0, 2500}, Epilog -> {Red, PointSize[.02], Point /@ data1}]
dong0179
(Zoeyy Dong)
October 7, 2022, 3:40pm
5
That is exactly what I need. Thank you very much!!!