Closed Pranjal-Srivastava-2023 closed 7 months ago
what's the error message?
There is no error message. The code is missing two lines:
res = scipy.optimize.minimize(fun=cluster, x0=vals_init, tol=1e-3, method="BFGS") cluster.set_vals(res.x) # Update the class instance with the final optimized positions
yes but I dont understand that. If I do that, the shape is all weird when plotting
I think I understand now. Thank you for letting me know.
cluster = Cluster(r_na, r_cl) vals_init = cluster.get_vals() print('initial Na positions:\n', r_na) print('initial Cl positions:\n', r_cl) print('initial positions flattened shape:\n', vals_init ) print('initial V :', cluster.V() )
Optimize the configuration
res = scipy.optimize.minimize(fun=cluster, x0=vals_init, tol=1e-3, method="BFGS") cluster.set_vals(res.x) # Update the class instance with the final optimized positions