Successive optimization in JuMP

I thought I recognized this problem:

Is there a better way of using the while loop with these conditions

A while loop like this is fine. You could also define

iter = 1
tol = Inf
while abs(tol) > ftol && iter <= maxiter
    iter += 1
    # ...
    tol =  adj_trials[iter] - adj_trials[iter-1]
end

how the final solution could be made less sensitive to the initial?

I haven’t run your code, but my guess is that there are lots of local optima. Are you finding different x solutions with the same objective values? Or are the objective values different as well?

What does adj represent in reality?