Integration in PYTHON (Symbolic AND Numeric)

  Рет қаралды 77,440

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 show how to evaluate integrals symbolically and numerically in python. The main packages used here are sympy for symbolic evaluation and scipy for numeric evaluation.
Code:
github.com/lukepolson/youtube...
Discord:
/ discord
0:00 Intro
1:18 Symbolic Integration
6:30 Numerical Integration (Functions)
11:14 Numerical Integration (Data)

Пікірлер: 88
@charliebarley94
@charliebarley94 2 жыл бұрын
Most underrated science channel imo
@hsh7677
@hsh7677 2 жыл бұрын
You’re the real MVP!!! Thank you for making those videos!! Can’t wait to see some mechanics focused videos!! Best of luck!
@AJ-et3vf
@AJ-et3vf 2 жыл бұрын
Awesome! I learned something new that integrating a dataset using the cumulative_trapezoid function removes the noise and actually produces a smooth curve! Very nice ❤️❤️❤️
@HardwareHari
@HardwareHari 2 жыл бұрын
Awesome content dude, hope your channel subscribers boom!!! Thank god i found this channel! All the best!
@nachnutzer
@nachnutzer 11 ай бұрын
Honestly, I'm sooo grateful for those videos! Thanks a million!
@TheBackboneOfNight
@TheBackboneOfNight 2 жыл бұрын
Fantastic videos! Don't ever stop doing them!! Very underrated, but already most of my group know of you :) Hope more join!
@joshyycute5823
@joshyycute5823 10 ай бұрын
I came back here to comment again. i rarely do this but this is sooo helpful to me as a math major. THANK YOU MAN!
@vineetwilson5277
@vineetwilson5277 Жыл бұрын
You have literally saved my life, my guy! I needed to integrate the flux values for my target star, but I didn't know how... Thanks a lot!
@davidam3459
@davidam3459 2 жыл бұрын
OMG, you are so underrated! These videos are amazing. You have just earned one new subscriber.
@richardbennett4365
@richardbennett4365 5 ай бұрын
I love watching your tutorials. Now, two years later and python3.11 and whatever is the newest version of sympy, one can get a solution involving the gamma function for the first example of an "unsolvable" integral at 6:49. I'm getting a solution.
@sanketdave3086
@sanketdave3086 2 жыл бұрын
Brilliant stuff mate, helping me a lot! Keep up the good work!
@wilhelm8735
@wilhelm8735 2 жыл бұрын
cool stuff, just watched the whole vid, I do more machine learning with python but integrals are always important. Thanks!
@calebwhales
@calebwhales Жыл бұрын
Jeez, the algorithm is getting good. I needed this today for a real world data set. I think I arrived at an OK answer but in an incredibly roundabout way. Integration of real world time series data is so useful in my line of work. Thank you so much.
@dcollett
@dcollett Жыл бұрын
I just found this video. Thanks so much! You're an excellent teacher.😀
@1.8millionvolts87
@1.8millionvolts87 2 жыл бұрын
Nice one dude, i'm probably not gonna understand any of this since i'm still learning. but it's sounds very awesome and interesting!!
@hutsons-hacks3668
@hutsons-hacks3668 2 жыл бұрын
Good stuff mate. I can remember integrating some beasts by hand, so this is awesome.
@louism.4980
@louism.4980 4 ай бұрын
Thank you so much! I did Physics at University quite a few years ago now so things brings back some fond memories! :)
@joshyycute5823
@joshyycute5823 10 ай бұрын
I'll really try and work with this. Thank you!!
@AlanMustafa
@AlanMustafa 2 ай бұрын
All I can say is: "WOW, just wow!" This Is Truly An Informative Teaching Session. Thank you for sharing your experience. 🙏
@iibuprofene860
@iibuprofene860 2 жыл бұрын
Are you going for the streamer/gamer video stile? I like that :) The camera looks good, allow me to suggest you to get a condenser microphone if you crave that clean and deep studio voice and it would probably remove a little bit of keyboard noise too. The sound is almost always more important than the video, especially for headphones users and especially if you talk a lot in your videos, wich you do. I would remove that thick black outline in the camera overlay, i think it would look sharper and more modern, and i would also reframe it in a 16:9 ratio in but that's my personal taste. As for the location of the overlay on the screen, try to see which one works best for your type of videos. I've been watching your videos all week, you are a talent, i've never coded in my life but i'm installing jupyter right now, have a good day :)
@rostamr4096
@rostamr4096 4 ай бұрын
Thank you so much,,you have no idea how much you are helping
@nahian2270
@nahian2270 Жыл бұрын
This is the thing that I needed..... Thank you, sir !
@surojitbiswas3573
@surojitbiswas3573 2 жыл бұрын
Thank you brother, I was working on problem regoriously last 5 days continuously . I was stuck . I just needed one command which i understand from you video. Thamnks a lot, man.
@kananvirkar7360
@kananvirkar7360 Жыл бұрын
Thank you so much for this video. You are lifesaver
@axelmoralesbuendia9047
@axelmoralesbuendia9047 Жыл бұрын
Saved my life, thnx awesome content
@narayanrai266
@narayanrai266 9 ай бұрын
Thanks for you video. My problem is solved right after I watched this video
@lucasmeneguin8139
@lucasmeneguin8139 2 жыл бұрын
Man this helped so much, thank you bro!!
@harshbordekar6732
@harshbordekar6732 Жыл бұрын
Thank you very much for this video! Really helpful!
@Ksurrrealizm
@Ksurrrealizm 2 жыл бұрын
Mr. P Solver, you are the best!
@YesGoingForward
@YesGoingForward Жыл бұрын
Oh my goodness, thank you for this video!!!
@Analytix_AI
@Analytix_AI 9 ай бұрын
Today i understood the real taste of integration and ,for removing integration fear thanks sir😊
@cogito919
@cogito919 Жыл бұрын
@Mr. P Solver Great video, very helpful! I was wondering how you are able to automatically display your output as formal equations rather than code? Also, is there somewhere I can find the sample data you used in this tutorial?
@rajanalexander4949
@rajanalexander4949 Жыл бұрын
Excellent video; thank you.
@ivanovich6450
@ivanovich6450 2 жыл бұрын
Truly Amazing
@eyal4
@eyal4 2 жыл бұрын
will you do digital signal processing and some control system with python? Great videos!
@joseftrojan7664
@joseftrojan7664 2 жыл бұрын
Very epic. Nice.
@NIce-sf2sg
@NIce-sf2sg 2 жыл бұрын
This is amazing!!! Thank you
@jitendradengada430
@jitendradengada430 Жыл бұрын
Thanks brother you care aabout aur time !
@adam100PCI
@adam100PCI Жыл бұрын
thank you. very useful videos. I hope to use a graphic interface with Python code to make it exciting.
@bayronpereamena5150
@bayronpereamena5150 Жыл бұрын
Muy bueno , muchas gracias!
@sb3987
@sb3987 Жыл бұрын
Very nice presentation and thank you so much. This is the best way to teach programming i think. One should not just spell out the correct syntax. The learner needs to understand the errors as well. Surely with chatGPT, now it is easier to identify the errors. Still this was helpful.
@fafifuvevo2192
@fafifuvevo2192 Жыл бұрын
as your name, you are solver. great explanations make me understand all of this video. danke
@gloryths
@gloryths Жыл бұрын
Great video. Cheers m8.
@justofanelli7155
@justofanelli7155 2 жыл бұрын
Great vid dude
@marinadine1084
@marinadine1084 2 жыл бұрын
Thank you How can i call bessel function because i want to calculate the symbolic integrale of J0(a*x)/(x^5)
@remomagalhaes4707
@remomagalhaes4707 3 ай бұрын
fantastic!!!
@valeriusevanligasetiawan6967
@valeriusevanligasetiawan6967 Ай бұрын
Hi, I don't know if you ever answer this question in other videos but have you ever done the integral in an adaptive grid?
@Erikalu8
@Erikalu8 11 ай бұрын
Which function should I use to calculate the area under the curve of a set of data which is not equally spaced? X is not the same.
@Bahrzy2002
@Bahrzy2002 14 күн бұрын
How do you print those functions after you have integrated them like you have?
@mdsalem4458
@mdsalem4458 2 жыл бұрын
is there any videos to show how to load sparse matrix from MMf file and carry out linear algebra on it ?
@marcoponts8942
@marcoponts8942 2 жыл бұрын
How about integrating over matrix elements? So every matrix element is an f(x). Could you cover that or give some references, that would really help! (Without just looping over entries)
@hhf39p
@hhf39p 6 ай бұрын
How to add assumptions, such as possible ranges for constants, whether a constant can be zero, if constants are necessarily real?
@kabijoshi5949
@kabijoshi5949 10 ай бұрын
Very nice. What about the constants after integration?
@user-yx4jh6gi5n
@user-yx4jh6gi5n 2 жыл бұрын
Хорошее видео, интересный канал!
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
Yes, your lectures are tremendously useful in terms of promoting accurate thinking. Speaking of Pyhsics and all the struggle pertaining to an obsolescent energy source such as oil, please forgive us for throwing this in, I tend to think that Einstein's thinking led us into a blind alley; restricting us to Light Speed with one's reasoning limited to the paradigm of space-time, in light of the fact that Laplace had set out, and succeeded to transform all functions of time. Where does this lead us philosophically? A Hyperspace or S-Domain reality too abstract to get us across the galaxy in no time at all? 🤔 This, of course, brings us to the issue of Gravity and the utilization of its underpinning principles for the purpose of obtaining free Energy. Given Newton's intuition that Gravity can't possibly be a quality of matter, but a force introduced into matter-matter interaction as the result of an external phenomenon, described by Dr. Nieper in the 1970s, as a latent, omnipresent scalar field. Rather than the Einsteinian space curvature caused by putting lecture room planets on the fabric of a dormitory bedsheet space. Nieper goes on, that if disturbed correctly, let's say by way of a 3D in itself rotating magnetic field, energy greater than the power needed to create that magnetic field was produced. Allegedly, the measured efficiency of such a system was at least 300%. I'm still trying to get my head around that part of electromagnetic theory. Maybe you can do better. 😦
@ZeusUruguayo
@ZeusUruguayo 2 жыл бұрын
I shouldn’t ask this because I’m not worth it, but could you upload something related with fenics and python? *********** Many thanks for all your videos, I really appreciate them!
@cansuilhan380
@cansuilhan380 Жыл бұрын
Can you do more fitting videos, please? Fitting the data based on a formula.
@et4493
@et4493 Жыл бұрын
It's a disater for me, every expression I add gets summed up with the previous ones. How do I only run a specific series of cells?
@parthmalik1
@parthmalik1 Жыл бұрын
You should upload these .ipynb files These are awesome templates !!
@rabianawaz9094
@rabianawaz9094 Жыл бұрын
Hello!I need little bit help from you.I have a maths course "Time Scale Calculus", and I want to do coding in python of this course.When I import timescalecalculus as tsc, module not found error came,please help how I can get this tsc module in my python.please help 😭
@JA-ym1tc
@JA-ym1tc 8 ай бұрын
How do you integrate when the coefficient is decimal number
@muklesurrahman2472
@muklesurrahman2472 9 ай бұрын
Can you please help me to integrate f(x)=exp(a*x**2), a is an arbitrary constant.
@dcollett
@dcollett Жыл бұрын
I tried to duplicate your Covid example. I have a .csv file with two columns for date and total cases. The dates are formatted like this: 2023-03-14 When I run your example, np.loadtxt keeps giving the error: "could not convert string '2023-0314' to object at row 0, column 1" What's the solution to this problem? Thanks very much!
@deveshpanwer2717
@deveshpanwer2717 2 жыл бұрын
Its showing ModuleNotFoundError : module named 'scipy.integrate ' ; 'scipy' is not a package. Can anyone help please .!
@masterinvestor6271
@masterinvestor6271 Жыл бұрын
Thanks! For some reason the examples that you showed that don't work, run for me and I do get an answer.
@bogdanskout3326
@bogdanskout3326 2 жыл бұрын
I have a quick question. Why is cumulative_trapezoid(y) ten times larger than numpy.cumsum(y)*(x[1] - x[0])?
@MrPSolver
@MrPSolver 2 жыл бұрын
Probably because cumulative trapezoid on its own doesn't take into account the spacing in x (which is probably 0.1 in this case). Did I make this error in this video?
@CellsAndRanges
@CellsAndRanges 2 жыл бұрын
What IDE is that you have used I'm not getting the same result in pycharm
@MrPSolver
@MrPSolver 2 жыл бұрын
That's jupyter lab
@user-qo6sq8jl6o
@user-qo6sq8jl6o 8 ай бұрын
thank u
@ameerbux78666
@ameerbux78666 2 жыл бұрын
Legend
@Angel-pj1dt
@Angel-pj1dt 11 ай бұрын
I get the integral without being actually done as the output, does that mean it can’t be solved. (Mathematica solved it)
@mamunmd.abdullahall5122
@mamunmd.abdullahall5122 2 жыл бұрын
Awesome
@lolmomz
@lolmomz 2 жыл бұрын
2:05 d/dx[sin(x)] = cos(x)
@armenhayrapetian755
@armenhayrapetian755 2 жыл бұрын
GREAT GREAT
@adamtaylor2142
@adamtaylor2142 2 жыл бұрын
Thank god they didn't keep the Matlab function name for cumulative trapezoidal integration...
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
Hmm. Any expression I can write down. . . 🤔 $\int\limits_{-\infty}^{\infty} \frac{\log{\left(x^{4} + 1 ight)}}{x^{2} + 1}\, dx = \;ln\left(6+4\sqrt{2} ight)^{\pi} \; = \;7.71542$ Haven't got many teeth left. Most of them are already bitten out. 😒 What we need is someone as sharp as a knife who knows how to instruct Scipy to take a stab at it; or owns a woodsman's Hatchet that helps him hack the function to bits. 🙄
@fizixx
@fizixx Жыл бұрын
"numerical numbers" 😁
@NCSUmagnet
@NCSUmagnet 2 жыл бұрын
Timestamps mentioned @42 seconds.... none to be seen.
@MrPSolver
@MrPSolver 2 жыл бұрын
Sorry about this, I knew I forgot something. I'll get them up in the next 30 minutes.
@ApteraEV2024
@ApteraEV2024 7 ай бұрын
I dragged my mouse. & it Bit me...😢...😅❤
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
f = sp.exp(-x**4) - $\frac{\gamma\left(\frac{1}{4}, 1 ight)}{4} + \frac{\gamma\left(\frac{1}{4}, 16 ight)}{4}$ Therefore the Integral has a definite solution that can be further evaluated to return a numeric result for the given area under the curve: intgral_sol.evalf() = 0.0615638789309999
@prateek3167
@prateek3167 Жыл бұрын
you guys can try this code snippet that i made , just the difference is in my case you won't need quad method to solve integrals numerically.check it out . def integrate_analytically(): import numpy as np import scipy as sp import sympy as smp from scipy.integrate import quad x=smp.symbols('x',real=True) a,b=smp.symbols('a b',real=True,positive=True) f=eval(input("ENTER FUNCTION WHOSE INTEGRAL IS NEEDED : ")) print("") print("") print(" IF YOU NEED INTEGRAL AS EXPRESSION PRESS - 1 ") print("") print("") print(" IF YOU NEED ANSWER AS AREA UNDER THE CURVE PRESS - 2 ") q1=eval(input(" ENTER 1 OR 2 :")) if q1==1: print("") print("") fdx=smp.integrate(f,x).simplify() print("THE INTEGRAL OF f(x) is = ",fdx) print("") print("") print("THE INTEGRAL OF ",f," is = ",fdx) return fdx if q1==2: r=eval(input("ENTER LOWER LIMIT :")) s=eval(input("ENTER UPPER LIMIT :")) print("") print("") fdx=smp.integrate(f,(x,r,s)).evalf() print("The Area under curve (",f,") between",r,"and",s,"is = ",fdx) return fdx
@frankkoslowski6917
@frankkoslowski6917 Жыл бұрын
Of course, SymPy can't give us an analytical solution when the variables [a, b = 2, 3] are not defined. By pre-defining, `a` and `b`, our functions look much more manageable ==> $\color{blue}{\frac{1}{\left(2 - \cos{\left(x ight)} ight)^{2} + \left(3 - \sin{\left(x ight)} ight)^{2}}}$ Hence: sp.integrate(f, (x, 0, 2*sp.pi)).simplify() = π/6, rather than, 0.5235987755982989
How to Solve Differential Equations in PYTHON
23:37
Mr. P Solver
Рет қаралды 95 М.
Integral Calculus in PYTHON #python #coding  #shorts
0:43
Mr. P Solver
Рет қаралды 39 М.
She’s Giving Birth in Class…?
00:21
Alan Chikin Chow
Рет қаралды 13 МЛН
СҰЛТАН СҮЛЕЙМАНДАР | bayGUYS
24:46
bayGUYS
Рет қаралды 809 М.
1🥺🎉 #thankyou
00:29
はじめしゃちょー(hajime)
Рет қаралды 79 МЛН
Best Order to Learn Algorithms & Data Structures
1:00
NeetCodeIO
Рет қаралды 91 М.
Python Libraries Be Like...
2:30
Mr. P Solver
Рет қаралды 93 М.
Derivatives In PYTHON (Symbolic AND Numeric)
17:37
Mr. P Solver
Рет қаралды 45 М.
Grad School Be Like...
3:35
Mr. P Solver
Рет қаралды 95 М.
When Your Code Runs Without Errors...
2:23
Mr. P Solver
Рет қаралды 114 М.
C++ Coders Be Like...
2:17
Mr. P Solver
Рет қаралды 539 М.
Implementation of K Means Clustering for Customer Segmentation
2:30
Не обзор DJI Osmo Pocket 3 Creator Combo
1:00
superfirsthero
Рет қаралды 1,3 МЛН
Apple, как вас уделал Тюменский бренд CaseGuru? Конец удивил #caseguru #кейсгуру #наушники
0:54
CaseGuru / Наушники / Пылесосы / Смарт-часы /
Рет қаралды 4,6 МЛН
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 18 МЛН
Apple watch hidden camera
0:34
_vector_
Рет қаралды 54 МЛН
Где раздвижные смартфоны ?
0:49
Не шарю!
Рет қаралды 393 М.
Mi primera placa con dios
0:12
Eyal mewing
Рет қаралды 525 М.