public void DebugInfo(StringBuilder b, int debugPage, PhysicalParticle particle) { if (debugPage == 1) { b.AppendLine($"Constraint Forces:\n{TotalConstraintForces?.Transpose().ToMatrixString()}"); b.AppendLine($"Lagrange Multipliers:\n{LagrangeMultipliers?.Transpose()?.ToMatrixString()}"); b.AppendLine($"Jacobian:\n{Jacobian?.ToMatrixString()}"); b.AppendLine($"Velocity:\n{Velocity?.Transpose()?.ToMatrixString()}"); b.AppendLine($"Coefficient Matrix: (det {CoefficientMatrix?.Determinant()})\n{CoefficientMatrix?.ToMatrixString()}"); b.AppendLine($"Equation Constants:\n{EquationConstants?.ToMatrixString()}"); } }
/// <summary> /// GetCrammerMatrices Method returning the Cramer Matrices /// </summary> /// <returns></returns> private List <Matrix <double> > GetCramerMatrices() { int size = CoefficientMatrix.RowCount; List <Matrix <double> > matrices = new List <Matrix <double> >(); Matrix <double> matrix; int index = 0; while (index < size) { matrix = CoefficientMatrix.Copy(size, size); for (int j = 0; j < size; j++) { matrix[j][index] = RightSideVector[j]; } matrices.Add(matrix); index++; } return(matrices); }