charlesdavid / JEDi

JEDi: Java Essential Dynamics Inspector
GNU General Public License v3.0
5 stars 0 forks source link

Code Review: Reduced C and Dyn Matrices #7

Closed charlesdavid closed 5 years ago

charlesdavid commented 5 years ago

I am requesting a code review of the formulae used to compute the reduced c-matrices and reduced dynamical matrices. The two methods are in the class PCA.java: static Matrix get_reduced_C_matrix(Matrix Q), and static Matrix get_reduced_DYN_matrix(Matrix DYN). The key lines of code are: double cov = (Q.get(a1, b1) + Q.get(a2, b2) + Q.get(a3, b3)); double dyn = -(DYN.get(a1, b1) + DYN.get(a2, b2) + DYN.get(a3, b3)); The original formulae were written in a vectorized form for Matlab, so I want to be sure that the conversion to the component version here is correct.

cavery12 commented 5 years ago

The code works fine. I checked the output (from JED) and a reduced Covariance from the MATLAB version of the code and they agree with maximum deviation of 1.0E-6.

charlesdavid commented 5 years ago

Great. Is that also the case for the reduced inverse matrices (dynamical)?

charlesdavid commented 5 years ago

Thanks for the feedback.