function dPdt=phos5box(t,P); % A function file that calculates the phosphorus time differentials for % a 5-box, global zero-dimensional phosphorus model. % % Started 2004:10:20 D. Glover, WHOI % Modif'd 2004:10:21 DMG to get it running, add documentation % Modif'd 2004:10:28 DMG to futz with Far and Fpr % Modif'd 2008:11:06 DMG to change names to PS06_1 % Declare some parameter values with the following naming scheme: % SAT = 1 (i.e. box number one) % ANT = 2 % SIP = 3 % DIP = 4 % DAT = 5 % % Fluxes are given as Fnm, i.e. flux from box n to box m % Declare some GLOBAL variables (set in PS06p1_main.m) global TAU REFF V SPYR; % Set some parameters that only dy/dt cares about F=[ 0 0 0 0 20; % Flux 12 0 0 32 4; % Matrix 0 24 0 0 0; 0 8 24 0 0; 8 16 0 0 0]; F=F.*1e6; Far=2.5e5; Fpr=7.5e5; % River water fluxes Pr=1.3; % River P concentration dPdt=zeros(5,1); % initialize output column vector % Calculate Productivity surface boxes Prod=[P(1)*V(1)/TAU P(3)*V(3)/TAU]; % Differential equations dPdt(1)=((Far*Pr-F(1,5)*P(1)+F(5,1)*P(5)+F(2,1)*P(2)-Prod(1))*SPYR)/V(1); %SAT dPdt(2)=((-F(2,1)*P(2)+F(3,2)*P(3)+F(4,2)*P(4)-F(2,4)*P(2)-F(2,5)*P(2)+F(5,2)*P(5))*SPYR)/V(2); %ANT dPdt(3)=((Fpr*Pr-F(3,2)*P(3)+F(4,3)*P(4)-Prod(2))*SPYR)/V(3); %SIP dPdt(4)=((REFF*Prod(2)-F(4,3)*P(4)-F(4,2)*P(4)+F(2,4)*P(2))*SPYR)/V(4); %DIP dPdt(5)=((REFF*Prod(1)+F(1,5)*P(1)-F(5,1)*P(5)-F(5,2)*P(5)+F(2,5)*P(2))*SPYR)/V(5); %DAT