Python integration using scipy quad function

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Thank you for the great overview of the quad function. I think it's amazing how it works under the hood, since it requires few evaluations to reach its error tolerance.

I have one small comment on Approach 1: the function you wish to integrate can be defined not just with global variables, but inside another function (created with either def or lambda). So you don't need to make the variables global, and expose them to the risk of something changing them.
So, you'd keep f(x, p), but when writing code for a specific circumstance, you'd have my_f(x), which only does "return f(x, my_computed_p)".
That way, you can have the generally useful f, which can coexist with the specifically useful my_f.
But you can of course just pass the parameters as you show at the end of the video. Thanks!

DanHaiduc
Автор

really appreciate this man. thanks so much

hrperformance
Автор

Pretty well explained, thank you so much.

carlosortiz
Автор

Thank you so much, this video was so clear and helpful!

benwinstanleymusic
Автор

can you explain how to do it when you want to have a variable?, like on the third example the p, but without giving p a value, and also could you explain how to integrate when a variable is on the integration limits?
Thanks! great video by the way

enriquesimpson
Автор

Hi very informative but i have a question i can a in the last example follow a pattern (0, 2, 4, 6...) and so on withot wrint a whole lots of I(n)?

johanolander
Автор

good video sir, can u make another on double integral

tagoreji