Good version for ASMT and MBDyn

This commit is contained in:
Aik-Siong Koh
2023-11-09 14:16:05 -07:00
parent 11a5cff30b
commit f026153c38
69 changed files with 14514 additions and 1495 deletions

View File

@@ -940,7 +940,7 @@ void MbD::ASMTAssembly::createMbD(std::shared_ptr<System> mbdSys, std::shared_pt
void MbD::ASMTAssembly::outputFile(std::string filename)
{
std::ofstream os(filename);
os << std::setprecision(std::numeric_limits<double>::digits10 + 1);
os << std::setprecision(static_cast<std::streamsize>(std::numeric_limits<double>::digits10) + 1);
// try {
os << "OndselSolver" << std::endl;
storeOnLevel(os, 0);
@@ -1144,7 +1144,7 @@ std::shared_ptr<ASMTPart> MbD::ASMTAssembly::partPartialNamed(std::string partia
auto fullName = prt->fullName("");
return fullName.find(partialName) != std::string::npos;
});
auto part = *it;
auto& part = *it;
return part;
}

View File

@@ -121,7 +121,7 @@ namespace MbD {
{
for (int ii = 0; ii < this->size(); ii++)
{
this->at(ii) = array->at(i + ii);
this->at(ii) = array->at((size_t)i + ii);
}
}
//template<>
@@ -182,4 +182,4 @@ namespace MbD {
{
this->at(i) *= factor;
}
}
}

View File

@@ -45,7 +45,7 @@ void AtPointConstraintIqcJc::useEquationNumbers()
void AtPointConstraintIqcJc::fillPosICError(FColDsptr col)
{
Constraint::fillPosICError(col);
col->at(iqXIminusOnePlusAxis) -= lam;
col->atiminusNumber(iqXIminusOnePlusAxis, lam);
col->atiplusFullVectortimes(iqEI, pGpEI, lam);
}

View File

@@ -46,7 +46,7 @@ void AtPointConstraintIqcJqc::useEquationNumbers()
void AtPointConstraintIqcJqc::fillPosICError(FColDsptr col)
{
AtPointConstraintIqcJc::fillPosICError(col);
col->at(iqXJminusOnePlusAxis) += lam;
col->atiplusNumber(iqXJminusOnePlusAxis, lam);
col->atiplusFullVectortimes(iqEJ, pGpEJ, lam);
}

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "BasicIntegrator.h"
#include "CREATE.h"
#include "StableBackwardDifference.h"

View File

@@ -14,15 +14,15 @@ using namespace MbD;
void BasicQuasiIntegrator::firstStep()
{
istep = 0;
this->preFirstStep();
preFirstStep();
iTry = 1;
orderNew = 1;
this->selectFirstStepSize();
this->incrementTime();
this->runInitialConditionTypeSolution();
//this->reportTrialStepStats();
this->postFirstStep();
//this->reportStepStats();
selectFirstStepSize();
incrementTime();
runInitialConditionTypeSolution();
//reportTrialStepStats();
postFirstStep();
//reportStepStats();
}
bool BasicQuasiIntegrator::isRedoingFirstStep()
@@ -32,15 +32,15 @@ bool BasicQuasiIntegrator::isRedoingFirstStep()
void BasicQuasiIntegrator::nextStep()
{
this->preStep();
preStep();
iTry = 1;
this->selectOrder();
this->selectStepSize();
this->incrementTime();
this->runInitialConditionTypeSolution();
//this->reportTrialStepStats();
this->postStep();
//this->reportStepStats();
selectOrder();
selectStepSize();
incrementTime();
runInitialConditionTypeSolution();
//reportTrialStepStats();
postStep();
//reportStepStats();
}
void BasicQuasiIntegrator::runInitialConditionTypeSolution()

View File

