Русские видео

Сейчас в тренде

Иностранные видео


Скачать с ютуб How to: Numerical Derivative in Python в хорошем качестве

How to: Numerical Derivative in Python 3 года назад


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса savevideohd.ru



How to: Numerical Derivative in Python

Learn how to take a simple numerical derivative of data using a difference formula in Python. Script and resources to download can be found at: https://www.hageslab.com/Resources.ht... Here we use "Spyder" IDE as the Python Shell and the following libraries: numpy and matplotlib Here is the script: import numpy as np import matplotlib.pyplot as plt def func(x,A,B): return A*x**2+B*x xlist = np.linspace(0,10,100) ylist = func(xlist,2,1.4) plt.figure(1,dpi=120) plt.plot(xlist,ylist,label="Function") def D(xlist,ylist): yprime = np.diff(ylist)/np.diff(xlist) xprime=[] for i in range(len(yprime)): xtemp = (xlist[i+1]+xlist[i])/2 xprime = np.append(xprime,xtemp) return xprime, yprime xprime, yprime = D(xlist,ylist) plt.plot(xprime,yprime,label="Derivative") xprime2, yprime2 = D(xprime,yprime) plt.plot(xprime2,yprime2,label="2nd Derivative") plt.legend()

Comments