First of all, nice dialogs, nice integration with the rest of the UI. Unfortunately, I always get an error when updating the assembly:
Running the Python command 'Asm4_updateAssembly' failed:
Traceback (most recent call last):
File "/home/hubertz/.FreeCAD/Mod/FreeCAD_Assembly4-solver/updateAssemblyCmd.py", line 55, in Activated
solved = sol.solve(x_i)
File "/home/hubertz/.FreeCAD/Mod/FreeCAD_Assembly4-solver/solver/Solver.py", line 44, in solve
solution = minimize(self.eval, x0, method="trust-ncg",
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/_minimize.py", line 627, in minimize
return _minimize_trust_ncg(fun, x0, args, jac, hess, hessp,
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/_trustregion_ncg.py", line 39, in _minimize_trust_ncg
return _minimize_trust_region(fun, x0, args=args, jac=jac, hess=hess,
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/_trustregion.py", line 182, in _minimize_trust_region
while m.jac_mag >= gtol:
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/_trustregion.py", line 71, in jac_mag
self._g_mag = scipy.linalg.norm(self.jac)
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/_trustregion.py", line 51, in jac
self._g = self._jac(self._x)
File "/tmp/.mount_FreeCAafOCKi/usr/lib/python3.8/site-packages/scipy/optimize/optimize.py", line 327, in function_wrapper
return function(*(wrapper_args + args))
File "/home/hubertz/.FreeCAD/Mod/FreeCAD_Assembly4-solver/solver/Solver.py", line 27, in grad
return self.val.grad
'NoneType' object has no attribute 'grad'
in line 44, there is
solution = minimize(self.eval, x0, method="trust-ncg", jac=self.grad, hess=self.hess, options={"gtol": 1e-8, "disp": True})
but the eval method is defined as:
def eval(self, x):
shouldn’t some x values be provided ?
The best test-case to check whether the solver can be used for real-world problems is the hexapod. For that, we need to set the length of a segment, or the distance of a point to a plane, but this constraint doesn’t seem to exist (yet).
I’m really enthusiastic to make this thing work, thank-you for the work.