@@ -78,7 +78,7 @@ namespace MbD {
else {
inst = std::make_shared<AtPointConstraintIqcJqc>(frmi, frmj, axis);
}
} // "class MbD::Tran
}
else if(str.find("TranslationConstraintIJ") != std::string::npos) {
if (std::dynamic_pointer_cast<EndFrameqct>(frmi)) {
inst = std::make_shared<TranslationConstraintIqctJqc>(frmi, frmj, axis);

View File

@@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram />

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="MbD::Solver" Collapsed="true">
<Position X="0.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AKAAAgAAAAAAgAAAEAEAAIABAAAAAAAACIAAIAAAAAI=</HashCode>
<FileName>Solver.h</FileName>
</TypeIdentifier>
</Class>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

View File

@@ -52,40 +52,40 @@ void ConstVelConstraintIJ::postInput()
{
aA01IeJe->postInput();
aA10IeJe->postInput();
Constraint::postInput();
ConstraintIJ::postInput();
}
void ConstVelConstraintIJ::postPosICIteration()
{
aA01IeJe->postPosICIteration();
aA10IeJe->postPosICIteration();
Item::postPosICIteration();
ConstraintIJ::postPosICIteration();
}
void ConstVelConstraintIJ::preAccIC()
{
aA01IeJe->preAccIC();
aA10IeJe->preAccIC();
Constraint::preAccIC();
ConstraintIJ::preAccIC();
}
void ConstVelConstraintIJ::prePosIC()
{
aA01IeJe->prePosIC();
aA10IeJe->prePosIC();
Constraint::prePosIC();
ConstraintIJ::prePosIC();
}
void ConstVelConstraintIJ::preVelIC()
{
aA01IeJe->preVelIC();
aA10IeJe->preVelIC();
Item::preVelIC();
ConstraintIJ::preVelIC();
}
void ConstVelConstraintIJ::simUpdateAll()
{
aA01IeJe->simUpdateAll();
aA10IeJe->simUpdateAll();
Item::simUpdateAll();
ConstraintIJ::simUpdateAll();
}

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include <memory>
#include "ConstVelConstraintIqcJc.h"

View File

@@ -15,6 +15,6 @@ using namespace MbD;
void MbD::ConstantGravity::fillAccICIterError(FColDsptr col)
{
for (auto& part : *(root()->parts)) {
col->atiplusFullColumn(part->iqX(), gXYZ->times(part->m));
col->atiplusFullColumntimes(part->iqX(), gXYZ, part->m);
}
}

View File

@@ -104,7 +104,7 @@ void Constraint::setqsudotlam(FColDsptr col)
void Constraint::fillPosICError(FColDsptr col)
{
col->at(iG) += aG;
col->atiplusNumber(iG, aG);
}
void Constraint::removeRedundantConstraints(std::shared_ptr<std::vector<int>> redundantEqnNos)

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include <memory>

View File

@@ -0,0 +1,297 @@
-----------------------------------------------------------------------------
# [Data Block]
begin: data;
problem: initial value;
end: data;
#-----------------------------------------------------------------------------
# [Problem Block]
begin: initial value;
initial time: 0.0;
final time: 8.0;
time step: 0.01;
max iterations: 100;
tolerance: 1e-06;
derivatives tolerance: 0.0001;
derivatives max iterations: 100;
derivatives coefficient: auto;
end: initial value;
#-----------------------------------------------------------------------------
# [Control Data Block]
begin: control data;
max iterations: 1000;
default orientation: euler321;
omega rotates: no;
print: none;
initial stiffness: 1.0, 1.0;
structural nodes: 4;
rigid bodies: 3;
joints: 6;
end: control data;
#-----------------------------------------------------------------------------
# [Design Variables]
#Generic bodies
#body: 2
set: integer body_2 = 2; #body label
set: real mass_2 = 3.805252376198168; #mass [kg]
set: real volume_2 = 0.0004816775159744516; #volume [m^3]
#body: 3
set: integer body_3 = 3; #body label
set: real mass_3 = 15.238784954845523; #mass [kg]
set: real volume_3 = 0.0019289601208665218; #volume [m^3]
#body: 4
set: integer body_4 = 4; #body label
set: real mass_4 = 2.865603331977783; #mass [kg]
set: real volume_4 = 0.0003627345989845295; #volume [m^3]
#Nodes
#node: 1
set: integer structural_node_1 = 1; #node label
#node: 2
set: integer structural_node_2 = 2; #node label
#node: 3
set: integer structural_node_3 = 3; #node label
#node: 4
set: integer structural_node_4 = 4; #node label
#Joints
#joint: 1
set: integer joint_1 = 1; #joint label
#joint: 2
set: integer joint_2 = 2; #joint label
#joint: 3
set: integer joint_3 = 3; #joint label
#joint: 4
set: integer joint_4 = 4; #joint label
#joint: 5
set: integer joint_5 = 5; #joint label
#joint: 6
set: integer joint_6 = 6; #joint label
#Nodes: initial conditions
#node: 1
set: real Px_1 = -0.06210573361337854; #X component of the absolute position [m]
set: real Py_1 = 0.048526435375479564; #Y component of the absolute position [m]
set: real Pz_1 = -4.033966837940965e-17; #Z component of the absolute position [m]
set: real Vx_1 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_1 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_1 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_1 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_1 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_1 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 2
set: real Px_2 = 0.011666006676941875; #X component of the absolute position [m]
set: real Py_2 = 0.15999999999999778; #Y component of the absolute position [m]
set: real Pz_2 = -1.2084363289349542e-19; #Z component of the absolute position [m]
set: real Vx_2 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_2 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_2 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_2 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_2 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_2 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 3
set: real Px_3 = 0.2111281366952498; #X component of the absolute position [m]
set: real Py_3 = 0.16; #Y component of the absolute position [m]
set: real Pz_3 = -2.0217697810416158e-18; #Z component of the absolute position [m]
set: real Vx_3 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_3 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_3 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_3 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_3 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_3 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 4
set: real Px_4 = -0.1812239275015207; #X component of the absolute position [m]
set: real Py_4 = 0.16000000169909329; #Y component of the absolute position [m]
set: real Pz_4 = -4.340477856936436e-12; #Z component of the absolute position [m]
set: real Vx_4 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_4 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_4 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_4 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_4 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_4 = 0.0; #Z component of the absolute angular velocity [rad/s]
#-----------------------------------------------------------------------------
# [Intermediate Variables]
#Moments of inertia and relative center of mass
#body 2:
set: real Ixx_2 = 0.031674420620509; #moment of inertia [kg*m^2]
set: real Iyy_2 = 0.029604112147595; #moment of inertia [kg*m^2]
set: real Izz_2 = 0.002867529429125; #moment of inertia [kg*m^2]
set: real Rx_2 = 0.0; #X component of the relative center of mass [m]
set: real Ry_2 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_2 = 2.0843632893495426e-20; #Z component of the relative center of mass [m]
#body 3:
set: real Ixx_3 = 0.09813066341583701; #moment of inertia [kg*m^2]
set: real Iyy_3 = 0.095433846761275; #moment of inertia [kg*m^2]
set: real Izz_3 = 0.077043262824289; #moment of inertia [kg*m^2]
set: real Rx_3 = 0.0; #X component of the relative center of mass [m]
set: real Ry_3 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_3 = 2.1769781041615487e-20; #Z component of the relative center of mass [m]
#body 4:
set: real Ixx_4 = 0.010133521085753; #moment of inertia [kg*m^2]
set: real Iyy_4 = 0.006853402672398001; #moment of inertia [kg*m^2]
set: real Izz_4 = 0.00669113151275; #moment of inertia [kg*m^2]
set: real Rx_4 = 0.0; #X component of the relative center of mass [m]
set: real Ry_4 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_4 = -4.306356366563123e-20; #Z component of the relative center of mass [m]
#-----------------------------------------------------------------------------
# [Nodes Block]
begin: nodes;
structural: structural_node_1,
static,
Px_1, Py_1, Pz_1, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_1, Vy_1, Vz_1, #<absolute_velocity> [m/s]
Wx_1, Wy_1, Wz_1; #<absolute_angular_velocity> [rad/s]
structural: structural_node_2,
dynamic,
Px_2, Py_2, Pz_2, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_2, Vy_2, Vz_2, #<absolute_velocity> [m/s]
Wx_2, Wy_2, Wz_2; #<absolute_angular_velocity> [rad/s]
structural: structural_node_3,
dynamic,
Px_3, Py_3, Pz_3, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_3, Vy_3, Vz_3, #<absolute_velocity> [m/s]
Wx_3, Wy_3, Wz_3; #<absolute_angular_velocity> [rad/s]
structural: structural_node_4,
dynamic,
Px_4, Py_4, Pz_4, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_4, Vy_4, Vz_4, #<absolute_velocity> [m/s]
Wx_4, Wy_4, Wz_4; #<absolute_angular_velocity> [rad/s]
end: nodes;
#-----------------------------------------------------------------------------
# [Elements Block]
begin: elements;
#-----------------------------------------------------------------------------
# [Bodies]
body: body_2,
structural_node_2, #<node_label>
mass_2, #<mass> [kg]
Rx_2, Ry_2, Rz_2, #<relative_center_of_mass> [m]
diag, Ixx_2, Iyy_2, Izz_2, #<inertia matrix> [kg*m^2]
orientation, 3, 1.0, 0.0, 0.0, 2, 0.0, 0.9999999999999999, 9.62964972193618e-35;
body: body_3,
structural_node_3, #<node_label>
mass_3, #<mass> [kg]
Rx_3, Ry_3, Rz_3, #<relative_center_of_mass> [m]
diag, Ixx_3, Iyy_3, Izz_3, #<inertia matrix> [kg*m^2]
orientation, 3, 0.0, 0.0, 1.0, 2, 1.0, 0.0, 0.0;
body: body_4,
structural_node_4, #<node_label>
mass_4, #<mass> [kg]
Rx_4, Ry_4, Rz_4, #<relative_center_of_mass> [m]
diag, Ixx_4, Iyy_4, Izz_4, #<inertia matrix> [kg*m^2]
orientation, 3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0;
#-----------------------------------------------------------------------------
# [Joints]
joint: joint_1,
clamp,
structural_node_1, #<node_label>
-0.06210573361337854, 0.048526435375479564, -4.033966837940965e-17, #<absolute_pin_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0; #<absolute_orientation_matrix>
joint: joint_2,
axial rotation,
structural_node_1, #<node_1_label>
0.2521057336133785, 0.11147356462452043, 0.13500000000000004, #<relative_offset_1> [m]
orientation, 3, 0.0, 0.0, 1.0, 2, -1.0, 2.220446049250313e-16, 0.0, #<relative_orientation_matrix_1>
structural_node_3, #<node_2_label>
-0.021128136695249794, 0.0, 0.135, #<relative_offset_2> [m]
orientation, 3, 0.0, 0.0, 1.0, 2, -1.0, 2.220446049250313e-16, 0.0, #<relative_orientation_matrix_2>
string, "model::drive(1, Time)"; #<angular_velocity> [rad/s]
joint: joint_3,
revolute hinge,
structural_node_2, #<node_1_label>
0.08833399332305812, 2.2168933355715126e-15, 0.065, #<relative_position_1> [m]
orientation, 3, 0.0, 0.0, 1.0, 2, -1.0, 2.220446049250313e-16, 0.0, #<relative_pin_orientation_matrix_1>
structural_node_3, #<node_2_label>
-0.11112813669524979, 0.0, 0.065, #<relative_position_2> [m]
orientation, 3, 0.0, 0.0, 1.0, 2, -1.0, 2.220446049250313e-16, 0.0; #<relative_pin_orientation_matrix_2>
joint: joint_4,
prismatic,
structural_node_1, #<node_1_label>
orientation, 3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #relative_orientation_matrix_1>
structural_node_4, #<node_2_label>
orientation, 3, 0, 0, 1, 2, 0, 1, 0; #relative_orientation_matrix_2>
joint: joint_5,
in line,
structural_node_1, #<node_1_label>
0.0, 0.11147355803101042, 2.4118673970779456e-17, #<relative_line_position> [m]
3, -1.0, 1.1102230246251565e-16, -2.220446049250313e-16, 2, -1.1102230246251565e-16, 0.0, 1.0, #<relative_orientation>
structural_node_4, #<node_2_label>
offset, 0.0, -8.292603282173139e-09, 4.340448411165876e-12; #<relative_offset> [m]
joint: joint_6,
in line,
structural_node_2, #<node_1_label>
-0.1616660066769419, 2.2168933355715126e-15, 0.0, #<relative_line_position> [m]
3, 0.0, -0.0, -1.0, 2, -1.0, -2.220446049250313e-16, 0.0, #<relative_orientation>
structural_node_4, #<node_2_label>
offset, 0.031223927501520705, -1.69909327496498e-09, 7.275957614183426e-15; #<relative_offset> [m]
#-----------------------------------------------------------------------------
# [Drive callers]
drive caller: 1, name,"drive:1", ramp, 10.0, 0.0, 1.0, 0.0;
end: elements;

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ namespace MbD {
DiagonalMatrix(int count) : Array<T>(count) {}
DiagonalMatrix(int count, const T& value) : Array<T>(count, value) {}
DiagonalMatrix(std::initializer_list<T> list) : Array<T>{ list } {}
void atiputDiagonalMatrix(int i, std::shared_ptr<DiagonalMatrix<T>> diagMat);
void atiputDiagonalMatrix(int i, DiagMatsptr<T> diagMat);
DiagMatsptr<T> times(T factor);
FColsptr<T> timesFullColumn(FColsptr<T> fullCol);
FMatsptr<T> timesFullMatrix(FMatsptr<T> fullMat);
@@ -45,8 +45,38 @@ namespace MbD {
std::ostream& printOn(std::ostream& s) const override;
static DiagMatDsptr Identity3by3;
static DiagMatDsptr Identity4by4;
};
template<>
DiagMatDsptr DiagonalMatrix<double>::Identity3by3 = []() {
auto identity3by3 = std::make_shared<DiagonalMatrix<double>>(3);
for (int i = 0; i < 3; i++)
{
identity3by3->at(i) = 1.0;
}
return identity3by3;
}();
template<>
DiagMatDsptr DiagonalMatrix<double>::Identity4by4 = []() {
auto identity4by4 = std::make_shared<DiagonalMatrix<double>>(4);
for (int i = 0; i < 4; i++)
{
identity4by4->at(i) = 1.0;
}
return identity4by4;
}();
template<typename T>
inline void DiagonalMatrix<T>::atiputDiagonalMatrix(int i, DiagMatsptr<T> diagMat)
{
for (int ii = 0; ii < diagMat->size(); ii++)
{
this->at(i + ii) = diagMat->at(ii);
}
}
template<>
inline DiagMatDsptr DiagonalMatrix<double>::times(double factor)
{
auto nrow = (int)this->size();
@@ -58,14 +88,6 @@ namespace MbD {
return answer;
}
template<typename T>
inline void DiagonalMatrix<T>::atiputDiagonalMatrix(int i, std::shared_ptr<DiagonalMatrix<T>> diagMat)
{
for (int ii = 0; ii < diagMat->size(); ii++)
{
this->at(i + ii) = diagMat->at(ii);
}
}
template<typename T>
inline DiagMatsptr<T> DiagonalMatrix<T>::times(T factor)
{
assert(false);

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include <cmath>
#include "DifferenceOperator.h"
@@ -20,7 +20,7 @@ FRowDsptr DifferenceOperator::OneOverFactorials = []() {
auto oneOverFactorials = std::make_shared<FullRow<double>>(10);
for (int i = 0; i < oneOverFactorials->size(); i++)
{
oneOverFactorials->at(i) = 1.0 / std::tgamma(i+1);
oneOverFactorials->at(i) = 1.0 / std::tgamma(i + 1);
}
return oneOverFactorials;
}();
@@ -42,6 +42,12 @@ void DifferenceOperator::calcOperatorMatrix()
void DifferenceOperator::initialize()
{
//Do nothing
}
void MbD::DifferenceOperator::initializeLocally()
{
assert(false);
}
void DifferenceOperator::setiStep(int i)
@@ -75,9 +81,8 @@ void DifferenceOperator::formTaylorRowwithTimeNodederivative(int i, int ii, int
for (int j = k + 1; j < order + 1; j++)
{
hipower = hipower * hi;
assert(false);
//aij = hipower * (OneOverFactorials at : j - k - 1);
//rowi at : j put : aij
auto aij = hipower * OneOverFactorials->at((size_t)j - k);
rowi->atiput(j, aij);
}
}

View File

@@ -19,6 +19,7 @@ namespace MbD {
public:
void calcOperatorMatrix();
virtual void initialize();
virtual void initializeLocally();
virtual void setiStep(int i);
virtual void setorder(int o);
virtual void formTaylorMatrix() = 0;
@@ -29,7 +30,7 @@ namespace MbD {
int iStep = 0, order = 0;
FMatDsptr taylorMatrix, operatorMatrix;
double time = 0.0;
std::shared_ptr<std::vector<double>> timeNodes;
std::shared_ptr<std::vector<double>> timeNodes; //"Row of past times in order of increasing past."
static FRowDsptr OneOverFactorials;
};
}

View File

@@ -59,7 +59,7 @@ void DirectionCosineConstraintIJ::prePosIC()
void DirectionCosineConstraintIJ::postPosICIteration()
{
aAijIeJe->postPosICIteration();
Item::postPosICIteration();
ConstraintIJ::postPosICIteration();
}
ConstraintType DirectionCosineConstraintIJ::type()
@@ -70,7 +70,7 @@ ConstraintType DirectionCosineConstraintIJ::type()
void DirectionCosineConstraintIJ::preVelIC()
{
aAijIeJe->preVelIC();
Item::preVelIC();
ConstraintIJ::preVelIC();
}
void MbD::DirectionCosineConstraintIJ::simUpdateAll()

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include <string>
@@ -36,6 +36,7 @@ namespace MbD {
FullColumn(typename std::vector<T>::iterator begin, typename std::vector<T>::iterator end) : FullVector<T>(begin, end) {}
FullColumn(std::initializer_list<T> list) : FullVector<T>{ list } {}
FColsptr<T> plusFullColumn(FColsptr<T> fullCol);
FColsptr<T> plusFullColumntimes(FColsptr<T> fullCol, double factor);
FColsptr<T> minusFullColumn(FColsptr<T> fullCol);
FColsptr<T> times(T a);
FColsptr<T> negated();
@@ -47,17 +48,20 @@ namespace MbD {
FColsptr<T> copy();
FRowsptr<T> transpose();
void atiplusFullColumntimes(int i, FColsptr<T> fullCol, T factor);
T transposeTimesFullColumn(const FColsptr<T> fullCol);
T transposeTimesFullColumn(const FColsptr<T> fullCol);
void equalSelfPlusFullColumntimes(FColsptr<T> fullCol, T factor);
FColsptr<T> cross(FColsptr<T> fullCol);
FColsptr<T> simplified();
std::shared_ptr<FullColumn<T>> clonesptr();
double dot(std::shared_ptr<FullVector<T>> vec);
std::shared_ptr<FullVector<T>> dot(std::shared_ptr<std::vector<std::shared_ptr<FullColumn<T>>>> vecvec);
std::ostream& printOn(std::ostream& s) const override;
};
template<typename T>
inline FColsptr<T> FullColumn<T>::plusFullColumn(FColsptr<T> fullCol)
{
int n = (int) this->size();
int n = (int)this->size();
auto answer = std::make_shared<FullColumn<T>>(n);
for (int i = 0; i < n; i++) {
answer->at(i) = this->at(i) + fullCol->at(i);
@@ -65,9 +69,19 @@ namespace MbD {
return answer;
}
template<typename T>
inline FColsptr<T> FullColumn<T>::plusFullColumntimes(FColsptr<T> fullCol, double factor)
{
int n = (int)this->size();
auto answer = std::make_shared<FullColumn<T>>(n);
for (int i = 0; i < n; i++) {
answer->at(i) = this->at(i) + fullCol->at(i) * factor;
}
return answer;
}
template<typename T>
inline FColsptr<T> FullColumn<T>::minusFullColumn(FColsptr<T> fullCol)
{
int n = (int) this->size();
int n = (int)this->size();
auto answer = std::make_shared<FullColumn<T>>(n);
for (int i = 0; i < n; i++) {
answer->at(i) = this->at(i) - fullCol->at(i);
@@ -99,7 +113,7 @@ namespace MbD {
{
for (int ii = 0; ii < fullCol->size(); ii++)
{
this->at(i + ii) = fullCol->at(ii);
this->at((size_t)i + ii) = fullCol->at(ii);
}
}
template<typename T>
@@ -140,7 +154,7 @@ namespace MbD {
template<>
inline FColDsptr FullColumn<double>::copy()
{
auto n = (int) this->size();
auto n = (int)this->size();
auto answer = std::make_shared<FullColumn<double>>(n);
for (int i = 0; i < n; i++)
{
@@ -206,6 +220,37 @@ namespace MbD {
return FColsptr<T>();
}
template<typename T>
inline std::shared_ptr<FullColumn<T>> FullColumn<T>::clonesptr()
{
return std::make_shared<FullColumn<T>>(*this);
}
template<typename T>
inline double FullColumn<T>::dot(std::shared_ptr<FullVector<T>> vec)
{
int n = (int)this->size();
double answer = 0.0;
for (int i = 0; i < n; i++) {
answer += this->at(i) * vec->at(i);
}
return answer;
}
template<typename T>
inline std::shared_ptr<FullVector<T>> FullColumn<T>::dot(std::shared_ptr<std::vector<std::shared_ptr<FullColumn<T>>>> vecvec)
{
int ncol = (int)this->size();
auto nelem = vecvec->at(0)->size();
auto answer = std::make_shared<FullVector<T>>(nelem);
for (int k = 0; k < nelem; k++) {
auto sum = 0.0;
for (int i = 0; i < ncol; i++)
{
sum += this->at(i) * vecvec->at(i)->at(k);
}
answer->at(k) = sum;
}
return answer;
}
template<typename T>
inline std::ostream& FullColumn<T>::printOn(std::ostream& s) const
{
s << "FullCol{";

View File

@@ -334,13 +334,6 @@ namespace MbD {
return tilde;
}
template<>
inline void FullMatrix<double>::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
this->at(i)->zeroSelf();
}
}
template<>
inline void FullMatrix<double>::identity() {
this->zeroSelf();
for (int i = 0; i < this->size(); i++) {
@@ -496,6 +489,13 @@ namespace MbD {
assert(false);
return 0.0;
}
template<>
inline void FullMatrix<double>::zeroSelf()
{
for (int i = 0; i < this->size(); i++) {
this->at(i)->zeroSelf();
}
}
template<typename T>
inline void FullMatrix<T>::zeroSelf()
{

View File

@@ -51,6 +51,13 @@ namespace MbD {
FRowsptr<T> copy();
void atiplusFullRow(int j, FRowsptr<T> fullRow);
FMatsptr<T> transposeTimesFullRow(FRowsptr<T> fullRow);
std::shared_ptr<FullRow<T>> clonesptr();
//double dot(std::shared_ptr<FullColumn<T>> vec);
//double dot(std::shared_ptr<FullRow<T>> vec);
double dot(std::shared_ptr<FullVector<T>> vec);
std::shared_ptr<FullVector<T>> dot(std::shared_ptr<std::vector<std::shared_ptr<FullColumn<T>>>> vecvec);
std::ostream& printOn(std::ostream& s) const override;
};
@@ -169,6 +176,37 @@ namespace MbD {
return answer;
}
template<typename T>
inline std::shared_ptr<FullRow<T>> FullRow<T>::clonesptr()
{
return std::make_shared<FullRow<T>>(*this);
}
template<typename T>
inline double FullRow<T>::dot(std::shared_ptr<FullVector<T>> vec)
{
int n = (int)this->size();
double answer = 0.0;
for (int i = 0; i < n; i++) {
answer += this->at(i) * vec->at(i);
}
return answer;
}
template<typename T>
inline std::shared_ptr<FullVector<T>> FullRow<T>::dot(std::shared_ptr<std::vector<std::shared_ptr<FullColumn<T>>>> vecvec)
{
auto ncol = (int)this->size();
auto nelem = vecvec->at(0)->size();
auto answer = std::make_shared<FullVector<T>>(nelem);
for (int k = 0; k < nelem; k++) {
auto sum = 0.0;
for (int i = 0; i < ncol; i++)
{
sum += this->at(i) * vecvec->at(i)->at(k);
}
answer->at(k) = sum;
}
return answer;
}
template<typename T>
inline std::ostream& FullRow<T>::printOn(std::ostream& s) const
{
s << "FullRow{";

View File

@@ -37,7 +37,12 @@ namespace MbD {
void normalizeSelf();
double length();
virtual void conditionSelf();
void conditionSelfWithTol(double tol);
virtual void conditionSelfWithTol(double tol);
std::shared_ptr<FullVector<T>> clonesptr();
bool isIncreasing();
bool isIncreasingIfExceptionsAreLessThan(double tol);
bool isDecreasingIfExceptionsAreLessThan(double tol);
std::ostream& printOn(std::ostream& s) const override;
@@ -182,6 +187,46 @@ namespace MbD {
return;
}
template<typename T>
inline std::shared_ptr<FullVector<T>> FullVector<T>::clonesptr()
{
//Return shallow copy of *this wrapped in shared_ptr
assert(false);
return std::make_shared<FullVector<T>>(*this);
}
template<typename T>
inline bool FullVector<T>::isIncreasing()
{
return isIncreasingIfExceptionsAreLessThan(0.0);
}
template<typename T>
inline bool FullVector<T>::isIncreasingIfExceptionsAreLessThan(double tol)
{
//"Test if elements are increasing."
//"Ok if spoilers are less than tol."
auto next = this->at(0);
for (int i = 1; i < this->size(); i++)
{
auto previous = next;
next = this->at(i);
if (previous > next && (previous - tol > next)) return false;
}
return true;
}
template<typename T>
inline bool FullVector<T>::isDecreasingIfExceptionsAreLessThan(double tol)
{
//"Test if elements are increasing."
//"Ok if spoilers are less than tol."
auto next = this->at(0);
for (int i = 1; i < this->size(); i++)
{
auto previous = next;
next = this->at(i);
if (previous < next && (previous + tol < next)) return false;
}
return true;
}
template<typename T>
inline std::ostream& FullVector<T>::printOn(std::ostream& s) const
{
s << "FullVec{";

View File

@@ -9,7 +9,7 @@
#pragma once
#include "ConstraintIJ.h"
#include "OrbitAnglezIecJec.h"
#include "OrbitAngleZIecJec.h"
namespace MbD {
class GearConstraintIJ : public ConstraintIJ

View File

@@ -9,7 +9,7 @@
#include "GearConstraintIqcJc.h"
#include "EndFrameqc.h"
#include "CREATE.h"
#include "OrbitAnglezIeqcJec.h"
#include "OrbitAngleZIeqcJec.h"
using namespace MbD;

View File

@@ -8,7 +8,7 @@
#include "GearConstraintIqcJqc.h"
#include "EndFrameqc.h"
#include "OrbitAnglezIeqcJeqc.h"
#include "OrbitAngleZIeqcJeqc.h"
#include "CREATE.h"
using namespace MbD;

View File

@@ -21,7 +21,7 @@ namespace MbD {
void createInPlaneConstraint();
double offset;
double offset = 0.0;
};
}

View File

@@ -42,7 +42,7 @@ std::ostream& Item::printOn(std::ostream& s) const
{
std::string str = typeid(*this).name();
auto classname = str.substr(11, str.size() - 11);
s << classname; //Why classname() cannot be used?
s << classname << std::endl;
return s;
}

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include<algorithm>
#include <memory>
#include <typeinfo>

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "LDUFullMat.h"
using namespace MbD;
@@ -38,11 +38,11 @@ void LDUFullMat::forwardEliminateWithPivot(int p)
//"Save factors in lower triangle for LU decomposition."
//| rowp app rowi aip factor |
auto rowp = matrixA->at(p);
auto& rowp = matrixA->at(p);
auto app = rowp->at(p);
for (int i = p + 1; i < m; i++)
{
auto rowi = matrixA->at(i);
auto& rowi = matrixA->at(i);
auto aip = rowi->at(p);
auto factor = aip / app;
rowi->at(p) = factor;
@@ -138,9 +138,9 @@ void LDUFullMat::forwardSubstituteIntoL()
auto vectorc = std::make_shared<FullColumn<double>>(n);
for (int i = 0; i < n; i++)
{
auto rowi = matrixA->at(i);
auto& rowi = matrixA->at(i);
double sum = 0.0;
for (int j = 0; j < i - 1; j++)
for (int j = 0; j < i; j++)
{
sum += rowi->at(j) * vectorc->at(j);
}
@@ -155,11 +155,11 @@ void LDUFullMat::backSubstituteIntoDU()
//| rowi sum |
answerX = std::make_shared<FullColumn<double>>(n);
answerX->at(n - 1) = rightHandSideB->at(m - 1) / matrixA->at(m - 1)->at(n - 1);
answerX->at((size_t)n - 1) = rightHandSideB->at((size_t)m - 1) / matrixA->at((size_t)m - 1)->at((size_t)n - 1);
for (int i = n - 2; i >= 0; i--)
{
auto rowi = matrixA->at(i);
double sum = answerX->at(n - 1) * rowi->at(n - 1);
auto& rowi = matrixA->at(i);
double sum = answerX->at((size_t)n - 1) * rowi->at((size_t)n - 1);
for (int j = i + 1; j < n - 1; j++)
{
sum += answerX->at(j) * rowi->at(j);

View File

@@ -5,5 +5,52 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "LinearMultiStepMethod.h"
#include "FullColumn.h"
using namespace MbD;
FColDsptr MbD::LinearMultiStepMethod::derivativeatpresentpast(int n, double t, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast)
{
//"Interpolate or extrapolate."
//"dfdt(t) = df0dt + d2f0dt2*(t - t0) + d3f0dt3*(t - t0)^2 / 2! + ..."
auto answer = this->derivativepresentpast(n, y, ypast);
if (t != time) {
auto dt = t - time;
auto dtpower = 1.0;
for (int i = n + 1; i <= order; i++)
{
auto diydti = this->derivativepresentpast(i, y, ypast);
dtpower = dtpower * dt;
answer->equalSelfPlusFullColumntimes(diydti, dtpower * (OneOverFactorials->at((size_t)i - n)));
}
}
return answer;
}
FColDsptr MbD::LinearMultiStepMethod::derivativepresentpast(int order, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast)
{
assert(false);
return FColDsptr();
}
double MbD::LinearMultiStepMethod::pvdotpv()
{
assert(false);
return 0.0;
}
double MbD::LinearMultiStepMethod::firstPastTimeNode()
{
return timeNodes->at(0);
}
FColDsptr MbD::LinearMultiStepMethod::derivativepresentpastpresentDerivativepastDerivative(int n,
FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast,
FColDsptr ydot, std::shared_ptr<std::vector<FColDsptr>> ydotpast)
{
assert(false);
return FColDsptr();
}

View File

@@ -5,17 +5,24 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include "DifferenceOperator.h"
namespace MbD {
class LinearMultiStepMethod : public DifferenceOperator
{
//
public:
class LinearMultiStepMethod : public DifferenceOperator
{
//
public:
FColDsptr derivativeatpresentpast(int n, double t, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast);
virtual FColDsptr derivativepresentpast(int order, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast);
virtual double pvdotpv();
double firstPastTimeNode();
virtual FColDsptr derivativepresentpastpresentDerivativepastDerivative(int n,
FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast,
FColDsptr ydot, std::shared_ptr<std::vector<FColDsptr>> ydotpast);
};
};
}

View File

@@ -0,0 +1,321 @@
#-----------------------------------------------------------------------------
# [Data Block]
begin: data;
problem: initial value;
end: data;
#-----------------------------------------------------------------------------
# [Problem Block]
begin: initial value;
initial time: 0.0;
final time: 8.0;
time step: 0.01;
max iterations: 100;
tolerance: 1e-06;
derivatives tolerance: 0.0001;
derivatives max iterations: 100;
derivatives coefficient: auto;
end: initial value;
#-----------------------------------------------------------------------------
# [Control Data Block]
begin: control data;
max iterations: 1000;
default orientation: orientation matrix;
omega rotates: no;
print: none;
initial stiffness: 1.0, 1.0;
structural nodes: 5;
rigid bodies: 3;
joints: 6;
end: control data;
#-----------------------------------------------------------------------------
# [Design Variables]
#Generic bodies
#body: 2
set: integer body_2 = 2; #body label
set: real mass_2 = 0.24147734685710437; #mass [kg]
set: real volume_2 = 3.056675276672207e-05; #volume [m^3]
#body: 4
set: integer body_4 = 4; #body label
set: real mass_4 = 0.11253654770310718; #mass [kg]
set: real volume_4 = 1.4245132620646478e-05; #volume [m^3]
#body: 5
set: integer body_5 = 5; #body label
set: real mass_5 = 0.11253654770310723; #mass [kg]
set: real volume_5 = 1.4245132620646483e-05; #volume [m^3]
#Nodes
#node: 1
set: integer structural_node_1 = 1; #node label
#node: 2
set: integer structural_node_2 = 2; #node label
#node: 3
set: integer structural_node_3 = 3; #node label
#node: 4
set: integer structural_node_4 = 4; #node label
#node: 5
set: integer structural_node_5 = 5; #node label
#Joints
#joint: 1
set: integer joint_1 = 1; #joint label
#joint: 2
set: integer joint_2 = 2; #joint label
#joint: 3
set: integer joint_3 = 3; #joint label
#joint: 4
set: integer joint_4 = 4; #joint label
#joint: 5
set: integer joint_5 = 5; #joint label
#joint: 7
set: integer joint_7 = 7; #joint label
#Nodes: initial conditions
#node: 1
set: real Px_1 = 0.16912189837562464; #X component of the absolute position [m]
set: real Py_1 = -0.10055206743263254; #Y component of the absolute position [m]
set: real Pz_1 = 0.07867737409397452; #Z component of the absolute position [m]
set: real Vx_1 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_1 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_1 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_1 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_1 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_1 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 2
set: real Px_2 = 0.018683478687078307; #X component of the absolute position [m]
set: real Py_2 = -0.05533171845235879; #Y component of the absolute position [m]
set: real Pz_2 = 0.1768528076947657; #Z component of the absolute position [m]
set: real Vx_2 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_2 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_2 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_2 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_2 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_2 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 3
set: real Px_3 = 0.2890983348369078; #X component of the absolute position [m]
set: real Py_3 = -0.06156645049450425; #Y component of the absolute position [m]
set: real Pz_3 = 0.09724597715885096; #Z component of the absolute position [m]
set: real Vx_3 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_3 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_3 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_3 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_3 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_3 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 4
set: real Px_4 = 0.11637356459110539; #X component of the absolute position [m]
set: real Py_4 = -0.019655254070140387; #Y component of the absolute position [m]
set: real Pz_4 = 0.20651079866339145; #Z component of the absolute position [m]
set: real Vx_4 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_4 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_4 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_4 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_4 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_4 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 5
set: real Px_5 = 0.15064540729834192; #X component of the absolute position [m]
set: real Py_5 = -0.020536937096322302; #Y component of the absolute position [m]
set: real Pz_5 = 0.06548008210568429; #Z component of the absolute position [m]
set: real Vx_5 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_5 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_5 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_5 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_5 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_5 = 0.0; #Z component of the absolute angular velocity [rad/s]
#-----------------------------------------------------------------------------
# [Intermediate Variables]
#Moments of inertia and relative center of mass
#body 2:
set: real Ixx_2 = 6.927961737800001e-05; #moment of inertia [kg*m^2]
set: real Iyy_2 = 5.6689424982e-05; #moment of inertia [kg*m^2]
set: real Izz_2 = 2.9053392577e-05; #moment of inertia [kg*m^2]
set: real Rx_2 = 0.0; #X component of the relative center of mass [m]
set: real Ry_2 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_2 = 0.0; #Z component of the relative center of mass [m]
#body 4:
set: real Ixx_4 = 7.9157004521e-05; #moment of inertia [kg*m^2]
set: real Iyy_4 = 7.769349168e-05; #moment of inertia [kg*m^2]
set: real Izz_4 = 3.339121993e-06; #moment of inertia [kg*m^2]
set: real Rx_4 = 0.0; #X component of the relative center of mass [m]
set: real Ry_4 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_4 = 0.0; #Z component of the relative center of mass [m]
#body 5:
set: real Ixx_5 = 7.9157004521e-05; #moment of inertia [kg*m^2]
set: real Iyy_5 = 7.769349168e-05; #moment of inertia [kg*m^2]
set: real Izz_5 = 3.339121993e-06; #moment of inertia [kg*m^2]
set: real Rx_5 = 0.0; #X component of the relative center of mass [m]
set: real Ry_5 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_5 = 0.0; #Z component of the relative center of mass [m]
#-----------------------------------------------------------------------------
# [Nodes Block]
begin: nodes;
structural: structural_node_1,
static,
Px_1, Py_1, Pz_1, #<absolute_position> [m]
3, -0.3539135011019427, 0.9158836712023025, 0.18947911379030236, 2, -0.5084786583487672, -0.018385530501657588, -0.8608782877224926, #<absolute_orientation_matrix>
Vx_1, Vy_1, Vz_1, #<absolute_velocity> [m/s]
Wx_1, Wy_1, Wz_1; #<absolute_angular_velocity> [rad/s]
structural: structural_node_2,
dynamic,
Px_2, Py_2, Pz_2, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_2, Vy_2, Vz_2, #<absolute_velocity> [m/s]
Wx_2, Wy_2, Wz_2; #<absolute_angular_velocity> [rad/s]
structural: structural_node_3,
static,
Px_3, Py_3, Pz_3, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_3, Vy_3, Vz_3, #<absolute_velocity> [m/s]
Wx_3, Wy_3, Wz_3; #<absolute_angular_velocity> [rad/s]
structural: structural_node_4,
dynamic,
Px_4, Py_4, Pz_4, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_4, Vy_4, Vz_4, #<absolute_velocity> [m/s]
Wx_4, Wy_4, Wz_4; #<absolute_angular_velocity> [rad/s]
structural: structural_node_5,
dynamic,
Px_5, Py_5, Pz_5, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_5, Vy_5, Vz_5, #<absolute_velocity> [m/s]
Wx_5, Wy_5, Wz_5; #<absolute_angular_velocity> [rad/s]
end: nodes;
#-----------------------------------------------------------------------------
# [Elements Block]
begin: elements;
#-----------------------------------------------------------------------------
# [Bodies]
body: body_2,
structural_node_2, #<node_label>
mass_2, #<mass> [kg]
Rx_2, Ry_2, Rz_2, #<relative_center_of_mass> [m]
diag, Ixx_2, Iyy_2, Izz_2, #<inertia matrix> [kg*m^2]
orientation, 3, -0.35, 0.91, 0.21, 2, 0.78, 0.4, -0.47;
body: body_4,
structural_node_4, #<node_label>
mass_4, #<mass> [kg]
Rx_4, Ry_4, Rz_4, #<relative_center_of_mass> [m]
diag, Ixx_4, Iyy_4, Izz_4, #<inertia matrix> [kg*m^2]
orientation, 3, 0.78, 0.4, -0.47, 2, -0.36, 0.91, 0.19;
body: body_5,
structural_node_5, #<node_label>
mass_5, #<mass> [kg]
Rx_5, Ry_5, Rz_5, #<relative_center_of_mass> [m]
diag, Ixx_5, Iyy_5, Izz_5, #<inertia matrix> [kg*m^2]
orientation, 3, -0.36, 0.91, 0.19, 2, 0.78, 0.4, -0.47;
#-----------------------------------------------------------------------------
# [Joints]
joint: joint_1,
clamp,
structural_node_1, #<node_label>
0.16912189837562464, -0.10055206743263254, 0.07867737409397452, #<absolute_pin_position> [m]
3, -0.3539135011019427, 0.9158836712023025, 0.18947911379030236, 2, -0.5084786583487672, -0.018385530501657588, -0.8608782877224926; #<absolute_orientation_matrix>
joint: joint_2,
axial rotation,
structural_node_1, #<node_1_label>
1.0407603667772492e-11, -0.05247682460581396, -0.00025357557055826873, #<relative_offset_1> [m]
orientation, 3, 1.1102230246251565e-16, -1.0, 0.0, 2, guess, #<relative_orientation_matrix_1>
structural_node_2, #<node_2_label>
0.006998226646402806, -0.00490348349806041, 0.007426083408032554, #<relative_offset_2> [m]
orientation, 3, 0.5084786344413901, 0.01838554762064229, 0.8608783014778036, 2, guess, #<relative_orientation_matrix_2>
string, "model::drive(1, Time)"; #<angular_velocity> [rad/s]
joint: joint_3,
clamp,
structural_node_3, #<node_label>
0.2890983348369078, -0.06156645049450425, 0.09724597715885096, #<absolute_pin_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0; #<absolute_orientation_matrix>
joint: joint_4,
revolute hinge,
structural_node_2, #<node_1_label>
-0.0011629534118987692, 0.02262071327533141, 0.01746668757489371, #<relative_position_1> [m]
orientation, 3, 0.5084786344412178, 0.018385547620640152, 0.8608783014779054, 2, guess, #<relative_pin_orientation_matrix_1>
structural_node_4, #<node_2_label>
-0.031347177833029705, -0.01617494903756937, 0.018860685712244078, #<relative_position_2> [m]
orientation, 3, 0.5084786455601428, 0.018385495401303797, 0.860878296025734, 2, guess; #<relative_pin_orientation_matrix_2>
joint: joint_5,
revolute hinge,
structural_node_4, #<node_1_label>
0.03388957106083931, 0.016266876514581658, -0.01455629423212079, #<relative_position_1> [m]
orientation, 3, 0.50847864556046, 0.0183854954014063, 0.8608782960255446, 2, guess, #<relative_pin_orientation_matrix_1>
structural_node_5, #<node_2_label>
-0.016813818553224735, 0.036484433510506876, 0.003343892503690739, #<relative_position_2> [m]
orientation, 3, 0.5084787180221569, 0.01838550036990011, 0.8608782531198544, 2, guess; #<relative_pin_orientation_matrix_2>
joint: joint_7,
revolute hinge,
structural_node_3, #<node_1_label>
1.1368683772161603e-16, 0.0, -1.4210854715202004e-17, #<relative_position_1> [m]
orientation, 3, 0.5094306516594838, 0.018659363391322903, 0.8603093858070039, 2, guess, #<relative_pin_orientation_matrix_1>
structural_node_5, #<node_2_label>
0.014271424963118534, -0.03657636101236503, -0.007648283769292526, #<relative_position_2> [m]
orientation, 3, 0.5084787180221835, 0.018385500369866165, 0.8608782531198396, 2, guess; #<relative_pin_orientation_matrix_2>
#-----------------------------------------------------------------------------
# [Drive callers]
drive caller: 1, name,"drive:1", ramp, 5.0, 0.25, 4.0, 0.0;
end: elements;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,320 @@
#-----------------------------------------------------------------------------
# [Data Block]
begin: data;
problem: initial value;
end: data;
#-----------------------------------------------------------------------------
# [Problem Block]
begin: initial value;
initial time: 0.0;
final time: 8.0;
time step: 0.01;
max iterations: 100;
tolerance: 1e-06;
derivatives tolerance: 0.0001;
derivatives max iterations: 100;
derivatives coefficient: auto;
end: initial value;
#-----------------------------------------------------------------------------
# [Control Data Block]
begin: control data;
max iterations: 1000;
default orientation: orientation matrix;
omega rotates: no;
print: none;
initial stiffness: 1.0, 1.0;
structural nodes: 5;
rigid bodies: 3;
joints: 6;
end: control data;
#-----------------------------------------------------------------------------
# [Design Variables]
#Generic bodies
#body: 2
set: integer body_2 = 2; #body label
set: real mass_2 = 0.24147734685710437; #mass [kg]
set: real volume_2 = 3.056675276672207e-05; #volume [m^3]
#body: 4
set: integer body_4 = 4; #body label
set: real mass_4 = 0.11253654770310718; #mass [kg]
set: real volume_4 = 1.4245132620646478e-05; #volume [m^3]
#body: 5
set: integer body_5 = 5; #body label
set: real mass_5 = 0.11253654770310723; #mass [kg]
set: real volume_5 = 1.4245132620646483e-05; #volume [m^3]
#Nodes
#node: 1
set: integer structural_node_1 = 1; #node label
#node: 2
set: integer structural_node_2 = 2; #node label
#node: 3
set: integer structural_node_3 = 3; #node label
#node: 4
set: integer structural_node_4 = 4; #node label
#node: 5
set: integer structural_node_5 = 5; #node label
#Joints
#joint: 1
set: integer joint_1 = 1; #joint label
#joint: 2
set: integer joint_2 = 2; #joint label
#joint: 3
set: integer joint_3 = 3; #joint label
#joint: 4
set: integer joint_4 = 4; #joint label
#joint: 5
set: integer joint_5 = 5; #joint label
#joint: 6
set: integer joint_6 = 6; #joint label
#Nodes: initial conditions
#node: 1
set: real Px_1 = 0.16912189837562464; #X component of the absolute position [m]
set: real Py_1 = -0.10055206743263254; #Y component of the absolute position [m]
set: real Pz_1 = 0.07867737409397452; #Z component of the absolute position [m]
set: real Vx_1 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_1 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_1 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_1 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_1 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_1 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 2
set: real Px_2 = 0.018683478687078307; #X component of the absolute position [m]
set: real Py_2 = -0.05533171845235879; #Y component of the absolute position [m]
set: real Pz_2 = 0.1768528076947657; #Z component of the absolute position [m]
set: real Vx_2 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_2 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_2 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_2 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_2 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_2 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 3
set: real Px_3 = 0.2890983348369078; #X component of the absolute position [m]
set: real Py_3 = -0.06156645049450425; #Y component of the absolute position [m]
set: real Pz_3 = 0.09724597715885096; #Z component of the absolute position [m]
set: real Vx_3 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_3 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_3 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_3 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_3 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_3 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 4
set: real Px_4 = 0.11637356459110539; #X component of the absolute position [m]
set: real Py_4 = -0.019655254070140387; #Y component of the absolute position [m]
set: real Pz_4 = 0.20651079866339145; #Z component of the absolute position [m]
set: real Vx_4 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_4 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_4 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_4 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_4 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_4 = 0.0; #Z component of the absolute angular velocity [rad/s]
#node: 5
set: real Px_5 = 0.15064540729834192; #X component of the absolute position [m]
set: real Py_5 = -0.020536937096322302; #Y component of the absolute position [m]
set: real Pz_5 = 0.06548008210568429; #Z component of the absolute position [m]
set: real Vx_5 = 0.0; #X component of the absolute velocity [m/s]
set: real Vy_5 = 0.0; #Y component of the absolute velocity [m/s]
set: real Vz_5 = 0.0; #Z component of the absolute velocity [m/s]
set: real Wx_5 = 0.0; #X component of the absolute angular velocity [rad/s]
set: real Wy_5 = 0.0; #Y component of the absolute angular velocity [rad/s]
set: real Wz_5 = 0.0; #Z component of the absolute angular velocity [rad/s]
#-----------------------------------------------------------------------------
# [Intermediate Variables]
#Moments of inertia and relative center of mass
#body 2:
set: real Ixx_2 = 6.927961737800001e-05; #moment of inertia [kg*m^2]
set: real Iyy_2 = 5.6689424982e-05; #moment of inertia [kg*m^2]
set: real Izz_2 = 2.9053392577e-05; #moment of inertia [kg*m^2]
set: real Rx_2 = 0.0; #X component of the relative center of mass [m]
set: real Ry_2 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_2 = 0.0; #Z component of the relative center of mass [m]
#body 4:
set: real Ixx_4 = 7.9157004521e-05; #moment of inertia [kg*m^2]
set: real Iyy_4 = 7.769349168e-05; #moment of inertia [kg*m^2]
set: real Izz_4 = 3.339121993e-06; #moment of inertia [kg*m^2]
set: real Rx_4 = 0.0; #X component of the relative center of mass [m]
set: real Ry_4 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_4 = 0.0; #Z component of the relative center of mass [m]
#body 5:
set: real Ixx_5 = 7.9157004521e-05; #moment of inertia [kg*m^2]
set: real Iyy_5 = 7.769349168e-05; #moment of inertia [kg*m^2]
set: real Izz_5 = 3.339121993e-06; #moment of inertia [kg*m^2]
set: real Rx_5 = 0.0; #X component of the relative center of mass [m]
set: real Ry_5 = 0.0; #Y component of the relative center of mass [m]
set: real Rz_5 = 0.0; #Z component of the relative center of mass [m]
#-----------------------------------------------------------------------------
# [Nodes Block]
begin: nodes;
structural: structural_node_1,
static,
Px_1, Py_1, Pz_1, #<absolute_position> [m]
3, -0.3539135011019427, 0.9158836712023025, 0.18947911379030236, 2, -0.5084786583487672, -0.018385530501657588, -0.8608782877224926, #<absolute_orientation_matrix>
Vx_1, Vy_1, Vz_1, #<absolute_velocity> [m/s]
Wx_1, Wy_1, Wz_1; #<absolute_angular_velocity> [rad/s]
structural: structural_node_2,
dynamic,
Px_2, Py_2, Pz_2, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_2, Vy_2, Vz_2, #<absolute_velocity> [m/s]
Wx_2, Wy_2, Wz_2; #<absolute_angular_velocity> [rad/s]
structural: structural_node_3,
static,
Px_3, Py_3, Pz_3, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_3, Vy_3, Vz_3, #<absolute_velocity> [m/s]
Wx_3, Wy_3, Wz_3; #<absolute_angular_velocity> [rad/s]
structural: structural_node_4,
dynamic,
Px_4, Py_4, Pz_4, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_4, Vy_4, Vz_4, #<absolute_velocity> [m/s]
Wx_4, Wy_4, Wz_4; #<absolute_angular_velocity> [rad/s]
structural: structural_node_5,
dynamic,
Px_5, Py_5, Pz_5, #<absolute_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0, #<absolute_orientation_matrix>
Vx_5, Vy_5, Vz_5, #<absolute_velocity> [m/s]
Wx_5, Wy_5, Wz_5; #<absolute_angular_velocity> [rad/s]
end: nodes;
#-----------------------------------------------------------------------------
# [Elements Block]
begin: elements;
#-----------------------------------------------------------------------------
# [Bodies]
body: body_2,
structural_node_2, #<node_label>
mass_2, #<mass> [kg]
Rx_2, Ry_2, Rz_2, #<relative_center_of_mass> [m]
diag, Ixx_2, Iyy_2, Izz_2, #<inertia matrix> [kg*m^2]
orientation, 3, -0.35, 0.91, 0.21, 2, 0.78, 0.4, -0.47;
body: body_4,
structural_node_4, #<node_label>
mass_4, #<mass> [kg]
Rx_4, Ry_4, Rz_4, #<relative_center_of_mass> [m]
diag, Ixx_4, Iyy_4, Izz_4, #<inertia matrix> [kg*m^2]
orientation, 3, 0.78, 0.4, -0.47, 2, -0.36, 0.91, 0.19;
body: body_5,
structural_node_5, #<node_label>
mass_5, #<mass> [kg]
Rx_5, Ry_5, Rz_5, #<relative_center_of_mass> [m]
diag, Ixx_5, Iyy_5, Izz_5, #<inertia matrix> [kg*m^2]
orientation, 3, -0.36, 0.91, 0.19, 2, 0.78, 0.4, -0.47;
#-----------------------------------------------------------------------------
# [Joints]
joint: joint_1,
clamp,
structural_node_1, #<node_label>
0.16912189837562464, -0.10055206743263254, 0.07867737409397452, #<absolute_pin_position> [m]
3, -0.3539135011019427, 0.9158836712023025, 0.18947911379030236, 2, -0.5084786583487672, -0.018385530501657588, -0.8608782877224926; #<absolute_orientation_matrix>
joint: joint_2,
axial rotation,
structural_node_1, #<node_1_label>
1.0407603667772492e-11, -0.05247682460581396, -0.00025357557055826873, #<relative_offset_1> [m]
orientation, 3, 1.1102230246251565e-16, -1.0, 0.0, 2, guess, #<relative_orientation_matrix_1>
structural_node_2, #<node_2_label>
0.006998226646402806, -0.00490348349806041, 0.007426083408032554, #<relative_offset_2> [m]
orientation, 3, 0.5084786344413901, 0.01838554762064229, 0.8608783014778036, 2, guess, #<relative_orientation_matrix_2>
string, "model::drive(1, Time)"; #<angular_velocity> [rad/s]
joint: joint_3,
clamp,
structural_node_3, #<node_label>
0.2890983348369078, -0.06156645049450425, 0.09724597715885096, #<absolute_pin_position> [m]
3, 0.0, 0.0, 1.0, 2, 0.0, 1.0, 0.0; #<absolute_orientation_matrix>
joint: joint_4,
revolute hinge,
structural_node_2, #<node_1_label>
-0.0011629534118987692, 0.02262071327533141, 0.01746668757489371, #<relative_position_1> [m]
orientation, 3, 0.5084786344412178, 0.018385547620640152, 0.8608783014779054, 2, guess, #<relative_pin_orientation_matrix_1>
structural_node_4, #<node_2_label>
-0.031347177833029705, -0.01617494903756937, 0.018860685712244078, #<relative_position_2> [m]
orientation, 3, 0.5084786455601428, 0.018385495401303797, 0.860878296025734, 2, guess; #<relative_pin_orientation_matrix_2>
joint: joint_5,
revolute hinge,
structural_node_4, #<node_1_label>
0.03388957106083931, 0.016266876514581658, -0.01455629423212079, #<relative_position_1> [m]
orientation, 3, 0.50847864556046, 0.0183854954014063, 0.8608782960255446, 2, guess, #<relative_pin_orientation_matrix_1>
structural_node_5, #<node_2_label>
-0.016813818553224735, 0.036484433510506876, 0.003343892503690739, #<relative_position_2> [m]
orientation, 3, 0.5084787180221569, 0.01838550036990011, 0.8608782531198544, 2, guess; #<relative_pin_orientation_matrix_2>
joint: joint_6,
in line,
structural_node_3, #<node_1_label>
0.0, 0.0, 0.0, #<relative_line_position> [m]
3, 0.5094306516594838, 0.018659363391322903, 0.8603093858070039, 2, guess, #<relative_orientation>
structural_node_5, #<node_2_label>
offset, 0.014271424963118534, -0.03657636101236503, -0.007648283769292526; #<relative_offset> [m]
#-----------------------------------------------------------------------------
# [Drive callers]
drive caller: 1, name,"drive:1", ramp, 5.0, 0.25, 4.0, 0.0;
end: elements;

File diff suppressed because it is too large Load Diff

View File

@@ -138,6 +138,7 @@ void MbD::MBDynSystem::runKINEMATIC()
std::static_pointer_cast<ASMTAssembly>(asmtItem)->runKINEMATIC();
outputFiles();
asmtAssembly()->outputFile("assembly2.asmt");
asmtAssembly()->outputFile("smalltalk.asmt");
}
void MbD::MBDynSystem::outputFiles()

View File

@@ -61,7 +61,7 @@ void MarkerFrame::initializeGlobally()
void MarkerFrame::postInput()
{
Item::postInput();
CartesianFrame::postInput();
endFramesDo([](EndFrmsptr endFrame) { endFrame->postInput(); });
}
@@ -82,7 +82,7 @@ void MarkerFrame::calcPostDynCorrectorIteration()
void MarkerFrame::prePosIC()
{
Item::prePosIC();
CartesianFrame::prePosIC();
endFramesDo([](EndFrmsptr endFrame) { endFrame->prePosIC(); });
}
@@ -153,7 +153,7 @@ void MarkerFrame::setqsudotlam(FColDsptr col)
void MarkerFrame::postPosICIteration()
{
Item::postPosICIteration();
CartesianFrame::postPosICIteration();
endFramesDo([](EndFrmsptr endFrame) { endFrame->postPosICIteration(); });
}
@@ -174,7 +174,7 @@ void MarkerFrame::storeDynState()
void MarkerFrame::preVelIC()
{
Item::preVelIC();
CartesianFrame::preVelIC();
endFramesDo([](EndFrmsptr endFrame) { endFrame->preVelIC(); });
}
@@ -185,7 +185,7 @@ void MarkerFrame::postVelIC()
void MarkerFrame::preAccIC()
{
Item::preAccIC();
CartesianFrame::preAccIC();
endFramesDo([](EndFrmsptr endFrame) { endFrame->preAccIC(); });
}

View File

@@ -38,9 +38,7 @@ namespace MbD {
void addEndFrame(EndFrmsptr x);
void initializeLocally() override;
void initializeGlobally() override;
void postInput() override;
void calcPostDynCorrectorIteration() override;
void prePosIC() override;
int iqX();
int iqE();
void endFramesDo(const std::function <void(EndFrmsptr)>& f);
@@ -55,12 +53,14 @@ namespace MbD {
void setqsudot(FColDsptr col) override;
void setqsudotlam(FColDsptr col) override;
void setqsuddotlam(FColDsptr col) override;
void storeDynState() override;
void postInput() override;
void postPosICIteration() override;
void postVelIC() override;
void postPosIC() override;
void preDyn() override;
void storeDynState() override;
void prePosIC() override;
void preVelIC() override;
void postVelIC() override;
void preAccIC() override;
FColDsptr qXdot();
std::shared_ptr<EulerParametersDot<double>> qEdot();

View File

@@ -10,6 +10,12 @@
using namespace MbD;
FColDsptr MbD::MatrixDecomposition::forAndBackSubsaveOriginal(FColDsptr fullCol, bool saveOriginal)
{
assert(false);
return FColDsptr();
}
void MatrixDecomposition::applyRowOrderOnRightHandSideB()
{
FColDsptr answer = std::make_shared<FullColumn<double>>(m);
@@ -19,3 +25,34 @@ void MatrixDecomposition::applyRowOrderOnRightHandSideB()
}
rightHandSideB = answer;
}
FColDsptr MbD::MatrixDecomposition::basicSolvewithsaveOriginal(FMatDsptr aMatrix, FColDsptr aVector, bool saveOriginal)
{
assert(false);
return FColDsptr();
}
void MbD::MatrixDecomposition::forwardSubstituteIntoL()
{
assert(false);
}
void MbD::MatrixDecomposition::backSubstituteIntoU()
{
assert(false);
}
void MbD::MatrixDecomposition::forwardSubstituteIntoLD()
{
assert(false);
}
void MbD::MatrixDecomposition::postSolve()
{
assert(false);
}
void MbD::MatrixDecomposition::preSolvesaveOriginal(FMatDsptr aMatrix, bool saveOriginal)
{
assert(false);
}

View File

@@ -15,15 +15,14 @@ namespace MbD {
{
//
public:
virtual FColDsptr forAndBackSubsaveOriginal(FColDsptr fullCol, bool saveOriginal) = 0;
virtual FColDsptr forAndBackSubsaveOriginal(FColDsptr fullCol, bool saveOriginal);
virtual void applyRowOrderOnRightHandSideB();
virtual void forwardSubstituteIntoL() = 0;
//virtual void backSubstituteIntoU();
//virtual FColDsptr basicSolve(aMatrix); with : aVector saveOriginal : saveOriginal
//virtual void forwardSubstituteIntoL();
//virtual void forwardSubstituteIntoLD();
//virtual void postSolve();
//virtual void preSolve : aMatrix saveOriginal : saveOriginal
virtual void forwardSubstituteIntoL();
virtual void backSubstituteIntoU();
virtual FColDsptr basicSolvewithsaveOriginal(FMatDsptr aMatrix, FColDsptr aVector, bool saveOriginal);
virtual void forwardSubstituteIntoLD();
virtual void postSolve();
virtual void preSolvesaveOriginal(FMatDsptr aMatrix, bool saveOriginal);
};
}

View File

@@ -7,6 +7,7 @@
***************************************************************************/
#include <limits>
#include <cassert>
#include "NewtonRaphson.h"
#include "SystemSolver.h"
@@ -92,6 +93,7 @@ bool NewtonRaphson::isConverged()
void NewtonRaphson::askSystemToUpdate()
{
assert(false);
}
bool NewtonRaphson::isConvergedToNumericalLimit()

View File

@@ -26,9 +26,14 @@ void sharedptrTest();
int main()
{
ASMTAssembly::runFile("cirpendu2.asmt"); //Under constrained. Testing ICKine.
ASMTAssembly::runFile("quasikine.asmt"); //Under constrained. Testing ICKine.
ASMTAssembly::readWriteFile("piston.asmt");
//MBDynSystem::runFile("MBDynCaseDebug2.mbd");
//return 0;
MBDynSystem::runFile("MBDynCase2.mbd");
MBDynSystem::runFile("MBDynCase.mbd");
MBDynSystem::runFile("CrankSlider2.mbd");
//MBDynSystem::runFile("crank_slider.mbd"); //Needs integration of product
////ASMTAssembly::runSinglePendulumSuperSimplified(); //Mass is missing
////ASMTAssembly::runSinglePendulumSuperSimplified2(); //DOF has infinite acceleration due to zero mass and inertias
@@ -37,7 +42,6 @@ int main()
ASMTAssembly::runFile("piston.asmt");
ASMTAssembly::runFile("00backhoe.asmt");
//ASMTAssembly::runFile("circular.asmt"); //Needs checking
//ASMTAssembly::runFile("cirpendu.asmt"); //Under constrained. Testing ICKine.
//ASMTAssembly::runFile("engine1.asmt"); //Needs checking
ASMTAssembly::runFile("fourbar.asmt");
//ASMTAssembly::runFile("fourbot.asmt"); //Very large but works

View File

@@ -8,7 +8,7 @@
#include "corecrt_math_defines.h"
#include "OrbitAnglezIecJec.h"
#include "OrbitAngleZIecJec.h"
#include "Numeric.h"
using namespace MbD;

View File

@@ -6,7 +6,7 @@
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "OrbitAnglezIeqcJec.h"
#include "OrbitAngleZIeqcJec.h"
#include "CREATE.h"
#include "DispCompIeqcJecIe.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include "OrbitAnglezIecJec.h"
#include "OrbitAngleZIecJec.h"
namespace MbD {
class OrbitAngleZIeqcJec : public OrbitAngleZIecJec

View File

@@ -6,7 +6,7 @@
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "OrbitAnglezIeqcJeqc.h"
#include "OrbitAngleZIeqcJeqc.h"
#include "CREATE.h"
#include "DispCompIeqcJeqcIe.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include "OrbitAnglezIeqcJec.h"
#include "OrbitAngleZIeqcJec.h"
namespace MbD {
class OrbitAngleZIeqcJeqc : public OrbitAngleZIeqcJec

View File

@@ -581,3 +581,8 @@ void Part::postDynStep()
{
partFrame->postDynStep();
}
void MbD::Part::postAccIC()
{
calcpdot();
}

View File

@@ -113,6 +113,7 @@ namespace MbD {
std::shared_ptr<StateData> stateData() override;
double suggestSmallerOrAcceptDynStepSize(double hnew) override;
void postDynStep() override;
void postAccIC() override;
System* system; //Use raw pointer when pointing backwards.
int ipX = -1;

View File

@@ -57,3 +57,8 @@ void MbD::PosICKineNewtonRaphson::preRun()
system->Solver::logString("MbD: Solving for quasi kinematic position.");
PosNewtonRaphson::preRun();
}
bool MbD::PosICKineNewtonRaphson::isConverged()
{
return dxNorms->at(iterNo) < dxTol || isConvergedToNumericalLimit();
}

View File

@@ -18,6 +18,7 @@ namespace MbD {
void initializeGlobally() override;
void assignEquationNumbers() override;
void preRun() override;
bool isConverged() override;
};
}

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include <sstream>
@@ -17,6 +17,8 @@
namespace MbD {
template<typename T>
class SparseMatrix;
template<typename T>
using SpMatsptr = std::shared_ptr<SparseMatrix<T>>;
using SpMatDsptr = std::shared_ptr<SparseMatrix<double>>;
template<typename T>
@@ -47,15 +49,20 @@ namespace MbD {
void zeroSelf() override;
void atijplusFullRow(int i, int j, FRowsptr<T> fullRow);
void atijplusFullColumn(int i, int j, FColsptr<T> fullCol);
void atijminusFullColumn(int i, int j, FColsptr<T> fullCol);
void atijplusFullMatrix(int i, int j, FMatsptr<T> fullMat);
void atijminusFullMatrix(int i, int j, FMatsptr<T> fullMat);
void atijplusTransposeFullMatrix(int i, int j, FMatsptr<T> fullMat);
void atijminusTransposeFullMatrix(int i, int j, FMatsptr<T> fullMat);
void atijplusFullMatrixtimes(int i, int j, FMatsptr<T> fullMat, T factor);
void atijplusNumber(int i, int j, double value);
void atijminusNumber(int i, int j, double value);
void atijput(int i, int j, T value);
double maxMagnitude() override;
FColsptr<T> timesFullColumn(FColsptr<T> fullCol);
SpMatsptr<T> plusSparseMatrix(SpMatsptr<T> spMat);
std::shared_ptr<SparseMatrix<T>> clonesptr();
void magnifySelf(T factor);
std::ostream& printOn(std::ostream& s) const override;
@@ -117,6 +124,14 @@ namespace MbD {
}
}
template<typename T>
inline void SparseMatrix<T>::atijminusFullColumn(int i, int j, FColsptr<T> fullCol)
{
for (int ii = 0; ii < fullCol->size(); ii++)
{
this->atijminusNumber(i + ii, j, fullCol->at(ii));
}
}
template<typename T>
inline void SparseMatrix<T>::atijplusFullMatrix(int i, int j, FMatsptr<T> fullMat)
{
for (int ii = 0; ii < fullMat->nrow(); ii++)
@@ -141,6 +156,14 @@ namespace MbD {
}
}
template<typename T>
inline void SparseMatrix<T>::atijminusTransposeFullMatrix(int i, int j, FMatsptr<T> fullMat)
{
for (int ii = 0; ii < fullMat->nrow(); ii++)
{
this->atijminusFullColumn(i, j + ii, fullMat->at(ii)->transpose());
}
}
template<typename T>
inline void SparseMatrix<T>::atijplusFullMatrixtimes(int i, int j, FMatsptr<T> fullMat, T factor)
{
for (int ii = 0; ii < fullMat->nrow(); ii++)
@@ -197,4 +220,30 @@ namespace MbD {
}
return answer;
}
template<typename T>
inline SpMatsptr<T> SparseMatrix<T>::plusSparseMatrix(SpMatsptr<T> spMat)
{
//"a + b."
//"Assume all checking of validity of this operation has been done."
//"Just evaluate quickly."
auto answer = clonesptr();
for (int i = 0; i < answer->size(); i++)
{
answer->atiput(i, answer->at(i)->plusSparseRow(spMat->at(i)));
}
return answer;
}
template<typename T>
inline std::shared_ptr<SparseMatrix<T>> SparseMatrix<T>::clonesptr()
{
return std::make_shared<SparseMatrix<T>>(*this);
}
template<typename T>
inline void SparseMatrix<T>::magnifySelf(T factor)
{
for (int i = 0; i < this->size(); i++) {
this->at(i)->magnifySelf(factor);
}
}
}

View File

@@ -5,7 +5,7 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#pragma once
#include <memory>
@@ -25,7 +25,7 @@ namespace MbD {
class SparseRow : public SparseVector<T>
{
public:
SparseRow(){}
SparseRow() {}
SparseRow(int n) : SparseVector<T>(n) {}
SparseRow(std::initializer_list<std::pair<const int, T>> list) : SparseVector<T>{ list } {}
SparseRow(std::initializer_list<std::initializer_list<T>> list) : SparseVector<T>{ list } {}
@@ -35,6 +35,8 @@ namespace MbD {
void atiminusFullRow(int j, FRowsptr<T> fullRow);
void atiplusFullRowtimes(int j, FRowsptr<T> fullRow, double factor);
T timesFullColumn(FColsptr<T> fullCol);
SpRowsptr<T> plusSparseRow(SpRowsptr<T> spMat);
SpRowsptr<T> clonesptr();
};
template<>
@@ -92,5 +94,27 @@ namespace MbD {
}
return sum;
}
template<typename T>
inline SpRowsptr<T> SparseRow<T>::plusSparseRow(SpRowsptr<T> spRow)
{
auto answer = clonesptr();
for (auto const& keyValue : *spRow)
{
auto key = keyValue.first;
auto val = keyValue.second;
if (answer->find(key) == answer->end()) {
(*answer)[key] = val;
}
else {
(*answer)[key] = val + answer->at(key);
}
}
return answer;
}
template<typename T>
inline std::shared_ptr<SparseRow<T>> SparseRow<T>::clonesptr()
{
return std::make_shared<SparseRow<T>>(*this);
}
}

View File

@@ -42,6 +42,7 @@ namespace MbD {
void atiminusNumber(int i, double value);
void zeroSelf();
double maxMagnitude();
void magnifySelf(T factor);
virtual std::ostream& printOn(std::ostream& s) const;
friend std::ostream& operator<<(std::ostream& s, const SparseVector& spVec)
@@ -101,6 +102,16 @@ namespace MbD {
return max;
}
template<typename T>
inline void SparseVector<T>::magnifySelf(T factor)
{
for (const auto& keyValue : *this) {
auto key = keyValue.first;
auto val = keyValue.second;
val *= factor;
this->at(key) = val;
}
}
template<typename T>
inline std::ostream& SparseVector<T>::printOn(std::ostream& s) const
{
s << "{";

View File

@@ -5,8 +5,9 @@
* *
* See LICENSE file for details about copyright. *
***************************************************************************/
#include "StableBackwardDifference.h"
#include "FullColumn.h"
using namespace MbD;
@@ -25,6 +26,25 @@ void StableBackwardDifference::formTaylorMatrix()
}
}
double MbD::StableBackwardDifference::pvdotpv()
{
//"pvdotpv = operatorMatrix timesColumn: #(-1.0d ... -1.0d)."
auto& coeffs = operatorMatrix->at(0);
auto sum = 0.0;
for (int i = 0; i < order; i++)
{
sum -= coeffs->at(i);
}
return sum;
}
FColDsptr MbD::StableBackwardDifference::derivativepresentpastpresentDerivativepastDerivative(int n, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast, FColDsptr ydot, std::shared_ptr<std::vector<FColDsptr>> ydotpast)
{
assert(false);
return FColDsptr();
}
void StableBackwardDifference::instantiateTaylorMatrix()
{
if (taylorMatrix == nullptr || (taylorMatrix->nrow() != (order))) {
@@ -37,11 +57,11 @@ void StableBackwardDifference::formTaylorRowwithTimeNodederivative(int i, int ii
//| rowi hi hipower aij |
auto& rowi = taylorMatrix->at(i);
if (k > 0) {
for (int j = 0; j < k - 1; j++)
for (int j = 0; j < k - 2; j++)
{
rowi->at(j) = 0.0;
}
rowi->at(k) = 1.0;
rowi->at((size_t)k - 1) = 1.0;
}
auto hi = timeNodes->at(ii) - time;
@@ -49,7 +69,31 @@ void StableBackwardDifference::formTaylorRowwithTimeNodederivative(int i, int ii
for (int j = k; j < order; j++)
{
hipower *= hi;
auto aij = hipower * OneOverFactorials->at((size_t)(j - k));
auto aij = hipower * OneOverFactorials->at((size_t)(j - k + 1));
rowi->at(j) = aij;
}
}
FColDsptr MbD::StableBackwardDifference::derivativepresentpast(int deriv, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast)
{
//"Answer ith derivative given present value and past values."
if (deriv == 0) {
return y->clonesptr();
}
else {
if (deriv <= order) {
auto series = std::make_shared<std::vector<FColDsptr>>(order);
for (int i = 0; i < order; i++)
{
series->at(i) = ypast->at(i)->minusFullColumn(y);
}
auto& coeffs = operatorMatrix->at((size_t)deriv - 1);
auto answer = coeffs->dot(series);
return std::static_pointer_cast<FullColumn<double>>(answer);
}
else {
return std::make_shared<FullColumn<double>>(y->size(), 0.0);
}
}
}

View File

@@ -15,9 +15,16 @@ namespace MbD {
{
//
public:
FColDsptr derivativepresentpast(int order, FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast) override;
void instantiateTaylorMatrix();
void formTaylorRowwithTimeNodederivative(int i, int ii, int k);
void formTaylorMatrix() override;
void instantiateTaylorMatrix() override;
void formTaylorRowwithTimeNodederivative(int i, int ii, int k) override;
double pvdotpv() override;
FColDsptr derivativepresentpastpresentDerivativepastDerivative(int n,
FColDsptr y, std::shared_ptr<std::vector<FColDsptr>> ypast,
FColDsptr ydot, std::shared_ptr<std::vector<FColDsptr>> ydotpast);
FColDsptr derivativewith(int deriv, std::shared_ptr<std::vector<FColDsptr>> series);
};
}

View File

@@ -90,10 +90,10 @@ bool MbD::SymbolicParser::minusTerm()
{
if (peekForTypeNoPush("-")) {
if (term()) {
auto trm = stack->top();
Symsptr trm = stack->top();
stack->pop();
auto negativeTrm = std::make_shared<Negative>(trm);
auto sum = stack->top();
Symsptr sum = stack->top();
sum->addTerm(negativeTrm);
return true;
}
@@ -105,9 +105,9 @@ bool MbD::SymbolicParser::minusTerm()
bool MbD::SymbolicParser::plainTerm()
{
if (term()) {
auto trm = stack->top();
Symsptr trm = stack->top();
stack->pop();
auto sum = stack->top();
Symsptr sum = stack->top();
sum->addTerm(trm);
return true;
}
@@ -120,7 +120,7 @@ bool MbD::SymbolicParser::term()
stack->push(product);
if (plainFunction()) {
while (timesFunction() || divideByFunction()) {}
auto term = stack->top();
Symsptr term = stack->top();
if (term->isProduct()) {
if (term->isOne()) {
stack->pop();
@@ -141,9 +141,9 @@ bool MbD::SymbolicParser::term()
bool MbD::SymbolicParser::plainFunction()
{
if (symfunction()) {
auto trm = stack->top();
Symsptr trm = stack->top();
stack->pop();
auto product = stack->top();
Symsptr product = stack->top();
product->addTerm(trm);
return true;
}
@@ -163,10 +163,10 @@ bool MbD::SymbolicParser::divideByFunction()
{
if (peekForTypeNoPush("/")) {
if (symfunction()) {
auto trm = stack->top();
Symsptr trm = stack->top();
stack->pop();
auto reciprocalTrm = std::make_shared<Reciprocal>(trm);
auto product = stack->top();
Symsptr product = stack->top();
product->addTerm(reciprocalTrm);
return true;
}
@@ -287,7 +287,7 @@ bool MbD::SymbolicParser::expression()
stack->push(sum);
if (plusTerm() || minusTerm() || plainTerm()) {
while (plusTerm() || minusTerm()) {}
auto term = stack->top();
Symsptr term = stack->top();
if (term->isSum()) {
auto sum1 = std::static_pointer_cast<Sum>(term);
if (sum1->isZero()) {
@@ -378,7 +378,7 @@ bool MbD::SymbolicParser::intrinsic()
if (stack->size() > startsize) {
combineStackTo((int)startsize);
if (peekForTypeNoPush(")")) {
auto args = stack->top(); //args is a Sum with "terms" containing the actual arguments
Symsptr args = stack->top(); //args is a Sum with "terms" containing the actual arguments
stack->pop();
auto func = std::static_pointer_cast<Function>(stack->top());
func->arguments(args);
@@ -409,9 +409,9 @@ bool MbD::SymbolicParser::raisedTo()
{
if (peekForTypeNoPush("^")) {
if (symfunction()) {
auto exp = stack->top();
Symsptr exp = stack->top();
stack->pop();
auto base = stack->top();
Symsptr base = stack->top();
stack->pop();
auto pow = std::make_shared<Power>(base, exp);
stack->push(pow);
@@ -488,7 +488,7 @@ void MbD::SymbolicParser::combineStackTo(int pos)
{
auto args = std::make_shared<std::vector<Symsptr>>();
while (stack->size() > pos) {
auto arg = stack->top();
Symsptr arg = stack->top();
stack->pop();
args->push_back(arg);
}

View File

@@ -15,6 +15,7 @@
#include "Solver.h"
#include "System.h"
#include "IntegratorInterface.h"
//#include "Constraint.h"
//#include "NewtonRaphson.h"
//#include "QuasiIntegrator.h"
@@ -87,7 +88,7 @@ namespace MbD {
double errorTolAccKine = 1.0e-6;
int iterMaxPosKine = 25;
int iterMaxAccKine = 25;
std::shared_ptr <QuasiIntegrator> basicIntegrator;
std::shared_ptr <IntegratorInterface> basicIntegrator;
std::shared_ptr<std::vector<double>> tstartPasts;
double tstart = 0.0;
double tend = 25;

View File

@@ -70,10 +70,15 @@ void VectorNewtonRaphson::calcdxNorm()
bool VectorNewtonRaphson::isConverged()
{
return dxNorms->at(iterNo) < dxTol || this->isConvergedToNumericalLimit();
return dxNorms->at(iterNo) < dxTol || isConvergedToNumericalLimit();
}
void VectorNewtonRaphson::xEqualxoldPlusdx()
{
x = xold->plusFullColumn(dx);
}
void VectorNewtonRaphson::handleSingularMatrix()
{
assert(false);
}

View File

@@ -27,6 +27,7 @@ namespace MbD {
bool isConverged() override;
void xEqualxoldPlusdx() override;
virtual void basicSolveEquations() = 0;
virtual void handleSingularMatrix();
std::shared_ptr<MatrixSolver> matrixSolver;
int n;

View File

@@ -39,7 +39,7 @@ Assembly
Name
structural_node_1
Position3D
-0.121 -8.796847998598882e-19 -0.08
-0.06210573361337854 0.04852643537547956 -4.033966837940965e-17
RotationMatrix
1 0 0
0 1 0
@@ -77,7 +77,7 @@ Assembly
Name
Marker0
Position3D
0.121 8.796847998598882e-19 0.08
0.06210573361337854 -0.04852643537547956 4.033966837940965e-17
RotationMatrix
1 0 0
0 1 0
@@ -94,11 +94,11 @@ Assembly
Name
Marker1
Position3D
0 0 0
0.2521057336133785 0.1114735646245204 0.135
RotationMatrix
1 0 0
0 1 0
0 0 1
2.220446049250313e-16 -1 0
1 2.220446049250313e-16 0
-0 0 1
RefPoint
Position3D
0 0 0
@@ -128,35 +128,18 @@ Assembly
Name
Marker3
Position3D
0 0 0
0 0.1114735580310104 2.411867397077946e-17
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker4
Position3D
0 8.796847998604521e-19 0.08
RotationMatrix
2.220446049250313e-16 -2.220446049250313e-16 1
1 0 -2.220446049250313e-16
4.930380657631324e-32 1 2.220446049250313e-16
-1.110223024625157e-16 -2.220446049250313e-16 -1
-1 1.232595164407831e-32 1.110223024625157e-16
-1.232595164407831e-32 1 -2.220446049250313e-16
RefCurves
RefSurfaces
Part
Name
structural_node_2
Position3D
-0.015 0.092 0.008
0.01166600667694188 0.1599999999999978 -1.208436328934954e-19
RotationMatrix
1 0 0
0 1 0
@@ -170,15 +153,15 @@ Assembly
Name
MassMarker
Position3D
-0.03260146715730948 0 -0.02828676225522106
0 0 2.084363289349543e-20
RotationMatrix
0.9047806520640266 0 0.4258778834954861
-0 1 0
-0.4258778834954861 -0 0.9047806520640266
1 0 0
0 1 0
0 0 1
Mass
1.448636188351172
3.805252376198168
MomentOfInertias
-6.403381706494366e-05 0.000172946750980814 0.0009386368528037903
0.031674420620509 0.029604112147595 0.002867529429125
Density
10
RefPoints
@@ -194,11 +177,11 @@ Assembly
Name
Marker0
Position3D
-0.07000000000000001 0 -0.055
0.08833399332305812 2.216893335571513e-15 0.065
RotationMatrix
1 0 0
0 1 0
0 0 1
2.220446049250313e-16 -1 0
1 2.220446049250313e-16 0
-0 0 1
RefPoint
Position3D
0 0 0
@@ -211,35 +194,18 @@ Assembly
Name
Marker1
Position3D
0 0 0
-0.1616660066769419 2.216893335571513e-15 0
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker2
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
2.220446049250313e-16 -1 0
-1 -2.220446049250313e-16 -0
0 0 -1
RefCurves
RefSurfaces
Part
Name
structural_node_3
Position3D
0.08799999999999999 -0.055 0.05
0.2111281366952498 0.16 -2.021769781041616e-18
RotationMatrix
1 0 0
0 1 0
@@ -253,15 +219,15 @@ Assembly
Name
MassMarker
Position3D
7.872813512221911e-15 1.030286966852145e-15 -0.02499999999999804
0 0 2.176978104161549e-20
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
2.85294865570677
15.23878495484552
MomentOfInertias
0.001956310318021008 0.03371514809951082 0.03383792198797204
0.09813066341583701 0.095433846761275 0.077043262824289
Density
10
RefPoints
@@ -277,11 +243,11 @@ Assembly
Name
Marker0
Position3D
-0.14 0 -0.025
-0.02112813669524979 0 0.135
RotationMatrix
0 1 0
-1 0 0
0 -0 1
2.220446049250313e-16 -1 0
1 2.220446049250313e-16 0
-0 0 1
RefPoint
Position3D
0 0 0
@@ -294,18 +260,18 @@ Assembly
Name
Marker1
Position3D
0.14 0 -0.025
-0.1111281366952498 0 0.065
RotationMatrix
1 0 0
0 1 0
0 0 1
2.220446049250313e-16 -1 0
1 2.220446049250313e-16 0
-0 0 1
RefCurves
RefSurfaces
Part
Name
structural_node_4
Position3D
0.3200000010688326 1.479668852873333e-10 0.04999999225971574
-0.1812239275015207 0.1600000016990933 -4.340477856936436e-12
RotationMatrix
1 0 0
0 1 0
@@ -319,15 +285,15 @@ Assembly
Name
MassMarker
Position3D
0.04558083463411935 2.029935404126667e-10 -1.256225144885548e-08
0 0 -4.306356366563123e-20
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
10.85942720262215
2.865603331977783
MomentOfInertias
0.07706742098795094 0.06635181579849883 0.06179235045624136
0.010133521085753 0.006853402672398001 0.00669113151275
Density
10
RefPoints
@@ -360,7 +326,7 @@ Assembly
Name
Marker1
Position3D
0 0 0
0 -8.292603282173139e-09 4.340448411165876e-12
RotationMatrix
1 0 0
0 1 0
@@ -377,7 +343,7 @@ Assembly
Name
Marker2
Position3D
0 0 0
0.03122392750152071 -1.69909327496498e-09 7.275957614183426e-15
RotationMatrix
1 0 0
0 1 0
@@ -394,53 +360,53 @@ Assembly
/Assembly/Marker0
MarkerJ
/Assembly/structural_node_1/Marker0
SphericalJoint
RevoluteJoint
Name
joint_2
MarkerI
/Assembly/structural_node_1/Marker1
MarkerJ
/Assembly/structural_node_2/Marker0
/Assembly/structural_node_3/Marker0
RevoluteJoint
Name
joint_3
MarkerI
/Assembly/structural_node_2/Marker1
MarkerJ
/Assembly/structural_node_3/Marker0
PointInLineJoint
Name
joint_5
MarkerI
/Assembly/structural_node_4/Marker0
/Assembly/structural_node_2/Marker0
MarkerJ
/Assembly/structural_node_3/Marker1
NoRotationJoint
Name
joint_6
joint_4
MarkerI
/Assembly/structural_node_1/Marker2
MarkerJ
/Assembly/structural_node_4/Marker0
PointInLineJoint
Name
joint_5
MarkerI
/Assembly/structural_node_1/Marker3
MarkerJ
/Assembly/structural_node_4/Marker1
PointInLineJoint
Name
joint_7
joint_6
MarkerI
/Assembly/structural_node_1/Marker4
/Assembly/structural_node_2/Marker1
MarkerJ
/Assembly/structural_node_4/Marker2
Motions
RotationalMotion
Name
joint_4
joint_2Motion
MarkerI
/Assembly/structural_node_1/Marker2
/Assembly/structural_node_1/Marker1
MarkerJ
/Assembly/structural_node_2/Marker2
/Assembly/structural_node_3/Marker0
MotionJoint
/Assembly/joint_2
RotationZ
0
integral(time, rampstep(time, 0.0, 0.0, 1.0, 0.0 + 10.0*(1.0 - 0.0)))
GeneralConstraintSets
ForceTorques
ConstantGravity
@@ -455,7 +421,7 @@ Assembly
hmax
1
hout
0.1
0.01
errorTol
1e-06
AnimationParameters

File diff suppressed because one or more lines are too long

View File

@@ -1,435 +0,0 @@
OndselSolver
Assembly
Notes
(Text string: '' runs: (Core.RunArray runs: #() values: #()))
Name
Assembly
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Velocity3D
0 0 0
Omega3D
0 0 0
RefPoints
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker0
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
RefCurves
RefSurfaces
Parts
Part
Name
structural_node_1
Position3D
-0.121 -1.218180697837851e-18 -0.08
RotationMatrix
1 0 0
0 1 0
0 0 1
Velocity3D
0 0 0
Omega3D
0 0 0
FeatureOrder
PrincipalMassMarker
Name
MassMarker
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
1
MomentOfInertias
1 2 3
Density
10
RefPoints
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker0
Position3D
0.121 1.218180697837851e-18 0.08
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker1
Position3D
0 1.218180697837851e-18 0.05
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker2
Position3D
0 1.218180697837785e-18 0.08
RotationMatrix
2.220446049250313e-16 -2.220446049250313e-16 1
1 0 -2.220446049250313e-16
4.930380657631324e-32 1 2.220446049250313e-16
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker3
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
RefCurves
RefSurfaces
Part
Name
structural_node_2
Position3D
-0.04753704894473842 0.09742200410568831 -0.03029347681223059
RotationMatrix
0.9512512425641979 -0.1267494082121462 0.2811683855591535
0.167731259496521 0.9776506595433678 -0.1267494082121462
-0.258819045102521 0.167731259496521 0.9512512425641977
Velocity3D
0 0 0
Omega3D
0 0 0
FeatureOrder
PrincipalMassMarker
Name
MassMarker
Position3D
7.105427357601002e-18 0 7.105427357601002e-18
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
1.448636188351172
MomentOfInertias
0.002871751015088 0.002864447840812 0.0007089594589930001
Density
10
RefPoints
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker0
Position3D
-0.03739853284269051 0 0.003286762255221063
RotationMatrix
1 0 5.204170427930421e-18
-0 1 0
-5.204170427930421e-18 -0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker1
Position3D
0.03260146715730949 1.4210854715202e-17 0.05328676225522106
RotationMatrix
1 -0 5.204170427930421e-18
0 1 0
-5.204170427930421e-18 0 1
RefCurves
RefSurfaces
Part
Name
structural_node_3
Position3D
0.07099630277370235 -0.07364765799707981 0.05840790082376057
RotationMatrix
0.9622501868990581 0.01433011691863463 -0.271788935686915
-0.08715574274765801 0.9622501868990581 -0.2578341604963
0.2578341604963001 0.271788935686915 0.9271743741709766
Velocity3D
0 0 0
Omega3D
0 0 0
FeatureOrder
PrincipalMassMarker
Name
MassMarker
Position3D
2.842170943040401e-17 -1.4210854715202e-17 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
2.852948655706768
MomentOfInertias
0.03383792198797 0.033715148099504 0.001956310318013
Density
10
RefPoints
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker0
Position3D
-0.1400000000000079 -1.044497821567347e-15 0.02499999999999804
RotationMatrix
3.322229154067983e-33 1 -5.551115123125784e-17
-1 0 -5.984795992119986e-17
-5.984795992119986e-17 5.551115123125784e-17 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker1
Position3D
0.1399999999999913 4.423128530106624e-16 9.79127889877418e-15
RotationMatrix
0.7254861972346578 0.6882367162699149 2.719509169040251e-15
-0.6882367162699149 0.7254861972346578 1.258675848677982e-14
6.689702964032028e-15 -1.100318561045113e-14 1
RefCurves
RefSurfaces
Part
Name
structural_node_4
Position3D
0.3723079639890564 0.04333150035096042 0.008140985321785409
RotationMatrix
0.9659258262890682 -0 0.2588190451025211
0 1 0
-0.2588190451025211 0 0.9659258262890682
Velocity3D
0 0 0
Omega3D
0 0 0
FeatureOrder
PrincipalMassMarker
Name
MassMarker
Position3D
2.842170943040401e-16 2.131628207280301e-17 2.273736754432321e-16
RotationMatrix
1 0 0
0 1 0
0 0 1
Mass
10.85942720262214
MomentOfInertias
0.07706742098794901 0.066351815798527 0.061792350456255
Density
10
RefPoints
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker0
Position3D
-0.04558083463411924 -2.029935401992589e-10 1.256225164070202e-08
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker1
Position3D
-0.04558083463411924 -2.029935401992589e-10 1.256225164070202e-08
RotationMatrix
1 0 0
0 1 0
0 0 1
RefPoint
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
Markers
Marker
Name
Marker2
Position3D
0 0 0
RotationMatrix
1 0 0
0 1 0
0 0 1
RefCurves
RefSurfaces
KinematicIJs
ConstraintSets
Joints
FixedJoint
Name
joint_1
MarkerI
/Assembly/Marker0
MarkerJ
/Assembly/structural_node_1/Marker0
RevoluteJoint
Name
joint_2
MarkerI
/Assembly/structural_node_1/Marker1
MarkerJ
/Assembly/structural_node_2/Marker0
RevoluteJoint
Name
joint_3
MarkerI
/Assembly/structural_node_2/Marker1
MarkerJ
/Assembly/structural_node_3/Marker0
PointInLineJoint
Name
joint_4
MarkerI
/Assembly/structural_node_3/Marker1
MarkerJ
/Assembly/structural_node_4/Marker0
PointInLineJoint
Name
joint_5
MarkerI
/Assembly/structural_node_1/Marker2
MarkerJ
/Assembly/structural_node_4/Marker1
NoRotationJoint
Name
joint_6
MarkerI
/Assembly/structural_node_1/Marker3
MarkerJ
/Assembly/structural_node_4/Marker2
Motions
RotationalMotion
Name
joint_2Motion
MotionJoint
/Assembly/joint_2
RotationZ
2.0*pi*time
GeneralConstraintSets
ForceTorques
ConstantGravity
0 0 0
SimulationParameters
tstart
0
tend
0.1
hmin
1e-09
hmax
1
hout
0.01
errorTol
1e-06
AnimationParameters
nframe
1000000
icurrent
1
istart
1
iend
1000000
isForward
true
framesPerSecond
30

File diff suppressed because one or more lines are too long

479
OndselSolver/cirpendu2.asmt Normal file

File diff suppressed because one or more lines are too long

493
OndselSolver/quasikine.asmt Normal file

File diff suppressed because one or more lines are too long

586
OndselSolver/smalltalk.asmt Normal file

File diff suppressed because one or more lines are too long