Derivatives In PYTHON (Symbolic AND Numeric)

  Рет қаралды 47,688

Mr. P Solver

Mr. P Solver

Күн бұрын

Check out my course on UDEMY: learn the skills you need for coding in STEM:
www.udemy.com/course/python-s...
In this video I go over three different types of scenarios where one needs to take derivatives in python: symbolic, numeric, and quasi-symbolic.
Code:
github.com/lukepolson/youtube...
How to get girls using python:
• The Secret to Getting ...
Link to discord server:
/ discord
0:00 Intro
1:34 Symbolic Derivatives
6:49 Numerical Derivatives
12:58 Quasi-Symbolic Derivatives

Пікірлер: 64
@sergeythehandyman
@sergeythehandyman Жыл бұрын
Just came across this video while trying to derivate some earthquake records for an assignment. Thank you very much for this tutorial. I particulary appriciate that you explain the codes with specific examples, making them easy to relate to other problems. You speak in clear and pragmatic ('practical') terms. Keep up the good Work. Regards from Norway
@JordanCarlisle
@JordanCarlisle Жыл бұрын
Your tutorials are fantastic! I'm working on economic models and this is saving me a ton of time.
@shrey2419
@shrey2419 3 жыл бұрын
found you on reddit, amazing content thanks man!
@geodancer7281
@geodancer7281 2 жыл бұрын
Thanks to you, I have my first working introduction to Sympy. This was definitely worth my time. (I worked this in PyCharm & Jupyter. Definitely cooler in Jupyter!)
@AJ-et3vf
@AJ-et3vf 3 жыл бұрын
Awesome video about this man! Love this. Highly informative and motivating at the same time. For the numpy gradient function, you can actually specify the edge_order to be equal to 2: edge_order=2. This way, the left and right endpoint derivatives will be calculated using three-point forward and backward differentiation formulas which are order O(h^2) (same as the derivatives for the interior points computed using the CFD formula) as opposed to just O(h). This doesn't make too much difference if you just need the first derivative, but if you will take the second derivative or more, you might see sharp straight lines connecting your first and second points; and your penultimate and last points. Then, it between, it will be a way smoother curve. That was my experience when I would apply the gradient function recursively. For the last part in the Quasi-Symbolic case, I loved learning about the vectorize function and it's use case! It's perfectly applicable when solving a boundary-value problem ordinary differential equation and you want to solve it using the shooting method: you define the shooting function whose root you can solve for using scipy.optimize's root_scalar function. One can also plot the shooting function, but, without "vectorizing" the shooting function, it would be tedious and inefficient to plot the function since one would be forced to use for loops and Python for loops are slow. But with numpy's vectorize function, plotting it would be nice and simple. (The same could also be actually achieved using Python's map function: y = np.array( list( map(function, iterable) ) ). This may have similar performance to np.vectorize since I read that the map function uses C code underneath.) Lastly, for SciPy's derivative function, an alternative to getting more accurate derivatives with is using higher order formulas by specifying the order of it with an odd number greater than the derivative order you're taking: derivative (f, x dx, n=2, order=5). I find this more preferable than using very low values of dx like 1e-6 since while it could yield very accurate results for the first derivative, higher derivatives starting from the second derivative are way less accurate due to round off error, since from the finite difference formulas, the h term in the denominator gets a higher degree with each higher derivative. Anyway, I got too carried away. I just love sharing my experiences with Python and additional learnings from this channel ❤️
@KompakterOperator
@KompakterOperator Жыл бұрын
I felt my (work)life changing while watching this, thanks very much for bringing this package to my attention
@3003eric
@3003eric 3 жыл бұрын
Always great videos. Keep it up!
@Nickname006
@Nickname006 3 жыл бұрын
Amazing! Thanks for making these videos.
@Bana888
@Bana888 2 жыл бұрын
Fantastic video, clear explanations, and sample code to demo important points.
@htshamsi
@htshamsi 2 жыл бұрын
Thank you for such a fanstastic video!
@soumyadipghosh6925
@soumyadipghosh6925 3 жыл бұрын
Awesome! keep up the good work
@arvidlindberg3603
@arvidlindberg3603 2 жыл бұрын
Awesome dude! just missing a tutorial for linear algebra and you are golden.
@MrPSolver
@MrPSolver 2 жыл бұрын
Hmmmm good idea
@awadejamaica6666
@awadejamaica6666 Жыл бұрын
To filter the noisy data use a low pass filter it's much more simple to what you did, thanks for the information I did enjoy the video.
@abhradeepdas3210
@abhradeepdas3210 7 ай бұрын
I used to really confused when they taught me calculus in school. And look now here I am performing the same thing in Python. And tbh, I am having fun. Thank you!
@joshuabardwell2294
@joshuabardwell2294 Жыл бұрын
This video was a lifesaver!
@typeer
@typeer 2 жыл бұрын
your vids amaze me haha thanks for sharing all this
@thecarlostheory
@thecarlostheory Жыл бұрын
Very useful content. Like it so much. Thank you :)
@iksudip
@iksudip 6 ай бұрын
thanks bro...too much helpful 🙏🏻
@barrytoppings1492
@barrytoppings1492 2 жыл бұрын
Great videos. I received my engineering degree long before Python was created.
@estherlestarter7416
@estherlestarter7416 Жыл бұрын
You are a master piece, love you so much
@syedomar269
@syedomar269 Жыл бұрын
You the best G really helped me out earn a sub!
@remomagalhaes4707
@remomagalhaes4707 5 ай бұрын
thanks a lot for this excellent and very useful video.
@mehdismaeili3743
@mehdismaeili3743 2 жыл бұрын
Excellent, thanks.
@arods
@arods Жыл бұрын
Very useful. Thank you so much. Regards.
@tahmidahaque6776
@tahmidahaque6776 Жыл бұрын
Thanks you so much!! So well explained!! ^_^
@gieaudio8762
@gieaudio8762 11 ай бұрын
Thank you!
@amirhossein_yz
@amirhossein_yz 2 ай бұрын
Good video, thanks
@nobodyeverybody8437
@nobodyeverybody8437 2 жыл бұрын
Thank you for this video. I am curious to know, whether you have an idea how to solve the drift when trying to get the velocity and position of after calculating the 1st and 2nd integration of acceleration data captured by an IMU?
@emmanuelhaikalis1095
@emmanuelhaikalis1095 3 жыл бұрын
This was fantastic and is exactly what I want to learn coding for - solving mathematics and engineering problems. Do you have any videos you can point me towards to start learning python for this purpose?
@wenhanzhou5826
@wenhanzhou5826 3 жыл бұрын
Idk, maybe subscribe to him? He got plenty of these kinds of video
@venil82
@venil82 5 ай бұрын
Subscribed!
@williamcase426
@williamcase426 2 жыл бұрын
Great video
@castroh
@castroh 8 ай бұрын
Nice video. By the way, what environment are you using to display the math formulas below the code ?
@samm9840
@samm9840 3 жыл бұрын
Does all this get replaced by AutoGrad or Automatic Differentiation, like that implemented in modern Deep Learning libraries or packages like CasADi?
@MagnusAnand
@MagnusAnand 3 жыл бұрын
cool video
@SGhann
@SGhann Жыл бұрын
Mr P. Solver, how about defining a function that calculates the derivative of f with respect to x without using any libraries, do you have any videos for that?
@opendebate
@opendebate 3 жыл бұрын
Would you be so kind to make a Math Series in Python for topics like Calculus, Linear Algebra, etc. ?
@bishubaswal178
@bishubaswal178 3 жыл бұрын
best guy
@utkarsh4784
@utkarsh4784 3 жыл бұрын
Can you make a video on visualizing gradient , divergence and curl with python. Thanks!
@andresderudder9950
@andresderudder9950 3 жыл бұрын
That would be awesome, maybe also a video about line integrals and all that stuff
@soumyadipghosh6925
@soumyadipghosh6925 3 жыл бұрын
@@andresderudder9950 yeah, solving vector calculus symbolically, maybe we get to see the geometry of the problem.
@MrPSolver
@MrPSolver 3 жыл бұрын
Right here my dudes. kzfaq.info/get/bejne/isuSZZuAq7O6dpc.html Not so much visualization per se, but lots of stuff with gradient, curl, finding line integrals, etc.
@utkarsh4784
@utkarsh4784 3 жыл бұрын
@@MrPSolver already watched it, its a great video and helped a lot. But cannot plot the gradient function. Thanks for your content man🙌🏼
@MrPSolver
@MrPSolver 3 жыл бұрын
@@utkarsh4784 Thank you for the ideas for new videos! This will likely come in the future :)
@letsfunwithshobe977
@letsfunwithshobe977 2 жыл бұрын
dear mentor , I have write an program that have a problem to use nsolve , can you recommend something faster method instead of nsolve in sciepy
@Cordic45
@Cordic45 2 жыл бұрын
how to print the mathematical formula like in the video in pycharm or colab? Seems only jupyter can performence like this
@BadAss_Playlist
@BadAss_Playlist Жыл бұрын
how to calculate the derivative, if the data have 4 dimention (time, high level,longitude,and latitude), i want calculate derivative in each dimention ?
@blewblew3555
@blewblew3555 2 жыл бұрын
How to inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial?(python) If both the inputted polynomial and its derivative should be represented as strings.
@nehakhanra9853
@nehakhanra9853 Жыл бұрын
Thank you so much for the amazing explanation. Sir, I have one problem and I am unable to fix it. Can you please give me a hint as I need that? How to code this =>( Y = d^n/ dx^n * ( x^2- 1)^n) in python.🙏🙏🙏🙏🙏
@user-Matter
@user-Matter Жыл бұрын
can I get the example data?
@georgechristou8483
@georgechristou8483 3 жыл бұрын
Leibniz wants to know your location.
@tarunmahawer
@tarunmahawer 10 ай бұрын
Exactly 😂
@frankkoslowski6917
@frankkoslowski6917 2 жыл бұрын
filename = "data/test.txt" xx, yy = np.loadtxt(filename) For this to work, I had to create arrays `x`, `y` first, then save them like this np.savetxt('data/test.txt', (x, y)) to then marvel at the way NumPy presents the information in a text file. Frankly, I don't think I would ever want to enter test data by hand into a file, that on loading, demands that type of format. The format may be suitable for an automatic data logger, presenting floating-point numbers in scientific notation without delimiters for all values of `x`, followed by all `y` values directly beneath, making the file contents not only look very compressed but any changes made by hand deviating from that numeric format might not be read correctly at all as was found when trying to construct common floating-point data by hand inside the text editor.
@andrewiglinski148
@andrewiglinski148 2 жыл бұрын
Lol I just had to add this when I found out you were from Canada… Me: ‘Dude, you know the girl across the hall from me is an Endocrinologist?’ Building manager: ‘(pauses to think)… oh yea! And she’s actually really nice too… she’s Canadian.’ That was our conversation on the elevator like a week ago
@justinofearth
@justinofearth 7 күн бұрын
Justin here, from the future. Just wanted to let ya know that everything works out
@SarthakGamer
@SarthakGamer 3 жыл бұрын
another qualtity video
@amit80547
@amit80547 3 жыл бұрын
Discord link not working for me? Is it moved or what?
@geodancer7281
@geodancer7281 2 жыл бұрын
@Amit Sehrawat - Discord link worked for me. Perhaps try again.
@cansuilhan380
@cansuilhan380 Жыл бұрын
Did not get 7, -7 part
@arturocdb
@arturocdb 2 жыл бұрын
There is a technique in data science called standarization.
@stuartpaco1
@stuartpaco1 Жыл бұрын
Are you on slack or discord? I need help PLEASE PLEASE
@ApteraEV2024
@ApteraEV2024 9 ай бұрын
9:30 🔑 👉 👈
@chainsawmanfan3002
@chainsawmanfan3002 Жыл бұрын
Hey, do you have a community discord or something??
Integration in PYTHON (Symbolic AND Numeric)
15:20
Mr. P Solver
Рет қаралды 80 М.
2nd Year Calculus, But in PYTHON
46:48
Mr. P Solver
Рет қаралды 36 М.
UNO!
00:18
БРУНО
Рет қаралды 3,6 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 17 МЛН
Llegó al techo 😱
00:37
Juan De Dios Pantoja
Рет қаралды 61 МЛН
1st Year Calculus, But in PYTHON
32:13
Mr. P Solver
Рет қаралды 123 М.
You Should Be Using This For Work/Research in Python | OOP Tutorial
34:23
ChatGPT Vs. Stack Overflow Be Like...
3:26
Mr. P Solver
Рет қаралды 75 М.
How to: Numerical Derivative in Python
10:45
HagesLab
Рет қаралды 23 М.
SymPy is REVOLUTIONARY For Mathematical Tasks
25:15
NeuralNine
Рет қаралды 68 М.
SciPy curve_fit: What is "pcov"?
31:24
Mr. P Solver
Рет қаралды 13 М.
Making Animations in Python using Matplotlib!
22:05
Younes Lab
Рет қаралды 9 М.
Grad School Be Like...
3:35
Mr. P Solver
Рет қаралды 97 М.
Ba Travel Smart Phone Charger
0:42
Tech Official
Рет қаралды 1,2 МЛН
Частая ошибка геймеров? 😐 Dareu A710X
1:00
Вэйми
Рет қаралды 6 МЛН
Хакер взломал компьютер с USB кабеля. Кевин Митник.
0:58
Последний Оплот Безопасности
Рет қаралды 2,4 МЛН
My iPhone 15 pro max 😱🫣😂
0:21
Nadir Show
Рет қаралды 1,9 МЛН