moorepants / resonance

Learning Mechanical Vibration Engineering Through Computation
https://moorepants.github.io/resonance
MIT License
47 stars 12 forks source link

Tests failing due to change in sympy #191

Closed moorepants closed 4 years ago

moorepants commented 6 years ago

Using SymPy 1.3:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-34-7b4f3b3c6ebe> in <module>
----> 1 eval_alphadot(1, 2, 3, 4, 5, 6, 7, 8, 9)
<lambdifygenerated-1> in _lambdifygenerated(_Dummy_653, _Dummy_654, _Dummy_655, _Dummy_656, m_p, m_b, l, r, g)
      3   # Derivative
      4   # Derivative
----> 5 (-g*l*m_p*sin(_Dummy_654) - g*m_b*r*(-sin(_Dummy_654) + sin(_Dummy_653 + _Dummy_654)) - l**2*m_p*Derivative(_Dummy_655, t) - m_b*r**2*(_Dummy_656**2*sin(_Dummy_653) - cos(_Dummy_653)*Derivative(_Dummy_656, t) + Derivative(_Dummy_655, t)) - m_b*r**2*cos(_Dummy_653)*Derivative(_Dummy_656, t) + m_b*r**2*(-m_b*r**2*cos(_Dummy_653)*Derivative(_Dummy_655, t) + m_b*r**2*Derivative(_Dummy_656, t) + m_b*r**2*(-g*l*m_p*sin(_Dummy_654) - g*m_b*r*(-sin(_Dummy_654) + sin(_Dummy_653 + _Dummy_654)) - l**2*m_p*Derivative(_Dummy_655, t) - m_b*r**2*(_Dummy_656**2*sin(_Dummy_653) - cos(_Dummy_653)*Derivative(_Dummy_656, t) + Derivative(_Dummy_655, t)) - m_b*r**2*cos(_Dummy_653)*Derivative(_Dummy_656, t) + (l**2*m_p + m_b*r**2)*Derivative(_Dummy_655, t))*cos(_Dummy_653)/(l**2*m_p + m_b*r**2) - m_b*r*(g*sin(_Dummy_653 + _Dummy_654) - r*cos(_Dummy_653)*Derivative(_Dummy_655, t) + r*Derivative(_Dummy_656, t)))*cos(_Dummy_653)/(-m_b**2*r**4*cos(_Dummy_653)**2/(l**2*m_p + m_b*r**2) + m_b*r**2) + (l**2*m_p + m_b*r**2)*Derivative(_Dummy_655, t))/(l**2*m_p + m_b*r**2))
NameError: name 'Derivative' is not defined
NameError: name 'Derivative' is not defined
moorepants commented 6 years ago

Works in SymPy 0.7.6.1

moorepants commented 6 years ago

This is actually due to https://github.com/sympy/sympy/issues/14958. The return type of matrices has changed.

moorepants commented 4 years ago

Just going to ignore that this doesn't work with some intermediate sympy versions.