![gaussian software education gaussian software education](https://natelemoine.com/wp-content/uploads/2017/05/Fig2-5b.png)
First, we need to write a python function for the Gaussian function equation. Our goal is to find the values of A and B that best fit our data. For purposes of this lesson, we will simply fit the data to given functional forms.)įirst, let’s fit the data to the Gaussian function. (Looking at data and knowing what function it might fit is non-trivial and beyond the scope of this lesson. We will try two different functional forms. This data could probably be fit to many functional forms. Xdata = ydata = #Recast xdata and ydata into numpy arrays so we can use their handy features Graph your original data and the fit equation.įirst, import the relevant python modules that will be used.Use your function to calculate y values using your fit model to see how well your model fits the data.
![gaussian software education gaussian software education](https://images.squarespace-cdn.com/content/v1/5707ede0d210b8708e037a1e/72bf7e0f-a4cf-4c09-b141-c9ebca889c56/teaching-benchtop-nmr-fig-4.jpg)
Extract the fit parameters from the output of curve_fit.Use the function curve_fit to fit your data.The function should accept as inputs the independent variable(s) and all the parameters to be fit.
![gaussian software education gaussian software education](https://www.mdpi.com/physics/physics-02-00010/article_deploy/html/images/physics-02-00010-g001.png)