
function F = root4_copy(x, mc, theta1, v, alppha_n, sigma, chi_1, chi_2, chi_3, alppha_r, Tro1, Trf1, A, r, B, pi)   %finds x(1)=Srf1, x(2)=Sro1, x(3)=S, x(4)=Np

%wf = (((1+alppha_n)*chi_1*(x(6))*((x(3))^(sigma)))/(1-t))
%wo = (((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-t))
%wI = (((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-t))

%x(1) = Np; x(2) = Srf1; x(3)= S;  x(4) = Sro1;  x(5) = Nro1;  x(6) = Nrf1
%x(7) = alppha_n; x(8) = t
Delta =   16.000000000000004;

 F(1) = A*(x(1))  - ((theta1*(1-alppha_r)*(x(2)))/((((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-(x(8))))/A)) - ((theta1*(1-alppha_r)*(x(4)))/((1-v)*((((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-(x(8))))/A)))
 F(2) =   (x(4))  - (((((x(5))/(Tro1)))^(alppha_r))*((theta1*(1-alppha_r)*mc*(x(4)))/((1-v)*((((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-(x(8))))/A)))^(1-alppha_r))^(theta1)
 F(3) =   (x(2))  - ((((1-v)*((Tro1/Trf1)^(alppha_r))*(((((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-(x(8))))/(((1+alppha_n)*chi_1*(x(6))*((x(3))^(sigma)))/(1-(x(8)))))^(alppha_r)))^(theta1/(1-theta1)))*(x(4)))
 F(4) =   (x(6))  - ((theta1*alppha_r*mc*(x(2)))/(((1+alppha_n)*chi_1*(x(6))*((x(3))^(sigma)))/(1-(x(8)))))
 F(5) =   (x(5))  - ((theta1*alppha_r*mc*(x(4)))/((((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-(x(8))))*(1-v)))
 F(6) =     mc    - ((1/theta1)*(1-v)*((Tro1)^(alppha_r))*(((((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-(x(8))))/(alppha_r))^(alppha_r))*((((((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-(x(8))))/A)/(1-alppha_r))^(1-alppha_r))*(((x(3))/(1+(((1-v)*((Tro1/Trf1)^(alppha_r))*(((((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-(x(8))))/(((1+alppha_n)*chi_1*(x(6))*((x(3))^(sigma)))/(1-(x(8)))))^(alppha_r)))^(theta1/(1-theta1)))))^((1-theta1)/(theta1))))
 F(7) =   (x(7))  - (((x(2))/(x(3)))/((x(2))/(x(3))))^(Delta)
 F(8) =   (x(8))  - (v+(r*B)-B*pi)/((((1+alppha_n)*chi_1*(x(6))*((x(3))^(sigma)))/(1-(x(8))))*(x(6))+(((1+alppha_n)*chi_2*(x(5))*((x(3))^(sigma)))/(1-(x(8))))*(x(5))+(((1+alppha_n)*chi_3*(x(1))*((x(3))^(sigma)))/(1-(x(8))))*(x(1)));
