SciPy Tutorial (2022): For Physicists, Engineers, and Mathematicians

แชร์
ฝัง

ความคิดเห็น • 147

  • @MrPSolver
    @MrPSolver  3 ปีที่แล้ว +59

    CORRECTIONS:
    31:30: The function should be lambda y, x; not lambda x, y. The result for the integral is incorrect in the video.

    • @davidsanjenis2778
      @davidsanjenis2778 3 ปีที่แล้ว

      If you're wondering why like me, I looked up the .dblquad function(?)
      scipy.integrate.dblquad(func, a, b, gfun, hfun, args=(), epsabs=1.49e-08, epsrel=1.49e-08)
      From the scipy doc, it defines gfun (lower boundary curve in y), and hfun(the upper boundary curve in y) are the bounds for y. This is probably why we have to define y first. please correct me if I'm wrong.

    • @agustinbrusco7173
      @agustinbrusco7173 2 ปีที่แล้ว +2

      may I ask you if at the Fourier example where you showed the two transform peaks at around 1.0 and 1.2 Hz, there is a chance you didn't create the correct frequency domain? I'm probably getting something wrong, but by making your signal with sin(2*π*t) + sin(4*π*t), wouldn't you espect to see the peaks at 1 Hz and 2 Hz respectively? as in this case you have ω1 = 2π , ω2 = 4π, so f1 = ω1/2π = 1 and f2 = ω2/2π = 2. I don't know what i'm missing right now. I tend to transform the frequency domain using fftshift, but your method should have worked just fine for the example. Anyway, reallly good video, thanks for making this amazing content

    • @MrPSolver
      @MrPSolver  2 ปีที่แล้ว +5

      @@agustinbrusco7173 I definitely should have explained this better, but what's happening here is an example of aliasing. Because the 2Hz component is larger than the Nyquist frequency of about 1.6Hz, its component gets "folded back" into a smaller frequency. So technically there is no 1.2Hz component, but the spectral density estimator predicts a frequency there.

    • @agustinbrusco7173
      @agustinbrusco7173 2 ปีที่แล้ว +3

      @@MrPSolver ooohhh, so that's what happened, thanks for the explanation. So I guess that if you had created t with a bigger resolution (say, 10000 elements for example), we would had seen the "real peaks" with no aliasing?

    • @MrPSolver
      @MrPSolver  2 ปีที่แล้ว +3

      @@agustinbrusco7173 yes, I would hope so!

  • @doctoralvlog
    @doctoralvlog 2 ปีที่แล้ว +29

    Your videos should be made mandatory to watch for all science/engg majors. So useful! Thanks for making these!

  • @matthewmcgraw8901
    @matthewmcgraw8901 ปีที่แล้ว +3

    This, this video is an absolute savior. I'm working on my final motion planning project for the class I'm taking and nothing came close to showing me the proper way to calculate trajectories with inputs for my drone. YOU ARE THE BEST!

  • @tzimmermann
    @tzimmermann 2 ปีที่แล้ว +12

    Excellent tutorial. Well explained, to the point, well constructed. I took notes like crazy and then subbed!

    • @MrPSolver
      @MrPSolver  2 ปีที่แล้ว +2

      Thank you :)

  • @rodrigobahamondessoto915
    @rodrigobahamondessoto915 3 ปีที่แล้ว +21

    I just finished the numpy video and now I can continue my journey through Python. Thank you for such valuable material

  • @sumserkarki5339
    @sumserkarki5339 2 ปีที่แล้ว

    You are a genius dude! I have gone through most of your videos and enjoying immensely. Being an engineer, I have to go through similar calculations in water flow network design, water treatment unit designs and alike. We normally do it in MS Excel using VBA. When I happened to watch your video in Numpy and Matplotlib, it got me in and in...awesome experience. So, I started self-learning Python since last two months, and am finding this very interesting and useful for my job. Hope I will gain average skill by next year. Your way of explaining and executing the codes is so clear and best in the youtube. Thanks.

  • @hsh7677
    @hsh7677 3 ปีที่แล้ว +42

    Thank you so much for sharing this knowledge. You can’t imagine how much you’re helping me.
    Thank you 🙏

  • @znswanderer
    @znswanderer 3 ปีที่แล้ว +1

    Wonderful! I have the feeling, that I will be coming back to this video (and the github repo) many times in the future for reference.

  • @user-fx9eq7zm2v
    @user-fx9eq7zm2v ปีที่แล้ว +2

    Thank you very much! I havent seen so good python/physics videos as yours

  • @pouyarahgozar7703
    @pouyarahgozar7703 3 ปีที่แล้ว +5

    thank you for these awesome tutorials🙏
    keep up the good work!

  • @eduardoh.m2072
    @eduardoh.m2072 3 ปีที่แล้ว +2

    Great video, man! Keep it up, you might actually help me in my research by doing this tutorials

  • @INCYTER
    @INCYTER ปีที่แล้ว

    You're a Great Canadian. Really nice job on this video - Subscribed..and looking forward to watching more of your stuff.

  • @panoskotoulas759
    @panoskotoulas759 3 ปีที่แล้ว +9

    That was an exceptionally good video. Thanks a lot! By the way, could you make a video about fitting a curve when you have points with x and y errors (if you haven't already done it)?

  • @Eighty_80_WAW
    @Eighty_80_WAW 2 ปีที่แล้ว +1

    Thank you for sharing this! Excellent lesson! Keep it up

  • @chinmaydubey4217
    @chinmaydubey4217 2 ปีที่แล้ว

    You are awesome man , i grasp all the concepts in just one watch👍👍

  • @jjhj_
    @jjhj_ ปีที่แล้ว

    Such a cool channel, both your programming tutorials and programming memes are of top quality. Thanks youtube algorithm

  • @aldabro1
    @aldabro1 2 หลายเดือนก่อน

    Great Tutorial! Thank you very much! I'm glad that there exists free software like this and not just expensive proprietary software suites like matlab.

  • @FelipeMontealegreS
    @FelipeMontealegreS ปีที่แล้ว +1

    This is terrific. Would you consider doing a video specifically on probability and probability distributions?

  • @RAJAT6555
    @RAJAT6555 2 ปีที่แล้ว +1

    Thanks for this. I'm working on an ODE (nonlinear) model problem in botany, and this video helped. I have one request though - could you make a future video on turning ODE models into optimal control problems and solving them in Python? Thanks in advance.

  • @datastako156
    @datastako156 3 ปีที่แล้ว

    hello bro, i'm only half way done with this video but wow this is super helpful for us, i wish i learn this during college days. thank you & more power! from philippines here

  • @Entropy3ko
    @Entropy3ko 8 หลายเดือนก่อน +1

    Regarding curve fitting you can set up how many iterations it does and that leads to good fits even from bad guesses... because sometimes there is no way to know exactly what the parameters are at all, like if you are fitting a multiple exponential decay

  • @taj-ulislam6902
    @taj-ulislam6902 3 หลายเดือนก่อน

    Amazing tutorial. You have my utmost respect.

  • @rhliarng
    @rhliarng 2 ปีที่แล้ว +1

    It's a great one! Thank you for sharing.😀

  • @thanarttangtanakoon2993
    @thanarttangtanakoon2993 2 ปีที่แล้ว

    Very impressive !! Love this content very much !

  • @thejojomader
    @thejojomader 2 ปีที่แล้ว

    Thank you a lot! You helped me understand SciPy

  • @ujjwalchetan4907
    @ujjwalchetan4907 ปีที่แล้ว

    You explain very well. Thanks for the content.

  • @jonmatthis
    @jonmatthis 3 ปีที่แล้ว +17

    This is really wonderful content, thank you!
    When you get a chance, could you put timestamps to specific topics (like you did in the NumPy video)?

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว +15

      Done and done! Glad you're enjoying the content :)

  • @ahmaddiab5930
    @ahmaddiab5930 3 ปีที่แล้ว +1

    Keep up the great work man!

  • @javicontry
    @javicontry 2 ปีที่แล้ว

    Now, I call this robust and not my code. Great job, I would like to be like you one day! Cheers mate.

  • @Mateusz-rg4cd
    @Mateusz-rg4cd 6 วันที่ผ่านมา

    As a physics student I am glad to find your channel!

  • @usmk2325
    @usmk2325 2 ปีที่แล้ว

    really good introduction into SciPi and a really good explanation.

  • @erickcruz3018
    @erickcruz3018 ปีที่แล้ว

    One of the most underreated youtube channels

  • @amriteshmaitra6877
    @amriteshmaitra6877 ปีที่แล้ว

    Really helpful video. Great for starting with python.

  • @srinivasansrivilliputhur4704
    @srinivasansrivilliputhur4704 2 วันที่ผ่านมา

    Great videos! Thank you Mr. P Solver.

  • @vladi1475S
    @vladi1475S 2 ปีที่แล้ว

    I am a neuroscientist and I LOVE your channel!!! I learned Python coding almost 4 years ago but I really want to improve my skills and apply more in my field for more complex data analysis.
    I was looking for a tutorial how to convert complex math equation in Python scripts (in my case is more for statistical analysis), and I came across with your video “1st year of calculus but in python”. I loved it!! Thank you!! :)

    • @MrPSolver
      @MrPSolver  2 ปีที่แล้ว +1

      Appreciate your kind words!! Good luck with the data analysis :)

  • @fredericoamigo
    @fredericoamigo 2 ปีที่แล้ว

    Kick ass tutorial! Good work!

  • @sairengpuiasailo6198
    @sairengpuiasailo6198 2 ปีที่แล้ว

    The Best Python teacher. Thanks for the wonderful vidoes.

  • @freddurstedgebono4589
    @freddurstedgebono4589 2 ปีที่แล้ว

    That intro is fire. He is rhyming left and right!

  • @lashanasaraia4113
    @lashanasaraia4113 2 ปีที่แล้ว +1

    Great Video, thanks man!

  • @JamBear
    @JamBear 2 ปีที่แล้ว +1

    UVic alumni, nice. Thanks for the video - the documentation is brutal.

  • @pypro
    @pypro 2 หลายเดือนก่อน

    What a great video, thanks for sharing!

  • @danv8718
    @danv8718 2 ปีที่แล้ว

    Very solid tutorial!

  • @riadelhamoud8224
    @riadelhamoud8224 2 ปีที่แล้ว

    very good video !!!
    Thanks a lot for sharing !!!

  • @ebenfalls9929
    @ebenfalls9929 2 ปีที่แล้ว

    Thank you so much!!!!!!!!
    This helps a lot really

  • @duongthanh869
    @duongthanh869 2 ปีที่แล้ว

    Thank you for a wonderful tutorials

  • @rrr33ppp000
    @rrr33ppp000 3 ปีที่แล้ว +5

    Beast, mastodon, artist!

  • @thomas_bourgeois
    @thomas_bourgeois ปีที่แล้ว

    That star reaction question you discuss, i remember that one from the class.
    A real pain...

  • @MrPetarBo
    @MrPetarBo 2 ปีที่แล้ว

    Great video, thanks!

  • @andresderudder9950
    @andresderudder9950 2 ปีที่แล้ว

    Great video, thank you so much

  • @bedegong08
    @bedegong08 ปีที่แล้ว

    Thank you sir! this video is awesome!

  • @carolina2066
    @carolina2066 2 ปีที่แล้ว

    thanks for this video! can you do a tutorial of how to minimize the error between a given dataframe and odeint results ? I'm facing a problem like this right now, where I try to optimize some parameters of my ODEs to reduce the error between real data and the model values!

  • @yashabyadav588
    @yashabyadav588 3 ปีที่แล้ว

    Lovely video! Are there any resources where I can find problems to apply these methods? Can you suggest some problems for practice?

  • @adriankeister4389
    @adriankeister4389 3 ปีที่แล้ว +2

    The DE at 34:43 actually is solvable by hand: $v(t)=-\dfrac{\sqrt{b}\tanh(\sqrt{ab}\,t)}{\sqrt{a}}.$ But the general principle you're demonstrating is certainly applicable to DE's that you can't solve by hand.

  • @fatihayar7423
    @fatihayar7423 2 ปีที่แล้ว

    Turkish language; çok başarılı bir programı anlatmışınız.. teşekkür ederim..
    Başarılarınızın devamını dilerim..

  • @adriankeister4389
    @adriankeister4389 3 ปีที่แล้ว +3

    Enjoying your style! Just wanted to point out that at 31:03, you forgot the 2 in the sin argument in your code, so that the code didn't actually calculate the displayed integral.

  • @adityaariewijaya9284
    @adityaariewijaya9284 2 ปีที่แล้ว

    This is amazing!

  • @pablosantos2282
    @pablosantos2282 ปีที่แล้ว +3

    So useful and explanatory. What if I have data from de pool temperature and from the outside temp and want to find k?? 🤔

  • @lifeisstrange418
    @lifeisstrange418 4 หลายเดือนก่อน

    thats exactly what i needed thx

  • @paulocasagrandegodolphim8203
    @paulocasagrandegodolphim8203 ปีที่แล้ว

    Excelent content!!!! Thank You!

  • @librealgerien
    @librealgerien 2 ปีที่แล้ว +2

    For the pendulum you’re missing a sign. d(omega)/dt =-sin(theta) and not +.

  • @markushaysnielsen4885
    @markushaysnielsen4885 3 ปีที่แล้ว +1

    Great video! I’m envious of the students you have been TA for😅 Have you compared using minimize versus least_squares? I’ve found that least_squares is MUCH better that minimize for least square / SSQ problems.

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว +2

      I should've compared the two! I have used it before, but I wasn't aware that one was much better for least squares problems. Thank you for sharing!

  • @UraniumGirl
    @UraniumGirl ปีที่แล้ว

    Thank you man, that's really helpfull.

  • @user-vx3jm1vi6p
    @user-vx3jm1vi6p ปีที่แล้ว

    Can’t appreciate enough ❤

  • @elkiparionarojas9206
    @elkiparionarojas9206 ปีที่แล้ว

    muchas gracias... es una buena primera intro a scipy.. aunq en matrices si q volé jeje

  • @glecko9241
    @glecko9241 2 ปีที่แล้ว

    Wow, thanks a lot!

  • @elganaelmehdi1697
    @elganaelmehdi1697 ปีที่แล้ว

    Thank you so much for sharing this knowledge. i have a qusetion can i use Odeint for solving ODE with array parametre

  • @g.don24
    @g.don24 ปีที่แล้ว

    Thanks for your video. I'm currently using VScode as editor for my Python programming but I think that your IDE is more interesting and user-friendly. Can you tell me what is it and suggest me tutorials about its installation and learning?

  • @wenhanzhou5826
    @wenhanzhou5826 3 ปีที่แล้ว +1

    I just realized I have wasted months of time in a university course... Glad that I found this video thought.

  • @rohit2761
    @rohit2761 2 ปีที่แล้ว

    You are genius bro

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w 2 ปีที่แล้ว

    this is a great tutorial. how does Scipy stats package compare to others?

  • @tousifreza5288
    @tousifreza5288 2 ปีที่แล้ว

    Very helpful video

  • @vishalkumar040393
    @vishalkumar040393 2 ปีที่แล้ว +1

    Nice explanation. For quite sometimes I am trying to model particle flow in Python following a research paper. But unable to do so. There is no one I know who does theoretical work, could you please help me with the problem?

  • @lucasantagata4551
    @lucasantagata4551 2 ปีที่แล้ว

    Hi! When we define the constraints in the optimization part...how do we specify that we want >= 0 and not

  • @monkeywrench1951
    @monkeywrench1951 ปีที่แล้ว +1

    Please show a bit of LLMs used for scientific numerical problems. I had both chatGPT and Bard generate code to solve a 3 domain diffusion problem. ChatGP4T setup the ODEs and used a numerical solver and then plotted , Bard showed the solved ODE’s and plot these. The code I asked for was R, not python. What I haven’t been able to do well is get it to fit to equations. I signed up for your Udemy course by the way, thank you very much.

  • @varunsohanda2601
    @varunsohanda2601 3 ปีที่แล้ว

    Thanks alot, could you take these on dark theme?

  • @suyudiakbarihabibi6679
    @suyudiakbarihabibi6679 ปีที่แล้ว

    thank you so much

  • @Lusypher
    @Lusypher 3 ปีที่แล้ว +7

    One small request:
    Do Schrödinger time dependent equation with python ☺️
    Thanks

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว +3

      Good idea!

  • @airatvaliullin8420
    @airatvaliullin8420 ปีที่แล้ว

    I think the equation of a harmonic oscillator on the thumbnail has a wrong sign: it must instead read "\ddot{\theta} + \frac{g}{l} \cdot \sin{\theta} = 0" (unless you take g=-9.81, ofc)!

  • @erikp6614
    @erikp6614 2 ปีที่แล้ว

    Very nice video! (I hope no one stole anything from you...)

  • @varunsohanda2601
    @varunsohanda2601 3 ปีที่แล้ว

    Also, can we find the errors for the sols of DE?

  • @MH-oc4de
    @MH-oc4de 2 ปีที่แล้ว

    Around 30:30 you wrote the integrand as ... sin(x) ... but the latex shows sin(2x). No big deal ... Thanks for the video!

  • @AhmedTaha-ij8xj
    @AhmedTaha-ij8xj 2 ปีที่แล้ว

    so what is used for maximizing the function not minimizing?

  • @user-er1lo1hj4x
    @user-er1lo1hj4x 3 ปีที่แล้ว

    Hello..I am a PhD student in physics from Iraq..I hope you can help me find codes in the Python program to study the Fe(II)particle (ising model 2D)to determine the spin crossover of the electrons and find the energy..with many thanks to you.

  • @amigosdelmicrobio
    @amigosdelmicrobio 2 ปีที่แล้ว

    I tried to compute the third order derivative for the example used in this video, but it doesn't work; and the same even if I use much simpler functions that are clearly of class C infinite. It returns me a ValueError message in which it is specified that the error comes from the order argument (it is not the same as n), which I didn't even specify. Is it that scipy isn't really defined for computing higher order than 2 or maybe there is something I am missing?

  • @user-ql1im6ew7i
    @user-ql1im6ew7i ปีที่แล้ว

    Thank you sir

  • @mykola_fedotov
    @mykola_fedotov 8 หลายเดือนก่อน

    Hi! Do you know what to do maybe if my ODE isn't linear? Like I can't get dydx out of ode to know what it equals for. Ive met problems like this in my chemeng classes and ive always had to write explicit euler to solve them just because couldn't find anything useful in the google.

  • @frankkoslowski6917
    @frankkoslowski6917 5 หลายเดือนก่อน

    You might want to try the following line to actually see the array:
    D_kronsum = (kron(D, np.identity(N)) + kron(np.identity(N), D)).toarray()
    rather than obtain information about the object:

  • @thatego9417
    @thatego9417 2 ปีที่แล้ว

    hi , can you share your set_up , what kind of IDE ,you"re using and stuff

  • @rufusbabatundelot1869
    @rufusbabatundelot1869 2 ปีที่แล้ว

    Thanks

  • @alvaroe2704
    @alvaroe2704 2 ปีที่แล้ว

    Is the integral of the first example correctly formulated? 56:00

  • @eukaryote0
    @eukaryote0 3 ปีที่แล้ว +1

    Amazing

  • @cattnation6257
    @cattnation6257 5 หลายเดือนก่อน

    can you explain quratnion with scipy

  • @matejivanek2013
    @matejivanek2013 3 ปีที่แล้ว +1

    How do you come up with those examples? Do you just make them up or is there some sort of website with physics problems to solve with programming?

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว +8

      Unfortunately no website exists! Hopefully this channel becomes that website, to some extent. The problems are communicated to me through telepathy with aliens.

  • @Harrykesh630
    @Harrykesh630 4 หลายเดือนก่อน

    hey, what have you studied ?
    PS: Thankyou for the video

  • @adriankeister4389
    @adriankeister4389 3 ปีที่แล้ว +1

    Another comment: at 33:04, when you're doing the double integral, scipy gives a different result from Mathematica (an NIntegrate[Integrate[ command can handle this one): 0.59009. That's quite different from the scipy result. I'm curious about that. I get the 0.59009 from Mathematica regardless of which order of integration I use (as you would hope). Does scipy give you the same result if you do int_0^1 int_sqrt(y)^1 sin(x+y^2) dx dy + int_-1^0 int_-y^1 sin(x+y^2) dx dy?

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว +1

      Thank you for this comment! Yes: it turns out my x and y were mixed up in my function (y has to come before x in the integrand=...) line. I've made corrections based on your comments and updated the GitHub code!

    • @adriankeister4389
      @adriankeister4389 3 ปีที่แล้ว

      @@MrPSolver Well, that's subtle! What's the general rule about which order to do that in a lambda expression? 'Cause if I do func1 = lambda x, y: x + y**2, and func2 = lambda y, x: x + y**2, the first one yields the results I'm expecting, but the second one reverse the order of the arguments!

    • @MrPSolver
      @MrPSolver  3 ปีที่แล้ว

      @@adriankeister4389 in general the variable that corresponds to the inner most integral (in this case y) comes first in the lambda function. Thanks again for catching this 😁. Happy to know you're going over the tutorial in depth!

  • @lameiraangelo
    @lameiraangelo 2 ปีที่แล้ว

    This Guy is good...

  • @dennisivanchavez5367
    @dennisivanchavez5367 2 ปีที่แล้ว +1

    Thank you so much! Reading the documentation makes me nauseous

  • @JulioHuato
    @JulioHuato 2 ปีที่แล้ว

    You lost me when you said "Celsius is the better unit." :-) That blunder aside: Thank you so much, bro!

  • @firasbejar5496
    @firasbejar5496 2 ปีที่แล้ว

    This is really helpful, I would like to see you provide something regarding Pymoo for Genetic algorithms !

  • @charlesspringer4709
    @charlesspringer4709 2 ปีที่แล้ว

    I suppose others have mentioned, but turn up your headphones until you stop shouting, or don't use them. I appreciate the speed and density of the information.

    • @taj-ulislam6902
      @taj-ulislam6902 3 หลายเดือนก่อน

      I don't understand what you are saying. His presentations and the quality of the video are both excellent. The content has no parallel.