%------------------------------------------------------------
% Generates the nuclear potential function based on the 
%   specified charges and their positions
%------------------------------------------------------------
function V_nucl = nucl_potential(r,Z,R)

M = length(Z);

V_nucl = 0;
for A = 1:M
    V_nucl = V_nucl + -Z(A)/norm(r-R(A,:)); 
end