function [ RHS ] = Ns_sol_ode(~,Y,params)

A = params(1);
Ns = params(2);
L = params(3);
%%%%%%%%%%%%%%% If there is a trap, undo the following:
% Omega=params(4);

fA3=4*A*A*A;

kk=1:Ns;        
Xi(kk)  = Y(kk);
Vel(kk) = Y(kk+Ns);

RHS1(kk) = Vel(kk);

RHS2(1) = fA3*(exp(-A*abs(2*L-abs(Xi(1)-Xi(Ns)))))-fA3*(exp(-A*abs(Xi(2)-Xi(1)         )));
RHS2(Ns)= fA3*(exp(-A*abs(      Xi(Ns)-Xi(Ns-1))))-fA3*(exp(-A*abs(2*L-abs(Xi(1)-Xi(Ns)))));
kk=2:Ns-1;
RHS2(kk)= fA3*(exp(-A*abs(Xi(kk)-Xi(kk-1))))-fA3*(exp(-A*abs(Xi(kk+1)-Xi(kk))));
    
RHS=[RHS1';RHS2'];
end