Homeostasis refers to the biological robustness of some internal property even as external prop- erties change. One such example is our ability to maintain a steady body temperature in both cold and warm weather. Consider the homeostasis.mat file on Moodle, which contains t data describing external tem- peratures and corresponding y data describing the body temperature of lab mice (all in Celsius). Write a Matlab script that loads this data and find the cubic polynomial of best fit, i.e., the parameters a, b, c, and d for which the polynomial f (t) = a + bt + ct2 + dt3 fits the data. Do so by explicitly building the matrix and vector and solving for these parameters. (That is, DO NOT use the built-in polyfit function!) Your script should create a single plot that plots both the data and the best-fit function. Make sure to include all relevant labels and a legend!
Consider the following compartmental model for a zombie apocalypse, that tracks the fractions of individuals that are alive (A), zombies (Z), and dead (D):dA = −αAZγ dtdZ = αAZγ − βZ dtdD = βZ dtHere, α is the “zombification” rate that describes how efficiently zombies turn the living into the undead and β is the “death” rate that describes how quickly zombies waste away from lack of resources, and γ is a parameter that controls the “zombification” process. Consider the choices β = 1 and γ = 0.9.Write a Matlab script that uses ode45 to solve the differential equation for an initial condition representing a state where 99% of individuals are alive and 1% are zomibes. Find (i) a choice of α where at least half of the alive population survive in the long run and (ii) another choice of α where over 90% of the population eventually becomes a zombie and dies. Make a nice, neat plot for each case. In each figure plot the corresponding solutions for the alive, zombie, and dead populations, appropriately colored and with a nice legend.
0 comments