%Model of SHR movement in the vasculature and endodermis
%Variables:
%S_v: concentration of SHR monomer in vasculature
%S_e: concentraiton of SHR monomer in endodermis
%S_2e: concentraiton of SHR homodimer in endodermis
%C: concentration of SCR in endodermis
%S_1C: concentration of 1:1 SHR-SCR complex in endodermis
%S_2C: concentration of 2:1 SHR-SCr complex in endodermis
%
%Author: Natalie M. Clark, nmclark2@ncsu.edu
%Date: May 19, 2016

function dy = shr_model_fixed(t,y,params)
        %intialize variables
        dy = zeros(6,1);
        
        S_v = y(1); S_e = y(2);
        S_2e = y(3); C = y(4);
        S_1C = y(5); S_2C = y(6);
        
        %parameter values
        k_1 = params(1); a_1 = params(2); a_2 = params(3); d_1 = params(4);
        d_2 = params(5); k_2 = params(6); d_3 = params(7); k_3 = params(8);
        K_1D = params(9); K_2D = params(10); d_4 = params(11); k_4 = params(12);
        d_5 = params(13); k_5 = params(14); d_6 = params(15);
        
        %equations
        dy(1) = k_1-a_1*S_v+a_2*S_e-d_1*S_v;
        dy(2) = a_1*S_v-a_2*S_e-d_2*S_e;
        dy(3) = k_2*(S_e)^2-d_3*S_2e;
        dy(4) = k_3*((K_1D^2*C+K_1D*S_1C+S_2C)/(K_1D^2*K_2D+K_1D*K_2D*S_e+K_1D^2*C+K_2D*S_2e+K_1D*S_1C+S_2C))-d_4*C;
        dy(5) = k_4*S_e*C-d_5*S_1C;
        dy(6) = k_5*S_2e*C-d_6*S_2C;

end