Activity: the Lotka-Volterra model of an inter specific competition
Objective: Apply the MATLAB skilled we learned to a particular predator-prey model.
We are going to model the population of two species competing for the same limited resource. For example, you might think of wolves and foxes living in the same forest. We'll use a modification of the Lotka-Volterra model called "Competitive Lotka-Volterra equations":
dx/dt = r1x(1- (x+C12y)/K1), dy/dt = r2y(1-(y+C21x)/K2),
where x(t) and y(t) are the two populations. Further, we have the following positive constant coefficients: r1 and r2 are the natural growth rates of the respective species, K1 and K2 are the carrying capacities, C12 and C21 are the competition coefficients that show the negative impact that the first species has on the second one and, respectively, the negative impact that the second species has on the first one. For instance, if C12 is much bigger than C21, then we could think of a scenario when x is a small predator and y is a big predator and the big predator can always win a direct fight with the small one while the harm caused by the small predator is just that they eat the same food. In particular, if C12 = C21 = 0, then we would get two independent logistic equations.
K1 = 1600 K2 = 1600
r1 = 0.11 r2 = 0.10
Your task:
Write a MATLAB code that plots the phase portrait of the system. The values of the parameters r1, r2, K1, K2 are fixed and to be extracted from your matriculation number and you'll need to write a report that describes the behaviour of the system under different values of the coefficients C12 and C21. Your are supposed to
1. Find equilibrium solutions analytically. You will notice there are three significantly different cases: 1 -C12 C21 > 0, 1 - C12 C21 = 0, and 1 - C12 C21 < 0.
2. Sketch possible phase portraits in each of the three cases described above. You will notice that there are two-subcases in each case, so you'll need to draw 6 diagrams overall. Please plot a fat dot that represents the nonzero equilibrium.
3. Write a conclusion: what are possible types of behaviour of this system depending on the values of C12 and C21? Under which values of the coefficients C12 and C21 do we observe one of the species dying out? Is it possible that both species die out? When do the both species survive? Are the populations going to approach a particular limit or we'll see cycles like in the classical predator-prey model? Is the limiting behaviour of the system affected by the initial conditions?
For instance, here is an example of a phase portrait that shows that the equilibrium solution is unstable and that depending on the initial conditions, one of the species will die out.
![127_Figure.png](https://secure.tutorsglobe.com/CMSImages/127_Figure.png)
The initial conditions are shown by blue dots and the equilibrium (found analytically) is shown by the yellow dot.
Write a report, where you should include your name, your matric number, your values of the parameters r1, r2, K1, K2 and answers to all the questions above supported by calculations and diagrams prepared in MATLAB. Save your report as a PDF and submit it to your lab instructor.
Activity: model with a 2nd order differential equation
Objective: Apply the MATLAB skill we learned to find out some numerical info about the equation of a damped pendulum.
Recall that the equation d2x/dt2 + (g/L)sinx = 0 that we used in Activity describes the motion of an idealised pendulum, where the string weighs nothing and there is no friction and no energy loss. The motion is then periodic, where the period depends on the initial conditions (amplitude). Here, L is the length of the string.
Now we are going to introduce some reality by adding damping - an external force (say, due to friction) that causes the motion to stop eventually. The equation becomes
d2x/dt2 + C/M ⋅dx/dt + (g/L) sinx=0,
where C is the damping coefficient and M is the mass of the object on the string. You can simply Google "damped pendulum" to find out how this equation is derived.
C=0.16 M=1.6 L=11
We are going to use the initial condition x(0) = 3π/4, (dx/dt)(0) = 0, which means that the initial angular displacement is 135 degrees and the initial speed is zero.
Your task:
Write a MATLAB code that plots the solution of the damped equation and the solution of the undamped equation together. Answer the following questions:
1. Obviously, damping makes the amplitude of oscillations decrease with time. Does damping affect the period of oscillations too? Does it become smaller or bigger because of damping? Does the length of one full oscillation remain constant, increase, or decrease?
2. How long does it take for the amplitude of oscillations to become smaller than 0.1?
Write a report, where you should include your name, your matric number, your values of the constants and answers to both questions above supported by a diagram prepared in MATLAB (Yes, this task is simpler than #10 - just one diagram and a few phrases will do). Save your report as a PDF and submit it to your lab instructor.
Please don't submit text files, word documents, photographed handwritten reports etc. Equations and diagrams should be very clear and readable. You can use MS Word, Open Office, Google Drive or LaTeX to prepare your report and save it as a PDF.
Of course, you can discuss your report with the instructor during the lab session to make sure that it includes everything and doesn't contain obvious errors.
Attachment:- MATLAB Assignment.rar