ASMT output, MBDyn input and output done.

This commit is contained in:
Aik-Siong Koh
2023-11-06 18:00:24 -07:00
parent 34858977b1
commit 678d03db1f
96 changed files with 8806 additions and 4043 deletions

View File

@@ -9,6 +9,7 @@
#include "Constant.h"
#include "System.h"
#include "Units.h"
#include "Polynomial.h"
using namespace MbD;
@@ -22,7 +23,23 @@ Constant::Constant(double val) : Variable(val)
Symsptr MbD::Constant::differentiateWRT(Symsptr var)
{
return std::make_shared<Constant>(0.0);
return sptrConstant(0.0);
}
Symsptr MbD::Constant::integrateWRT(Symsptr var)
{
if (value == 0.0) return clonesptr();
auto slope = sptrConstant(value);
auto intercept = sptrConstant(0.0);
auto coeffs = std::make_shared<std::vector<Symsptr>>();
coeffs->push_back(intercept);
coeffs->push_back(slope);
return std::make_shared<Polynomial>(var, coeffs);
}
Symsptr MbD::Constant::expandUntil(Symsptr sptr, std::shared_ptr<std::unordered_set<Symsptr>> set)
{
return sptr;
}
bool Constant::isConstant()
@@ -30,11 +47,6 @@ bool Constant::isConstant()
return true;
}
Symsptr MbD::Constant::expandUntil(std::shared_ptr<std::unordered_set<Symsptr>> set)
{
return clonesptr();
}
Symsptr MbD::Constant::clonesptr()
{
return std::make_shared<Constant>(*this);
@@ -60,6 +72,11 @@ double MbD::Constant::getValue()
return value;
}
double MbD::Constant::getValue(double arg)
{
return value;
}
std::ostream& Constant::printOn(std::ostream& s) const
{
return s << this->value;