Project

Curve Fitting

1. What does popt and pcov mean?

popt stores the values of the co-efficients of the polynomial passed to the function curve_fit. The function curve_fit calculates these co-efficients and popt stores them.

pcov : It is a 2D array which gives the estimated co-variance of popt. The diagonals provide the variance of the parameter estimate.

2. What does np.array(temperature) do?

np.array(temperature) creates a numpy array of all the temperature values

3. What does the * in *popt mean?

The * in *popt is used the refer to the values of the variable popt so that it the values can be passed as an argument to our function

4. Write code to fit a linear and cubic polynomial for the Cp data. Explain if your results are good or bad.

Code:

https://drive.google.com/open?id=1mFq-JgTiCv9cuvzWQbPtkZaGhuSqLFwJ

Results :

Linear - BAD

Quadratic - Neither good nor bad

Cubic - GOOD

It can be easily seen from the graphs that the cubic polynomial best fits the actual data while the linear fit is very far from actual

5. What needs to be done in order to make the curve fit perfect?

In order to get a perfect fit curve, we need to try fitting higher order polynomials and depending on the fit we get, we may need to break the temperature range and try different polynomials for each range which best fits that range

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.