% Inequality constraints function for the charged rod. Per Octave
% documentation for sqp(), the constraints are of the form h(x) >= 0.
% This constraint is intended to keep the points 'sorted', so that 
% x(i+1) > x(i). The 'greater than' is ensured by minimum spacing 10*eps.

function h = constraints1(x)

h = x(1:end) - [-realmax; x(1:end-1)] - (10*eps);