Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102837740
pendulec.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Feb 24, 17:08
Size
1 KB
Mime Type
text/x-c
Expires
Wed, Feb 26, 17:08 (1 d, 19 h)
Engine
blob
Format
Raw Data
Handle
24428843
Attached To
rSYMKIT symkit
pendulec.cpp
View Options
#include "pendulec.h"
#include <cmath>
double PenduleC::g = 9.81;
void PenduleC::setGravity(const double& g)
{
PenduleC::g=g;
}
PenduleC::PenduleC(const Vector& p, const Vector& p_prime, const double& l, const double& m)
: OscillateurSimple(p, p_prime), l(l), m(m)
{}
PenduleC::PenduleC(const std::vector<double>& p, const std::vector<double>& p_prime, const double& l, const double& m)
: OscillateurSimple(p, p_prime), l(l), m(m)
{}
void PenduleC::setOtherPendule(const PenduleC * other)
{
this->other=other;
}
double PenduleC::getl() const
{
return l;
}
double PenduleC::getm() const
{
return m;
}
void PenduleC::setl(const double& l)
{
this->l=l;
}
void PenduleC::setm(const double& m)
{
this->m=m;
}
Vector PenduleC::equation() const
{
double a(mp()*g*cos(dteta())*sin(other->getp()[0]));
double b((m+other->getm())*g*sin(p[0]));
double c(ms()*l*p_prime[0]*p_prime[0]*cos(dteta())*sin(dteta()));
double d(mt()*other->getl()*other->getp_prime()[0]*other->getp_prime()[0]*sin(dteta()));
return { (a -b +c +d)/(l*m1() + l*m2()*sin(dteta())*sin(dteta())) };
}
Event Timeline
Log In to Comment