Python Code for Predator-Prey Model

  Рет қаралды 14,490

Mike Saint-Antoine

Mike Saint-Antoine

Күн бұрын

Hi everyone! This video is about how to simulate the Lotka-Volterra Predator-Prey model using Python.
Previous video going over the basics of the Predator-Prey model:
• Predator-Prey Model (L...
All the code from my videos is available on my Github:
github.com/mikesaint-antoine/...
This is the original lesson I made about simulating ODEs in Python, which is a bit more in depth:
• Lesson 2: Python Code ...
Interesting paper on bacterial predator-prey dynamics-
aem.asm.org/content/36/1/11
If you're are trying to catch up on the basics of Python, differential equations, or cell biology, here are some good resources:
Python Basics-
• Beginner Python Tutorials
Differential Equations
• Differential Equations
Thanks for watching and let me know if you have any questions!

Пікірлер: 17
@MikeSaintAntoine
@MikeSaintAntoine Жыл бұрын
Hi everyone, thanks for watching! Here's the link to the code on my Github in case you want to try it for yourself (also feel free to add me as a friend on Github if you want 🙂) : github.com/mikesaint-antoine/Comp_Bio_Tutorials/blob/main/more_comp_bio/predator-prey.py
@JK-pr5om
@JK-pr5om 3 жыл бұрын
Great video thanks man. Funny how you can teach me this better than the course I’m paying for at university
@MikeSaintAntoine
@MikeSaintAntoine 3 жыл бұрын
Hey JK, thanks for watching! Let me know if you have any questions!
@flaviemostenne6286
@flaviemostenne6286 2 жыл бұрын
Hi Mike! I am working on a prey-predator model and I am really inspired by your videos, they are really great . I emailed you for your help. Thank you so much in advance :)
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hi Flavie, thanks for watching! Yes I got your email and replied, looking forward to hearing back from you.
@rafiqulislam1085
@rafiqulislam1085 9 ай бұрын
Thanks a lot an excellent video. Could you please make a video with code how to draw bifurcation diagram?
@MikeSaintAntoine
@MikeSaintAntoine 9 ай бұрын
Hey Rafiqul, ok I will try to work on that for a future video!
@saswatipal7280
@saswatipal7280 2 жыл бұрын
Hi. I am using this model in my problem scenario with Holling III functional response. I went through several codes & videos. However, I am not able to get oscillations in predator-prey species. Also, when I tweak the values of the variables, the plot changes drastically. Can you please explain why with specific values only one gets desired plot (oscillating predator-prey species) or help me get it correct?
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hi Saswati, thanks for watching! I got your email and responded. Hopefully we can work together to get this figured out!
@sohaibsiddiqui2434
@sohaibsiddiqui2434 2 жыл бұрын
The normal predator prey model plot is an 'x' vs 'y' plot (one in which we get a closed curve. Are you getting this? When we convert this same model to an 'x' vs 't' plot and 'y' vs 't' plot, we get the periodic waves.
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
@@sohaibsiddiqui2434 Hi Sohaib, that's a great question! Yes, the plot you're describing is called a phase space plot. I have just uploaded a new video explaining how to make this plot for the Predator-Prey model: kzbin.info/www/bejne/Zmq1nqKpZa-neZo I hope this helps! Thanks for watching!
@albertinalussanje2431
@albertinalussanje2431 3 жыл бұрын
Hello I am economics student and I am really interested to use the Lotka Volterra model I have the variables but I do not Know how to estimate the model in any app could you please help me?
@MikeSaintAntoine
@MikeSaintAntoine 3 жыл бұрын
Hi Albertina! Sounds like an interesting project. Yes I can try to help. Can you tell me a bit more about what you're trying to do? If it's easier, you can also email me your code at mikest@udel.edu.
@gabrieltakeuchi136
@gabrieltakeuchi136 7 ай бұрын
how can i plot both of them in the same sets of axis
@MikeSaintAntoine
@MikeSaintAntoine 7 ай бұрын
Hi Gabriel, thanks for watching! To plot them both on the same axis, just change the plotting code to this: plt.plot(t, y[:, 0], color="b", label="Fish (hundreds)") plt.plot(t, y[:, 1], color="r", label="Bears (hundreds)") plt.xlabel("Time") plt.ylabel("Population (hundreds)") plt.legend(loc='upper right') plt.show()
@carlaschweitzer8632
@carlaschweitzer8632 2 жыл бұрын
Bonjour, je voudrais savoir comment on utilise concrètement le point d’équilibre ?
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hi Carla! Unfortunately I do not speak French, however I put your comment in Google translate and will try to answer it anyway: The way to find the equilibrium point, or "steady state" is to set both ODEs equal to 0. When all of the system's ODEs are set to 0, that means there's no change happening in the system. For simple systems, this can be calculated with some pretty easy algebra. Once you find these equilibrium points, you can do further analysis on their stability -- basically you can see how the system will respond to a perturbation around the equilibrium points. This part is a bit more complicated, but maybe I will try to make a future video on it. Thanks for watching! -------------------- Salut Carla ! Malheureusement je ne parle pas français, cependant j'ai mis votre commentaire dans Google translate et vais essayer d'y répondre quand même : Le moyen de trouver le point d'équilibre, ou "état stable", consiste à définir les deux ODE sur 0. Lorsque tous les ODE du système sont définis sur 0, cela signifie qu'aucun changement ne se produit dans le système. Pour les systèmes simples, cela peut être calculé avec une algèbre assez simple. Une fois que vous avez trouvé ces points d'équilibre, vous pouvez effectuer une analyse plus approfondie de leur stabilité - en gros, vous pouvez voir comment le système réagira à une perturbation autour des points d'équilibre. Cette partie est un peu plus compliquée, mais peut-être que j'essaierai de faire une future vidéo dessus. Merci d'avoir regardé!
Logistic Growth Model Overview
5:57
Mike Saint-Antoine
Рет қаралды 1,2 М.
Python Code for Logistic Growth Model
11:38
Mike Saint-Antoine
Рет қаралды 4 М.
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 6 МЛН
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 108 МЛН
Predator-Prey Model (Lotka-Volterra equations)
8:31
Endless Engineering
Рет қаралды 35 М.
Fitting the Predator-Prey Model to Data (Python)
28:26
Mike Saint-Antoine
Рет қаралды 2,8 М.
Lesson 12: Python Code for Stochastic Oscillator
28:01
Mike Saint-Antoine
Рет қаралды 2,6 М.
Predator-Prey Population Models || Lotka-Volterra Equations
9:30
Exploring Maths
Рет қаралды 27 М.
The Problem with Wind Energy
16:47
Real Engineering
Рет қаралды 369 М.
Python WiFi
11:16
David Bombal
Рет қаралды 1,6 МЛН
More Gillespie Practice: Logistic Growth Stochastic Simulation
16:38
Mike Saint-Antoine
Рет қаралды 1,3 М.
Mathematical Biology. 14: Predator Prey Model
47:07
UCI Open
Рет қаралды 45 М.
Predator-Prey Model (Lotka-Volterra)
9:01
Mike Saint-Antoine
Рет қаралды 5 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 27 МЛН
Will the battery emit smoke if it rotates rapidly?
0:11
Meaningful Cartoons 183
Рет қаралды 34 МЛН