The function S[i,j,q,,eeta,con,ratio,alfa] gives the structure factor S_{i,j}(q) for a mixture defined by:
-> nco=number of species
-> eeta=packing fraction
-> con=list with the molar fractions of each species,e.g, {x_1,x_2,x_3}, 
        x_1 being the corresponding to the species with the largest diameter
-> ratio=list with the diameter ratios, e.g., {1,ratio_2,ratio_3} where ratio_n=sigma_n/sigma_1=sigma_n
-> alfa=the alpha parameter of the RFA method (it can be obtained by means of the function ALFA[nco,eeta,con,ratio])

Off[General::spell];Off[General::spell1]

S[ico_,jco_,qnu_,nco_,eeta_,con_,ratio_,alfa_] := 
  Module[{PI, c, sigma, rho, zeta, rhot, eta, lam, lamp, g, L, A, 
    delA, inv,ML,MA,MJota,jo,reglas,hhtil,GG,SS},
     PI = N[Pi]; 
     Do[c[n] = con[[n]], {n, 1, nco}]; 
    Do[sig[n, n] = ratio[[n]], {n, 1, nco}]; 
    rhototal = (6*eeta)/(PI*Sum[c[i]*sig[i, i]^3, {i, 1, nco}]); 
    rho[n_] = rhototal*c[n]; 
    sig[i_, j_] := 1/2*(sig[i, i] + sig[j, j]) /; i != j; 
    zeta[n_, ncomp_] := Sum[rho[i]*sig[i, i]^n, {i, 1, ncomp}]; 
    rhot[ncomp_] := zeta[0, ncomp]; 
    eta[ncomp_] := 1/6*PI*zeta[3, ncomp]; 
    lam[ncomp_] := (2*PI)/(1 - eta[ncomp]); 
    lamp[ncomp_] := (PI^2*zeta[2, ncomp])/(1 - eta[ncomp])^2; 
    g[i_, j_, nc_] := 
     (lam[nc] + (lamp[nc]*sig[i, i]*sig[j, j])/(2*sig[i, j]) + 
        (lamp[nc]^2*((sig[i, i]*sig[j, j])/sig[i, j])^2)/
         (18*lam[nc]))/(2*PI); 
    L[i_, j_, 2, nc_] := 2*PI*alfa*sig[i, j]*g[i, j, nc]; 
    L[i_, j_, 0, nc_] := 
      lam[nc] + lamp[nc]*sig[j, j] + 2*lamp[nc]*alfa - 
       lam[nc]*Sum[rho[k]*sig[k, k]*L[k, j, 2, nc], {k, 1, nc}]; 
    L[i_, j_, 1, nc_] := 
      lam[nc]*sig[i, j] + 1/2*lamp[nc]*sig[i, i]*sig[j, j] + 
       (lam[nc] + lamp[nc]*sig[i, i])*alfa - 
       1/2*lam[nc]*sig[i, i]*
        Sum[rho[k]*sig[k, k]*L[k, j, 2, nc], {k, 1, nc}]; 
        
        A[i_,j_,nc_]:=rho[i]*
((1-s sig[i,i]+1/2 s^2 sig[i,i]^2-xx[i])/s^3*
L[i,j,0,nc]+
(1-s sig[i,i]-xx[i])/s^2*L[i,j,1,nc]+
(1-xx[i])/s*L[i,j,2,nc]);

L[i_,j_,nc_]:=L[i,j,0,nc]+L[i,j,1,nc]*s+L[i,j,2,nc]*s^2;
ML[nc_]:=Table[L[i,j,nc],{i,nc},{j,nc}];
MA[nc_]:=Table[A[i,j,nc],{i,nc},{j,nc}];
in[nc_]:=Inverse[(1+alfa s)IdentityMatrix[nc]-MA[nc]];
MJota[nc_,eet_,co_,rati_]:=MJota[nc,eet,co,rati]=
1/(2Pi) ML[nc].in[nc];

jo=MJota[nco,eeta,con,ratio]//Together//Chop//Simplify;

reglas=Table[xx[n]->Exp[-sig[n,n]s],{n,1,nco}];
GG[i_,j_,eet_,co_,rati_]:=
GG[i,j,eet,co,rati]=jo[[i,j]]/(s^2*Exp[sig[i,j]*s])//.reglas;
(* In  Eq. (3.17) of S. B. Yuste, A. Santos and M. López de Haro, J. Chem. Phys., vol. 108, 3683 (1998)   *)
(* the function $\tilde h_{ij}(q)$ is given with a wrong factor \sigma_{ij}^3.  The expressión employed   *)
(* here (see the function hhtil) is the correct one in which this factor is removed                       *)
hhtil[i_,j_,q_]:=
-4*PI*Re[ GG[i,j,eeta,con,ratio]/s /.s->(I*q)];  
SS[i_,j_,q_]:=c[i]+c[i]^2*rhototal*hhtil[i,i,q]/;i==j;
SS[i_,j_,q_]:=c[i]*c[j]*rhototal*hhtil[i,j,q]/;i!=j;
SS[ico,jco,qnu]//N
]

EXAMPLES

An example for a binary mixture:

ncoa=2;   
eetaa=49/100;
cona={1/2,1/2};
ratioa={1,3/10};

alfa2a=ALFA[ncoa,eetaa,cona,ratioa]

alfa2a=0.0278389556195642473`;

S[1,1,1.,ncoa,eetaa,cona,ratioa,alfa2a]

S[2,2,1.,ncoa,eetaa,cona,ratioa,alfa2a]

S[1,2,1.,ncoa,eetaa,cona,ratioa,alfa2a]

An example for a binary mixture:

nco2b=2;   
eeta2b=49/100;
con2b={1/16,15/16};
ratio2b={1,3/10};

alfa2b=ALFA[nco2b,eeta2b,con2b,ratio2b]

alfa2b=0.0188595747730736498`;

S[1,1,1.,nco2b,eeta2b,con2b,ratio2b,alfa2b]

S[1,1,2.,nco2b,eeta2b,con2b,ratio2b,alfa2b]

S[1,2,2.,nco2b,eeta2b,con2b,ratio2b,alfa2b]

An example for a ternary mixture:

nco3=3;  
eeta3=49/100;
con3={1/102,1/102,100/102};
ratio3={1,3/10,1/10};

alfa3=ALFA[nco3,eeta3,con3,ratio3]

alfa3=0.0183704939832915581`;

S[1,1,1.,nco3,eeta3,con3,ratio3,alfa3]

S[1,3,2.,nco3,eeta3,con3,ratio3,alfa3]