Solving a set of ordinary differential equations and functions dependent on each other
6 views (last 30 days)
Show older comments
I have these functions and ODE's from the paper “A Mathematical Model of Honey Bee Colony Dynamics to Predict the Effect of Pollen on Colony Failure” that I wanted to simulate on MATLAB, but I dont seem to know how to do that since each equation/function is really dependent on the other. I tried using ode45 to solve each on individually but this doesn't really give an accurate picture since the values aren't updating. Furthermore, I believe that I need a for loop to solve this but I have no idea how to put ode45 in a for loop or how to code the order of these equations in order to do so. Does anyone have any advice?
Bagheri, Shahin, and Mehdi Mirzaie. “A Mathematical Model of Honey Bee Colony Dynamics to Predict the Effect of Pollen on Colony Failure.” PLOS ONE, vol. 14, no. 11, 22 Nov. 2019, p. e0225632, 10.1371/journal.pone.0225632. Accessed 1 June 2020.
3 Comments
Answers (1)
Steven Lord
on 1 Jun 2021
Let V = [B_o; B_c; H; F_p; F_n; f_p; f_n]. I think I read those correctly from the image. Then write your function so it computes dV/dt as a function of t and V.
function dVdt = mysystem(t, V)
B_o = V(1);
B_c = V(2);
% etc
dVdt = zeros(size(V));
% Now define the elements of dVdt in terms of B_o, B_c, etc.
% You can define other intermediate variables as you need them too.
% I'd consider putting the Description from each row of the table as a
% comment before you implement that row, for easy traceability between your
% implementation and the paper's description of what you're implementing.
dVdt(1) = % dB_o/dt
end
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!