Python Integration, Interpolation, and Curve Fitting

  Рет қаралды 58,417

ignite.byu.edu

ignite.byu.edu

8 жыл бұрын

iPython Notebook, using numpy and scipy interpolation, integration, and curve fitting functions

Пікірлер: 25
@mokus603
@mokus603 3 жыл бұрын
After all these year, you video is still amazingly helpful! Thank you for your hard work
@jawnvawn
@jawnvawn 5 жыл бұрын
Really enjoyed your clear tutorial. I'm using this to help me fit spectra peaks from astronomical data to gaussian curves. Will hopefully impress my professor. Much thanks!
@AlexOmbla
@AlexOmbla 3 жыл бұрын
Thank you very much! I couldn't find this anywhere , you saved me
@jimwest63
@jimwest63 5 жыл бұрын
A very good video, just what I needed to quickly get going on a work problem I currently have, using nothing but the packages that already come installed in anaconda. Good work.
@clivemayo4049
@clivemayo4049 7 жыл бұрын
Great video, very well explained thanks
@blanky_nap
@blanky_nap 7 жыл бұрын
Great stuff! thx!
@Satenc0
@Satenc0 7 жыл бұрын
Very nice explained
@ignitebyuedu
@ignitebyuedu 4 жыл бұрын
Thanks for the positive feedback. The code is available at this website: ignite.byu.edu/che263/lectureNotes/ This includes all lecture notes. If you back up to che263 you can see other course materials. The integration, interpolation, and curve fitting slides are now separate, but much of the content is the same. Not all notes are posted; they get added as the semester progresses. You can find slides from previous semesters here: ignite.byu.edu/che263/lectureNotes/old.html
@yurivendruscolo7676
@yurivendruscolo7676 8 жыл бұрын
Hello, would it be possible to get a pdf of the data shown on the video?
@philtoa334
@philtoa334 2 жыл бұрын
Nice Thx.
@skfkfkd
@skfkfkd 8 жыл бұрын
This was a superb tutorial, I was wondering if you have or can make a video explaining how to make the r squared value for the curve fitted function you made at 14:08
@MartinezF
@MartinezF 7 жыл бұрын
I have a question about the last fitting you did. Those command lines make the fit with minimum squares? (sorry for my english)
@juliarey6475
@juliarey6475 5 жыл бұрын
GRACIAS!!!!
@frankelindddd
@frankelindddd 6 жыл бұрын
What if the function have been integrated by .quad and sub into another non-analytical function to get two sets of array, and I want to do curve fitting of that with test data?
@Satenc0
@Satenc0 7 жыл бұрын
How about using numpy corrcoef? at curve fitting id just enter p3 as parameter of it
@davidmckinnon4770
@davidmckinnon4770 5 жыл бұрын
As a Python newbie, I found this tutorial fantastic for an analysis I am currently undertaking. What is missing though, is the code necessary for goodness of fit. I can't figure out how to do this - can anybody help?
@stefanofedele4820
@stefanofedele4820 7 жыл бұрын
I like it, but I was looking for some tutorials that explain me how can I use the covariance matrix, that in your tutorial is reported at the end of it as "extras" in the "curve_fit" output, and still I can't find anyone who explain me it
@shobanasanthanagopalan
@shobanasanthanagopalan 5 жыл бұрын
Thank you. Is there a downloadable of this notebook?
@aamir122a
@aamir122a 7 жыл бұрын
At the end of the function, why do you put dx, has it any use?
@RobinOnYew
@RobinOnYew 5 жыл бұрын
just saying dx is the convention that you put in an end of a integral because you are declaring you are using the decimal system for x that is the meaning of it in integrals but in a bit more complicated integrals you can declare part of a fucntion thay ou want to solve as the system like Ux it's pretty interesting and easy so you should check it out
@Passco666
@Passco666 5 жыл бұрын
Where I can found that example notebook?
@riccardolizio8230
@riccardolizio8230 5 жыл бұрын
i think it is the jupiter notebook, you can get it through anaconda navigator
@Passco666
@Passco666 5 жыл бұрын
@@riccardolizio8230 Thank you for reply.. I have already downloaded jupyter,however I did not find any example or training sheet :(
@sambad8429
@sambad8429 6 жыл бұрын
import numpy as np import matplotlib.pyplot as plt % matplotlib inline from scipy.integrate import quad def f(x): return 3.0*x*x+ 1.0 xlo=0 xhi=1 I, err=quad(f,xlo, xhi) print("I =", I) print("err =", err) from scipy.interpolate import interp1d x_given= np.linspace(0,10,10) y_given=np.cos(x_given**2.0/8.0) xx= np.linspace(0,10,1000) yy=np.cos(xx**2.0/8.0) plt.plot(x_given, y_given, "o", label="given data") plt.plot(xx, yy, ":", label="perf") plt.legend(loc='best') x_i=np.linspace(0,10,1000) f_linear=interp1d(x_given, y_given) y_li=f_linear(x_i) f_spline=interp1d(x_given, y_given, kind='cubic') y_is=f_spline(x_i) #plot plt.plot(x_given, y_given, "o", label='given data') plt.plot(x_i,y_li, '-', label='linear') plt.plot(x_i,y_is, '--', label='spline') plt.plot(xx, yy, ":", label='perf') plt.legend(loc='best') x_given=np.array([0.,1.,2.,3.,4.,5.]) y_given=np.array([0.,0.8,0.9,1.0,-0.8,-1.0]) x_p=np.linspace(-2.0,6.0,100) p_3=np.polyfit(x_given, y_given,3) y_p=np.polyval(p_3,x_p) plt.plot(x_given, y_given, "o") plt.plot(x_p, y_p, '-') plt.legend(['data','polyfit'], loc='best') plt.ylim(-2,2) from scipy.optimize import * def f(x,a,b,c): return a*np.exp(-b*x)+c x_given=np.linspace(0,4,50) y_given=f(x_given,2.5,1.3,0.5)+0.2*np.random.normal(size=len(x_given)) params,extras=curve_fit(f,x_given, y_given) print('a=%g, b=%g, c=%g' %(params[0], params[1], params[2])) y_fit=f(x_given,params[0], params[1], params[2]) #plots plt.plot(x_given, y_given, "o") plt.plot(x_given, y_fit, "-") plt.legend(['data', 'fit'], loc='best')
Symbolic math in Python
20:37
ignite.byu.edu
Рет қаралды 10 М.
Monte Carlo Integration In Python For Noobs
15:32
Andrew Dotson
Рет қаралды 150 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37
Этот Пёс Кое-Что Наделал 😳
00:31
Глеб Рандалайнен
Рет қаралды 4,5 МЛН
Curve fitting in Python with curve_fit
51:26
Brant Carlson
Рет қаралды 66 М.
Python 🐍 Nonlinear Regression Curve Fit
14:22
APMonitor.com
Рет қаралды 80 М.
How to: Import, Plot, Fit, and Integrate Data in Python
24:11
Solving the Mathematics Calculus Problem in 'Gifted'
13:23
Ellie Sleightholm
Рет қаралды 46 М.
Integration in PYTHON (Symbolic AND Numeric)
15:20
Mr. P Solver
Рет қаралды 79 М.
CITS2401 - 11.3. Interpolation in Python
24:18
Travelling Lecturer
Рет қаралды 8 М.
Lesson 14, Part 2: SciPy - 1-D and 2-D interpolation
12:25
Ocean 215: Python Methods for Oceanography
Рет қаралды 4,9 М.
Univariate interpolation example with SciPy functions
7:29
DataTechNotes
Рет қаралды 114
Symbolic Manipulation in Python
28:18
APMonitor.com
Рет қаралды 63 М.
ТАМАЕВ УНИЧТОЖИЛ CLS ВЕНГАЛБИ! Конфликт с Ахмедом?!
25:37