systemSolver->runBasicKinematic();

This commit is contained in:
Aik-Siong Koh
2023-06-11 07:15:20 -06:00
parent d848450907
commit 3b08cd72df
182 changed files with 2789 additions and 535 deletions

View File

@@ -4,14 +4,14 @@
#include "MatrixSolver.h"
#include "GESpMatParPvMarkoFast.h"
#include "CREATE.h"
#include "GESpMatParPvPrecise.h"
using namespace MbD;
void MbD::SystemNewtonRaphson::initializeGlobally()
{
this->assignEquationNumbers();
system->partsJointsMotionsDo([&](std::shared_ptr<Item> item) { item->useEquationNumbers(); });
system->partsJointsMotionsForcesTorquesDo([&](std::shared_ptr<Item> item) { item->useEquationNumbers(); });
this->createVectorsAndMatrices();
matrixSolver = this->matrixSolverClassNew();
}
@@ -40,3 +40,23 @@ void MbD::SystemNewtonRaphson::basicSolveEquations()
{
dx = matrixSolver->solvewithsaveOriginal(pypx, y->negated(), false);
}
void MbD::SystemNewtonRaphson::handleSingularMatrix()
{
std::string str = typeid(*matrixSolver).name();
if (str == "class MbD::GESpMatParPvMarkoFast") {
matrixSolver = CREATE<GESpMatParPvPrecise>::With();
this->solveEquations();
}
else {
str = typeid(*matrixSolver).name();
if (str == "class MbD::GESpMatParPvPrecise") {
str = "MbD: Singular Matrix Error. ";
system->logString(str);
matrixSolver = this->matrixSolverClassNew();
}
else {
assert(false);
}
}
}