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

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ค. 2024
  • Check out my course on UDEMY: learn the skills you need for coding in STEM:
    www.udemy.com/course/python-s...
    This from-scratch tutorial on SymPy is designed specifically for those in physics, mathematics, and engineering. In the future, I will be making tutorial videos on all the essential python packages, so subscribe for more!
    All code can be found here:
    github.com/lukepolson/youtube...
    0:00 Introduction
    1:50 Basic Usage
    16:22 Example: Systems of Equations
    24:13 Calculus (1st Year)
    31:01 Example: Difficult Integrals
    44:26 Calculus (Multivariable)
    51:28 Example: Vector Integrals
    57:03 Calculus (Multivariable)
    58:57 Lagrangian Mechanics
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    There he goes SymPying for science.

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

      Yeah right, I've always thought the SymPy package was for symps.

    • @erikanderson1402
      @erikanderson1402 10 หลายเดือนก่อน +1

      There also is a package called SimPy for discrete event simulation

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

    you must have read my mind! Just starting an in-depth course in classical mechanics, those symbolic Lagrangians will save me a lot of time, thank you! :)

  • @NinjaMartin
    @NinjaMartin 3 หลายเดือนก่อน +2

    You are really great at teaching, sir! I love the way you show examples, tracing back if something «went too fast». You dont assume we know all the small things you know so really well yourself, which is easy to forget about when explaining things in my opinion. Superb stuff!

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

    Thank you very much!!!
    We need more of these videos!!
    You’re the best!!

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

    Thanks, mate, this helps me a ton. I thought I'd need to completely switch to Mathematica for my project, but this gets me where I need to in Python. Much appreciated.

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

    The Symbol definition right at the beginning was exactly what I need to perform my lengthy calculations ❤
    Thx

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

    I was literally wishing you would do this video last week. AWESOME!

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

    The most helpful hour I've spent. Thanks sir. What's a gorgeous video!!! 🎉

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

    As one of my profs says, "Super-Excellent" video! Thanks for the easy to understand walk through

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

    So helpful and really well explained I love SymPy but I learned tricks from this video that I had never used! Thank you

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

    Take this Mathematica subscription! Great videos!

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

    Great work dude. Keep posting for us to learn. It really helped.

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

    Thanks for your efforts. Highly appreciated.
    Infact you are my online teacher.
    Thank you Sir

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

    Excellent lecture! You are a gem! Really appreciate your time and effort. Cheers!

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

    Ohh my, what a treat! Let's go!!

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

    Swear to god, this dude creates the best fuckin content on this fuckin platform.

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

    The default solution to `sols` on my system has turned out substantially more complex than shown in your video.
    Consequently, in order to obtain exactly the same results, smp.simplify() had to be added as such:
    sols[sp.diff(theta, t,t)].simplify()
    sols[sp.diff(z, t,t)].simplify()
    Frankly, I'm still awed by the fact that presumably, human engineers, had actually managed to create the SymPy algorithms capable of dealing with such complex expressions flawlessly.

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

    as a CS student, there were only a only a few vids abt sympy on yt, it really healped

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

    Thank you so much for the passionate courses! :)

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

    Thanks for keeping my request bro !✌

  • @sus_ch_iiser-k
    @sus_ch_iiser-k 9 หลายเดือนก่อน

    Excellent tutorial! Thank you very much. Please make one on Astropy also.

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

    Wow, this looks like a great alternative for a licensed software like MAPLE. Again, the best video on SymPy on youtube, great job!

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

    Best video ever! Appreciate!

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

    Great job buddy. Thanks for the dedication.

  • @polt558
    @polt558 11 หลายเดือนก่อน

    Aweasome! That was just what I needed to switch on Python

  • @AJ-et3vf
    @AJ-et3vf 2 ปีที่แล้ว +1

    Awesome video! Thank you!

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

    Hey Mr. P Solver, great contents on your channel ! new subscriber here. I have a small suggestion, you could flip your camera recording horizontally and it would look like you're looking towards the right area on the screen.

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

    Muito obrigado pelo excelente vídeo

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

    Everything I see on your videos, "Everything you do is great and keep it simple .. also even if it is not related to someone's field".

  • @fufaev-alexander
    @fufaev-alexander 2 ปีที่แล้ว +1

    Thank you very much! Can you make a tutorial on TenPy?

  • @Manish-qt1bz
    @Manish-qt1bz 2 ปีที่แล้ว +3

    In segment 46 of the code the differential dh0dt is written wrong. It should be " -gt - v0" instead of "gt - v0"

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

    Excellent video, thank you very much! Not entirely related but do you have any book/course recommendation for an introduction to differential equations?

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

    This is awesome!

  • @FreeburgPlayer
    @FreeburgPlayer 7 หลายเดือนก่อน

    Thank you, great tutorial!

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

    Would be nice if you present about holomorphic maps and iterations to generate fractals!

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

    6:36 for anyone confused, make sure tyo write variable. [THEN PRESS THE TAB KEY]

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

    Great stuff, thanks.

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

    Incredible good content. Thx a ton from Germany

  • @loxonin138
    @loxonin138 3 หลายเดือนก่อน

    Thanks for SymPy tutorial. You are my Senpai.🥰

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

    thank you very much legend!!!!

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

    Thanks !!

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

    Outstanding contents! Wow!

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

      One small request of making one dedicated video on Interactive plotting of some of these beautiful equations. You contents are truly amazing.
      Thanks

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

    How is your menu on pressing tab totally different from mine (yours have them sorted in instanced, functions , etc.)? Can you let me know (or make a video) on all the settings and extensions you have on your setup? Thank you!

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

    Good job 👌

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

    Can we use sympy to simulate the behaviour of quantum entanglement

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

    Just Great!

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

    Is there any function in sympy that solves improper partial fractional decomposition function?

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

    Thank you 🙏🙏🙏

  • @hernanmurillo4432
    @hernanmurillo4432 10 หลายเดือนก่อน

    Thanks for the video, is there a way to input a expression and then use it With sympy ?

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

    Kudos to you.

  • @MiT_Mankind-in-Training
    @MiT_Mankind-in-Training ปีที่แล้ว

    the r^3 thing was great :)

    • @MiT_Mankind-in-Training
      @MiT_Mankind-in-Training ปีที่แล้ว

      It's neither in case you've not been reading the bright red text :D

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

    Is this library can use with jupyter notebook only? Because I try run in vscode but it doesn't show the latex format in the vscode terminal

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

    Nice stuff

  • @tilkesh
    @tilkesh 10 หลายเดือนก่อน

    Thank you

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

    If I have an array containing complex exponential functions then how can I Integrate it ?

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

    Does anyone know how to define symbol as a binary variable? (so that you have b**2=b)

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

    At 26:20, I understand what is happening but I don't understand how the code works. f and g are first instantiated as `UndefinedFunction` type. How is it that I can call them right away with arguments. My understanding is you call a certain method of an object defined within its class type. But here we're calling the object itself? That feels kinda funky to me. What is going on?

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

    Thanks

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

    thanks, very useful video!
    I tried to calculate the integral that is taken by residue (from the theory of a function by a complex variable) but sumpy give useless answer. Do you know how help program and give some advice that it is necessary to solve it residue?
    so my problem:
    integrated (dw/((w^2-1)^2+w^2) from -inf to +inf)
    I now answer, it very simple: pi

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

    Is the wavefunction psi_10 not yet normalized?

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

    How do i setup jupyter to get all those cmd icons on top. I want to use them on w11 64 bit.!

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

    Yo how do you insert your pictures in the markdown cell?

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

    12 mins into, I got this error:
    multiple generators [y, sin(y**2)]
    No algorithms are implemented to solve equation y*sin(y**2) + z**
    It seems I cannot find x,y,z values that make he function F = 0. Any suggestions?

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

    You are awesome.

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

      let's say i solve a differential equation using dsolve. Now i want to use the output say y(t) = .......(something). Is there any way to use the result to solve for t when y=2?

  • @uniongrob8194
    @uniongrob8194 11 หลายเดือนก่อน

    Great thanks for your work, is there some library to work with chemistry? Abilities of python are amazing!

  • @mr.qadeer1122
    @mr.qadeer1122 2 ปีที่แล้ว

    please recommend best python book for such a scientific computing.......

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

    In your example of falling object colliding with platform your dh0dt must be equal to -g*t - v0? Not g*t-v0.

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

      Yes!! Thank you for spotting this

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

    How import sympy as smp in my laptop

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

    Can Senpai be used by a visually impaired person that uses a screen reader notepad plus plus and python code?

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

    thanks

  • @NoOne161
    @NoOne161 6 หลายเดือนก่อน

    I don't get why you said that it's a good practice to use smp.Rational(1/2) instead of just writing 1/2 or 0.5 there. In larger problems, will the latter be not more time-saving in nature?

  • @math4cheems
    @math4cheems 10 หลายเดือนก่อน

    Hi. Thanks for the video. I have a doubt: min 20:10 in line [46] dh0dt = g*t - v0? ... or dh0dt = -g*t - v0? Thanks again and excuse my bad english.

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

    thanks!

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

    Like a Boss.......................

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

    Looks like a typo has occurred in your part of the code (2*n*(sp.factorial(n+l)))) \
    If you look at the formula above you will see that it should be (2*n*(sp.factorial(n+1)))) \
    leaving us with differing numeric results after substitution further down.
    Consequently: Interpreting the above formula correctly with SymPy results in a linear relationship with plt.scatter(ns, ds)
    and not an exponential one.
    I strongly feel that the discrepancy in the interpretation of the original formula ought to be double-checked,
    before more students who are not entirely on par with quantum mechanics find themselves stranded.

  • @YR6MIN
    @YR6MIN 11 หลายเดือนก่อน

    mr. p solver be like :)
    perfect video

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

    hey guys who knows how to install jupyter notebook to your laptop? i couldn't do it without anaconda. is there any other methods to do that?

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

    Where are you from? Where are you currently located?

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

    So nice, I liked it twice.

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

      But you have to like it _thrice!_

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

    I think that there is a mistake in the first example.
    dh0tdt should be -gt-v0 instead of gt-v0 as presented.

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

    20:19 how is it gt - (v0t) shouldnt it be -gt - v0t

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

    Jupiter stuff has such a small font that its almost unreadable by my eyes.

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

    I wish you get admitted so we can see some formal lectures!

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

    Hydro wave equation: should be 2n[(n+l)!] in denominator and not 2n[(n+1)!].....

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

    hi , can you make a movie teaching deep learning tensor algebra using numpy to construct??

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

    Idea - What is energy? - My guess - If you iterate y = model(X) and loss = mean((X-y)**2) that is let y -> X an image then using only one image X it will succeed. But y will not become X completely there is a residual y = X + dX. Its the dX that is the universe energy. Change something with dX and the approximation of the function restores the energy to its vibrant small state. Small compared to the entire universe. Its like hydro if you place something infront of the flow of water it will move it same with dX differences. Thats is energy. So it open ups new opportunities. Energy is dependent on squaring a function the error. So if the err0(t[123]) ^ 2 = err1(t[123]) ^ 4 then you got much stronger energy. So accumulate energy from timed extraction for that super power.

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

    These free libraries will probably eventually make Matlab and Mathematica go bankrupt!

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

    if u use ``` from sympy import *``` it imports all the functionality of sympy without using smp.()

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

    mfw diff eq. class ain't so hard anymore :)

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

    Dude as someone that's new to python but an experienced developer with a Physics undergrad... Python is the best and the worst of everything. The tools are incredible... but EVERYTHING. Literally everything apart from Numpy and Pandas and a few others use this insanely lazy and horribly put together auto-generated documentation. That will be the death of Python I promise.

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

      Also... fun fact... when you highlighted those functions, you can run help(justAboutAnyPackage.thatMysteriousFunction) and it will print a **usually** more informative docstring than what's available on these $%#% autogenerated documentation sites. If you use an ide you'd have to run that in the terminal, but jupyter will print it out right in the output.

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

    nice tutorial, but pls don't call integrals antiderivatives xDD

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

    Call me a symp

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

    the music is really annoying, ditch it or at least turn it down, just my two cents

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

    This video takes my math friends to ⇨ SymPy :) Some people use: import sympy as sy, and .n() instead of .evalf() . Application for atom -- thanks for answering my childhood curiosity!

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

      Is this genuine? @MrPSolver

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

    This is a good tutorial for replacing www.wikipedia.org/wiki/Abramowitz_and_Stegun

  • @kk-qb3cj
    @kk-qb3cj 2 ปีที่แล้ว

    Thank you