Matlab Code for Predator-Prey Model

  Рет қаралды 13,588

Mike Saint-Antoine

Mike Saint-Antoine

Күн бұрын

Hi everyone! This video is about how to simulate the Lotka-Volterra Predator-Prey model using Matlab.
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/mik...
This is the original lesson I made about simulating ODEs in Python, which is a bit more in depth:
• Lesson 2: Python Code ...
Thanks for watching and let me know if you have any questions!

Пікірлер: 24
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
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/matlab_code/predator_prey.m
@beyzacetin6117
@beyzacetin6117 Жыл бұрын
Sir, thank you so much. Thanks to you, I was able to finish a very important article.
@MikeSaintAntoine
@MikeSaintAntoine Жыл бұрын
Thanks for watching Beyza 🙂
@momsspaghetti3885
@momsspaghetti3885 2 жыл бұрын
My task looks way harder and if i don't solve it by the weekend i'm not allowed to write the exam function [N1, N2, t, f, N0] = lotka_volterra(N1i, N2i, eps1, eps2, gamma1, gamma2)
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hi, sorry for the late response on this comment! Hmm, it looks to me like this is basically the same model as in the video, except with different parameter names? Like N1 and N2 are the names of the prey and predators (or predators and prey), N1i and N2i are their starting values, and ps1, eps2, gamma1, gamma2 are the constant parameters? If you need help with your code though, feel free to send me and email at mikest@udel.edu. Maybe I can help with debugging or any other problems you're having with it. Thanks for watching!
@anarosasb57803
@anarosasb57803 10 ай бұрын
Thank you so much, with this I could complete my project. I just have a question how can I see the equations x(t) and y(t)?
@MikeSaintAntoine
@MikeSaintAntoine 9 ай бұрын
Hi Ana! That's a great question and unfortunately I don't really have a good answer. This way of simulating the ODEs uses a numerical solver, which computes the trajectories of these variables with the given parameters, but unfortunately doesn't give us a symbolic solution for the x(t) and y(t) functions in terms of the parameters. Maybe there's a way to symbolically solve them in Matlab to get these equations, but unfortunately I don't know how to do it because I don't have much experience with Matlab. Usually I use other software like Wolfram Alpha or Mathematica to do symbolic calculations like these. Anyway thanks for watching and sorry I couldn't be more helpful!
@elearningmathinqatar4340
@elearningmathinqatar4340 Жыл бұрын
That's really great, may i ask you a question? I did three species model on matlab, but i have a problem , i have 4 steady states, how may I draw every steady states, do i have to add some comment over it?
@MikeSaintAntoine
@MikeSaintAntoine Жыл бұрын
Hi! I'm a little confused by your question. However if you want you can email me your code at mikest@udel.edu and I can try to take a look at it and help. Thanks for watching! 🙂
@mountainwolvesbd
@mountainwolvesbd 11 ай бұрын
Great video Sir.
@MikeSaintAntoine
@MikeSaintAntoine 10 ай бұрын
Thanks for watching! 🙂
@learningtour5569
@learningtour5569 2 жыл бұрын
Sir, can u explain how to solve non-linear coupled differential equation (BVP) by rungekutta and shooting method?
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hey! Sorry, unfortunately I'm not very knowledgeable on that topic. However I did find another video by a guy who explains numerical methods for solving ODEs, so maybe this video will be helpful: kzbin.info/www/bejne/kH7Kmp6QYtGWiZo Thanks for watching and sorry I couldn't be more helpful with your question!
@nadilaarsya3371
@nadilaarsya3371 Жыл бұрын
Sorry sir, why doesn't it work when I run the program?
@MikeSaintAntoine
@MikeSaintAntoine Жыл бұрын
Hi Nadila, please send me an email at mikest@udel with your code and I will take a look! Maybe I can figure out why it isn't working.
@m.raflyyanuar9886
@m.raflyyanuar9886 2 жыл бұрын
I want to combine the plot. I tried using hold on and hold off but couldn't make it work. Can you please tell me how? Thanks in advance.
@m.raflyyanuar9886
@m.raflyyanuar9886 2 жыл бұрын
I solved it! I removed the subplots and then used the hold on. Thanks for the video!
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
@@m.raflyyanuar9886 Ah, sorry I didn't reply fast enough! Glad you solved it, and thanks for watching!
@linneajohansen297
@linneajohansen297 2 жыл бұрын
Hello! have you used explicit euler to solve the lotka-volterra equation in the video?
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Hi Linnea! Unfortunately I don't know how to do that. I've gotten a bit spoiled with ODE solving and basically just use the built-in functions to solve them, so I don't have much experience writing the numerical solution methods from scratch. However maybe this video will be useful to you: kzbin.info/www/bejne/q5yxk3ptotp-ntE Sorry I couldn't be more helpful!
@sethwhite4869
@sethwhite4869 2 жыл бұрын
Thank you so much. Saved us for a project!
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
No problem Seth, thanks for watching!
@sidraiftikhar985
@sidraiftikhar985 2 жыл бұрын
Great
@MikeSaintAntoine
@MikeSaintAntoine 2 жыл бұрын
Thanks for watching Sidra! Let me know if you have any questions.
Euler's Method in Python: Predator-Prey Example
23:42
Mike Saint-Antoine
Рет қаралды 1,8 М.
Introduction to Meshgrid Function and 3D Plotting in MATLAB
9:17
Aleksandar Haber PhD
Рет қаралды 21 М.
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 19 МЛН
How do Cats Eat Watermelon? 🍉
00:21
One More
Рет қаралды 11 МЛН
Nastya and balloon challenge
00:23
Nastya
Рет қаралды 69 МЛН
Markov Chain Monte Carlo (MCMC) for Parameter Estimation (Matlab)
50:05
Mike Saint-Antoine
Рет қаралды 8 М.
Predator-Prey Population Models || Lotka-Volterra Equations
9:30
Exploring Maths
Рет қаралды 31 М.
Predators and Prey - Numberphile
16:53
Numberphile
Рет қаралды 219 М.
How to Set Up and Manage Experiments in MATLAB
5:50
MATLAB
Рет қаралды 2,9 М.
The Truth About Learning Python in 2024
9:38
Internet Made Coder
Рет қаралды 196 М.
Predator-Prey Model (Lotka-Volterra equations)
8:31
Endless Engineering
Рет қаралды 36 М.
Predator-Prey Model (Lotka-Volterra) Overview and Steady States
7:41
Mike Saint-Antoine
Рет қаралды 32 М.
Euler method (Python)
8:48
Dr Jon Shiach
Рет қаралды 5 М.
Bresenham's Line Algorithm - Demystified Step by Step
16:10
NoBS Code
Рет қаралды 51 М.
Predator-prey systems (KristaKingMath)
13:38
Krista King
Рет қаралды 78 М.
Spongebob ate Patrick 😱 #meme #spongebob #gmod
00:15
Mr. LoLo
Рет қаралды 19 МЛН