Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F95204126
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
Fri, Dec 13, 17:18
Size
1 KB
Mime Type
text/x-c
Expires
Sun, Dec 15, 17:18 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22918471
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)
: Oscillateur(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)
: Oscillateur(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(m2()*l*p_prime[0]*p_prime[0]*cos(dteta())*sin(dteta()));
double d(mp()*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