No video

Finding Zeros of Functions In Python (Bisection Method and Scipy)

  Рет қаралды 54,373

Andrew Dotson

Andrew Dotson

Күн бұрын

Пікірлер: 60
@cicciobombo7496
@cicciobombo7496 6 жыл бұрын
If you replace tol with 0 in the if else statement you get a much better accuracy
@AndrewDotsonvideos
@AndrewDotsonvideos 6 жыл бұрын
Good catch! Thanks!
@zuzannagembus882
@zuzannagembus882 4 жыл бұрын
@@AndrewDotsonvideos Where exactly? In 6:47?
@pengjieren9601
@pengjieren9601 3 жыл бұрын
@@AndrewDotsonvideos lol, i was wondering that
@mpperfidy
@mpperfidy 3 жыл бұрын
@@AndrewDotsonvideos You are near-criminally underfollowed. Always interesting content.
@DragasGaming
@DragasGaming 6 жыл бұрын
You're doing gods work. Please more python videos.
@noellundstrom7447
@noellundstrom7447 6 жыл бұрын
You really got to the root of my issue Andrew, thank you!
@williambrunosalesdepaulali6582
@williambrunosalesdepaulali6582 3 жыл бұрын
Here i am discovering your channel again after so many years hahhas. Awesome!
@galenseilis5971
@galenseilis5971 5 жыл бұрын
You can use "elif" instead of nesting "if" inside "else".
@robertjcliu
@robertjcliu 3 жыл бұрын
I am watching your tutorial in Taiwan. Thank you.
@aliciaroberts3965
@aliciaroberts3965 2 жыл бұрын
This really helped me finish my python hw I put off to the last minute, so thank you!
@muhammedabdulmalik3687
@muhammedabdulmalik3687 2 жыл бұрын
Great job! You dissected it very well.
@al-washisarkerturan8913
@al-washisarkerturan8913 5 ай бұрын
Described very well
@bishwasgnawali
@bishwasgnawali 5 жыл бұрын
Can you use this method to find a complex root of a complex function?
@janlhesternavasca3160
@janlhesternavasca3160 3 жыл бұрын
What if you have two roots?
@JoseGonzalez-cb2gw
@JoseGonzalez-cb2gw 3 жыл бұрын
Thank you very much, excellent explanation of the procedure
@brianbecsi7482
@brianbecsi7482 4 жыл бұрын
you call me smart... it goes straight to my head
@aureeel
@aureeel 3 жыл бұрын
Please do more python videos, you make it so much easier to understand
@ferns191
@ferns191 5 жыл бұрын
Thank you so much!! You made this so easy to understand
@jptuser
@jptuser 4 жыл бұрын
what's the use of the tolerance ??? we did the same code in fortran for computational physics but didn't understand that tolerance
@danielriquelme5766
@danielriquelme5766 4 жыл бұрын
I like your binary search xD good video
@calebwhales
@calebwhales 6 жыл бұрын
Love the python videos mate
@kamehamehaDdragon
@kamehamehaDdragon 6 жыл бұрын
I love this kind of videos!
@arthurheinrich723
@arthurheinrich723 Жыл бұрын
In the bissection method, if values "a" and "b" are root, or any "c" value makes f() function returns zero, the routine enter in an infinite loop
@DRNi23
@DRNi23 4 жыл бұрын
Useful video! Thank you!
@ulilhidayat7467
@ulilhidayat7467 4 жыл бұрын
Yuu're doing gods work, thanks
@uaenaarmy-enhyFim
@uaenaarmy-enhyFim 5 жыл бұрын
Thank u! U saved my life
@speedspeed121
@speedspeed121 6 жыл бұрын
Could you do Newtons method in Python?
@AndrewDotsonvideos
@AndrewDotsonvideos 6 жыл бұрын
Yes actually!
@iamwhitewhale
@iamwhitewhale Жыл бұрын
do u guys have any idea why my code isn't working? after running the code a star will appear in left side and then nothing, i need to re-run the jupyter.
@theflaggeddragon9472
@theflaggeddragon9472 6 жыл бұрын
If there are multiple roots, the algorithm works regardless, you'll just find one of the roots instead of multiple. You could then search the other intervals by a bisection method to make sure you haven't missed any? (This doesn't work for arbitrary functions since you don't know when to stop, but polynomials, which have at most n roots for degree n, this would work pretty fast I think).
@kanadkrishanusengupta2578
@kanadkrishanusengupta2578 4 жыл бұрын
Which is the best book to learn numerical analysis ?????
@QsHsNation1
@QsHsNation1 6 жыл бұрын
Did you learn how to use python for physics mainly on your own or did your courses help you develop those skills? I'm going into my Junior year of physics (Quantum and Thermo this year!) and also starting my minor in comp sci, and I have very little knowledge of coding. Been trying to find resources online for learning to code for math and physics and what not, but i've been unsuccessful lol. We do have a course that works with coding for physics at my uni which I'll probably take next semester or next year. Just want to get ahead of the game though to be valuable during research.
@DrHami
@DrHami 6 жыл бұрын
Computational Physics by Nicholas J. Giordano is a great textbook that may help you "learn to code for math and physics." I suspect that you already know, more or less, how to code a simple program (there's a shitload of resources for that), but you don't have experience in solving physics/math problems numerically. If that's the case, then that textbook might come in handy. (There's many ways to get that book online without paying a dime >_>)
@QsHsNation1
@QsHsNation1 6 жыл бұрын
Thank you! Yeah, I understand the basics of coding, just don't know how to use the tools of it to solve problems. Alot of the libraries he imported in this video like matplotlib i didn't have so I guess I gotta figure out how to obtain that lol. I'll go check out that book *cough cough* by "purchasing it" *cough cough.
@megabyte3348
@megabyte3348 3 жыл бұрын
Hello! Is there any book or free course that explain numerical methods in a simple way? What do you recommend?
@thisisFaye1
@thisisFaye1 2 жыл бұрын
I'm using Computational Physics by Mark Newman right now and I find it's my most useful textbook. There are some accompanying materials posted by the author for free online.
@muhammedabdulmalik3687
@muhammedabdulmalik3687 2 жыл бұрын
How can I get a pdf version please?
@phvisser1
@phvisser1 2 жыл бұрын
how do you get 2 answers for x with the bisection method?
@abhishankpaul
@abhishankpaul Жыл бұрын
I had tried so much to find roots of Bessel functions of 1st,2nd or 3rd order, everytime the code screwed up things
@mqfkkc6621
@mqfkkc6621 3 жыл бұрын
hi, may i ask if there is another possible way to get two roots without using fsolve?
@alexanderrobertson5530
@alexanderrobertson5530 6 жыл бұрын
Hey, Andrew I had an idea and I would like your input on it. I could be completely and utterly wrong, but I can't shake the idea so I want someone who knows some QM and SR to give me some feedback. Quantum field theory describes antimatter as matter moving backwards through time. If you look at a Feynman diagram of a matter-antimatter annihilation event the antimatter is described as moving in the negative time direction well matter goes in the positive time direction while being mediated by force carrying bosons. This is considered a mathematical trick that has no physical significance and leads to wacky joke theories like the one electron universe theory. Well what if antimatter is just regular matter that is tachyonic. Tachyons are a mathematical trick with lorentz transformations. You can't approach the speed of light because it requires infinite energy to get to because when v = c the entire equation is dividing by 0. Well if you approach it from the opposite direction so you start off being faster than the speed of light then it requires infinite energy to slow down for the exact same reason you can't speed up to being faster than light. When you do this you end up dealing with the square root of a negative number so an imaginary number. Well, we all know that travelling faster than the speed of light is equivalent to travelling backwards in time then is it possible that antimatter is simply the tachyonic equivalent of matter. If you trace a tachyonic worldline it reverses the direction of time. In QFT a little mathematical quirk is just considering antimatter to be time reversed matter so it is just regular matter travelling backwards through time just like a tachyon would. Thanks for any input.
@young_la_flame
@young_la_flame 4 жыл бұрын
I was searching how to do the bisection search. how did I ended up here.
@anatolyrozhkov851
@anatolyrozhkov851 4 жыл бұрын
8:00 How on Earth the first function and the second are connected? How does the bisection function understands that it needs to find a different root when the f(x) is changed to the quadratic????!!!
@UmurCanKaya
@UmurCanKaya 4 жыл бұрын
If the interpreter can't find an object inside the function it starts to look for it in the main code. It would be much safer to give f as an argument of the bisection function.
@GavinCOC
@GavinCOC 5 жыл бұрын
thank you!!
@aniruddha4672
@aniruddha4672 5 жыл бұрын
more python videos pls!!
@nitindogra6195
@nitindogra6195 Жыл бұрын
hey at 2:18 shouldn't it be () ? or may be i need to re-understand this, thanks
@nitindogra6195
@nitindogra6195 Жыл бұрын
never mind i got it :) -*- >0
@johnchristian5027
@johnchristian5027 6 жыл бұрын
Nice!
@asifmahmud6331
@asifmahmud6331 4 жыл бұрын
If I put "c = (xl + xr) / 2" line outside the while loop (just after xr = b), it takes forever to run. Can you tell me why is that?
@johnjohnerd6921
@johnjohnerd6921 4 жыл бұрын
if you define c before the loop starts it will never get updated and therefore the greater than/less than conditions don't effect c.
@PauloVictor-hp9op
@PauloVictor-hp9op 5 жыл бұрын
how can i proceed to find all roots of a function in some range (or interval)?
@PauloVictor-hp9op
@PauloVictor-hp9op 5 жыл бұрын
fsolve can give us roots just in specified point (guesses).
@supercat908
@supercat908 2 жыл бұрын
Ben Affleck doing python tutorials?
@jnscollier
@jnscollier 5 жыл бұрын
Thanks Ryan Reynolds
@googlegoogle1610
@googlegoogle1610 2 жыл бұрын
there is always one typo hhhhhhhhhhhhhhh at least :)
@ariusmaximilian8291
@ariusmaximilian8291 6 жыл бұрын
first
@valentinewiggin9705
@valentinewiggin9705 4 жыл бұрын
this code is so bad...
Unlock the Secret of Nonlinear Curve Fitting - Python LMFIT
18:18
黑天使遇到什么了?#short #angel #clown
00:34
Super Beauty team
Рет қаралды 48 МЛН
OMG what happened??😳 filaretiki family✨ #social
01:00
Filaretiki
Рет қаралды 13 МЛН
Root Finding in Python
18:00
HagesLab
Рет қаралды 12 М.
Monte Carlo Integration In Python For Noobs
15:32
Andrew Dotson
Рет қаралды 151 М.
Lessons Learned During My PhD So Far
13:05
Andrew Dotson
Рет қаралды 152 М.
Basically How Science Will End (Skit)
2:40
Andrew Dotson
Рет қаралды 41 М.
Intro to Scipy Optimization: Minimize Method
26:26
TokyoEdtech
Рет қаралды 37 М.
How To Estimate Pi Numerically In Python
16:41
Andrew Dotson
Рет қаралды 21 М.
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
Teaching myself an upper level pure math course (we almost died)
19:28
Bisection Method (Theory, Examples & Codes) | Numerical Methods
24:06