Author here. Yep, obviously this is more commonly done with dedicated optimization libraries, but the fun part was doing it in Pytorch to use autograd and as a way to visualize optimizers etc :)
Nice visualizations! Brings back fond memories of playing with Maplesoft in the 1990s to build up intuition about physical systems. In a nonlinear optimization class I was taking, I wanted to find the optimal truss configuration of a stack of hexapods [1] just as you're doing, but I got stuck on the Lagrange multipliers and gave up. You've shown it's much easier today using autodiff.
It looks like the method you used has a lot in common with a finite elements analysis. At least the simple version of it that structural engineers use in software like sap2000 and RISA. Do you think it would work if the matrix in the equation were a lot bigger?
Comments
Author here. Yep, obviously this is more commonly done with dedicated optimization libraries, but the fun part was doing it in Pytorch to use autograd and as a way to visualize optimizers etc :)
Nice visualizations! Brings back fond memories of playing with Maplesoft in the 1990s to build up intuition about physical systems. In a nonlinear optimization class I was taking, I wanted to find the optimal truss configuration of a stack of hexapods [1] just as you're doing, but I got stuck on the Lagrange multipliers and gave up. You've shown it's much easier today using autodiff.
[1] https://www.aerotech.com/products/hexapods
So the robot swarm can assemble itself into a bridge, love it!
It looks like the method you used has a lot in common with a finite elements analysis. At least the simple version of it that structural engineers use in software like sap2000 and RISA. Do you think it would work if the matrix in the equation were a lot bigger?