torno a bruteforce
modified numerical solution for variational minimum