Week 5 - Curve fitting
What does popt and pcov mean?
Ans: popt – An array of optimal values for the parameters which minimizes the sum of squares of residual.
pcov – 2D array which contains the estimated covariance of popt. The diagonals provide the variance of the parameter estimate.
What does np.array(temperature) do?
Ans: Converts the python list of temperature to a numpy array since operations like pow are allowed on numpy arrays and not python lists.
What does the * in *popt mean?
Ans: *- reference to popt – the values are stored in the array popt.
Write code to fit a linear and cubic polynomial for the Cp data. Explain if your results are good or bad.
Ans: Python Code -







Output & Plots -





Results are good or Bad:
- From above comparing two cases of graphs shows that linear function curve is not accurate with actual data and curve not matched.
- while using the cubic equation and its output data similary match with data given so, hence we can declare that second equation results is "GOOD".
What needs to be done in order to make the curve fit perfect?
Ans: From tha above two methods shows that while using the higher order equation , we will get the accurate result according to the data we have , so its suggest to use higher order equation for desired reault with minimum error.