25 #ifndef __SYNFIG_VALUENODE_DYNAMIC_H
26 #define __SYNFIG_VALUENODE_DYNAMIC_H
35 #define MASS_INERTIA_MINIMUM 0.0000001
83 mutable std::vector<double> state;
84 void reset_state(
Time t)
const;
87 typedef etl::handle<ValueNode_Dynamic>
Handle;
115 etl::handle<const ValueNode_Dynamic> d;
118 void operator() (
const std::vector<double> &x , std::vector<double> &dxdt ,
const double t )
120 Vector u(cos(x[2]), sin(x[2]));
124 double to=(*(d->torque_))(t).
get(
double());
125 double c=(*(d->damping_coef_))(t).
get(
double());
126 double mu=(*(d->friction_coef_))(t).
get(
double());
127 double k=(*(d->spring_coef_))(t).
get(
double());
128 double tau=(*(d->torsion_coef_))(t).
get(
double());
129 double m=(*(d->mass_))(t).
get(
double());
130 double i=(*(d->inertia_))(t).
get(
double());
140 double a0=(double)(Angle::rad(tip.
angle()).
get());
145 double imr2=i+m*x[0]*x[0];
147 bool spring_is_rigid=(*(d->spring_rigid_))(t).
get(
bool());
149 bool torsion_is_rigid=(*(d->torsion_rigid_))(t).
get(
bool());
157 dxdt[1]=(fr-c*rd-k*r)/m-srd;
164 dxdt[3]=(to+fa*x[0]-mu*ad-tau*a)/imr2-sad;