Question
MATLAB Task For this task, each iteration or unit of one is 'one week' . In order to fully understand our model, here is some
MATLAB Task
For this task, each iteration or unit of one is 'one week'. In order to fully understand our model, here is some background on the cycle of life model. The two principles in balance are reproduction and death. As long as rabbits exist, they will make more rabbits. If there are both foxes and food for the foxes (rabbits), then foxes will make more foxes. Rabbits get hunted by the foxes and eaten, so if there are foxes, rabbits will die. Foxes will die faster as the number of foxes goes up (less food to go around). When we put this all together, we arrive at Equations 1 and 2 which predict the population changes in rabbits and foxes respectively. Please note that these numbers represent groups of foxes and rabbits known as skulks and fluffles respectively. This means that you can have 0.1 fluffles, but you cannot have -1 fluffles. Make sure to prevent negative numbers from occurring in your code! I recommend setting negative numbers to zero to prevent odd behavior.
In Equations 1 and 2, 'F' is the fox skulk population array, 'R' is rabbit fluffle population array, 'x' is the current week, 'Repro' is the reproduction rate of the corresponding animal, 'Death/Eaten' is the removal of the population of the corresponding animal. The subscript R and F stand for Rabbits and Foxes respectively. (X-1) stands for the previous week, so the current week's populations depend on the previous week's populations modified by how many animals were born and how many animals died.
Initial values:
rabbits(1) = 200;
foxes(1) = 125;
RabRepro=.8;
RabEaten=0.01;
FoxRepro=0.001;
FoxDeath=0.2;
time=1:100;
Using these initial values, plot a graph where the bunnies are a black dashed line and the foxes are a dotted magenta line. To plot the data set, make the x-axis the array that holds time from 1 to 100. For foxes and rabbits, they should be two separate y values with arrays that are the same length as time. In these arrays, the indexes should all match, so on week 3, time should be 3, rabbits(3) should be the population of the rabbits on week 3, and foxes(3) should be the population of the foxes on week 3. Make the first plot using the initial values above. For the next plots, only switch the initial population values (rabbits(1) and foxes(1))
In the Nature World, special cases exist. For condition 2, find the initial population values for rabbits and foxes that lead to a perfectly steady state world where rabbits and foxes are perfectly in balance (enough rabbits and foxes spawn and die that the total population is steady). Graph this condition where the rabbits and foxes live in perfect harmony (Please note both groups being dead is not 'perfect harmony'). In this condition, the previous week's population will equal the current week's population, so this should have an analytical solution.
This system can be somewhat chaotic. Take 10 - 30 minutes and experiment with the system by changing the initial population values for rabbits and foxes to numbers between 1 and 500. You may choose any numbers in this range for week 1 for each population. You are looking for 'interesting behavior'. In the report, tell us why you thought this set of data was interesting! Examples of 'interesting behavior include - the population crossing each other multiple time, surprising spikes, non-steady state populations surviving for an extended period of time, etc. This part of the assignment is open-ended, so there is not only 1 or 2 'right' answers.
Finally, using the subplot function, make one Figure with all 3 graphs on it (Stack the graphs vertically)! Make sure each plot has the same x-axis range as that plots above and below it.
in short form of the conditions
1) Make the basic graph described above without changing any numbers
2) Find a condition when Rabbits and Foxes live in perfect harmony (neither number change from week to week).
3) Find a condition that exhibits 'interesting behavior' - Examples of 'interesting behavior include - the population crossing each other multiple time, surprising spikes, non-steady state populations surviving for an extended period of time, etc. This part of the assignment is open-ended, so there is not only 1 or 2 'right' answers. Defend your findings effectively!
To complete I would recommend getting the model working with the given initial values first, and then work on the other conditions. Set the values for the first week then count through each week (from 2 to 100) and make an array to store the values as you count through. After counting through the weeks, use the plots to see if the populations are reasonable. There are some values that will give you odd behavior - this is okay! You may need to adjust your plot ranges when you move to the subplots so the graphs can be compared side by side!
If you are getting numbers that are very big, remember to set the ranges of your axis for the plot. Some initial conditions will lead to very high Rabbit counts (~10256)!
1) The .m file containing your commented code(s) from Matlab
2) A information containing an introduction to the problem, pseudocode, a figure (.png/.jpg) of your 3 graphs compiled together into 1 figure using the subplot function in Matlab, a justification of the 'interesting behavior' in plot 3, and a conclusion (all 3 conditions, what odd behavior did you encounter? Did you encounter any difficulties? Which condition was the hardest?). Please also transcribe your commented code into an Appendix in the information (copy and paste or screen shots are both okay).
R(x) = R(x 1) + Repror * R(x 1) Eatenr * R(x 1) * F(x - 1) F(x) = F(x 1) + Reprop * R(x 1) * F(x 1) Death: * F(x - 1) (1) (2) R(x) = R(x 1) + Repror * R(x 1) Eatenr * R(x 1) * F(x - 1) F(x) = F(x 1) + Reprop * R(x 1) * F(x 1) Death: * F(x - 1) (1) (2)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started