pulled A matrix generation outside loop, along with Cholesky factorization. removed potential energy terms from the matrix weighting and replaced with constraint stiffness values. results are much more stable, but still slow.