Closed alec-glisman closed 2 years ago
Here is what I have gathered thus far:
udwadiaKalaba()
method.Q
, not the constraint method in Q_con
Q_con(5)
element stem from the gradient of the total mass matrix with respect to the body D.o.F. I should revisit this derivation. Physically, a rotation of an isolated collinear body does not affect the added mass, so a mistake must have been made.On the last point, this is not strictly true. The total (magnitude) of the added mass is invariant to a rigid spatial translation, but the "amount" of added mass in each spatial direction will change, so there should be a non-zero gradient term.
Found a bug in the calculation of gradZeta: was not correctly setting gradient of cross product to zero if the particle was a locater particle
On the first assignment of N2 (initial configuration) the first 3 rows of the 5 gradient are all zeros. After the first RK4 sub-step, the positions are all still collinear, but these elements become non-zero. Find out why
Found a bug in calculation of chi matrix element: was not indexing the quaternion component correctly.
I even tried two separate algorithms for the gradient of the rotated position with respect to the quaternion, but got the same results. The simulation is still unstable on component (5) in the previously discussed locations. I am very confused
Found a bug in the calculation of m_particles_accelerations. RBM components were overwriting the body components, rather than outputting the particle components
Redid derivations to combine rbm_conn and psi matrices into one term and removed the need for scalar_w in the process. Still experiencing the same issue
After refactoring much of SystemData
calculations, it appears the bug is located in SystemData::chiMatrixElement()
.
Specically, the calculation of g_matrix
seems to be an issue. The form it has does not match my analytical derivations.
After adding more safeties and refactoring the problematic function, it seems stable now
I decided to first validate the system with the collinear swimmer before moving to the wall problem for simplicity in tracking down any issues. Physically, the system should purely translate and not experience any rotation, as all articulation and configuration are collinear. However, after the first step in RK4 integration, the 2nd component of the unit body quaternion develops some rotation. This issue will serve as the documentation for tracking down this bug and fixing it.