PyDy example fails

62 views
Skip to first unread message

Yuri Matiyasevich

unread,
May 16, 2021, 1:27:02 PM5/16/21
to PyDy
  I cannot reproduce program from

https://pydy.readthedocs.io/en/stable/

(Section Usage, Derive the system)

I got:

Traceback (most recent call last):
  File "/home/yumat/MODULES/PY_DY/pend.py", line 47, in <module>
    fr, frstar = kane.kanes_equations(forces, particles)     # Generate EoM's fr + frstar = 0
  File "/home/yumat/PYTHON_ENVIRONMENT_1/lib/python3.7/site-packages/sympy/physics/mechanics/kane.py", line 536, in kanes_equations
    fr = self._form_fr(loads)
  File "/home/yumat/PYTHON_ENVIRONMENT_1/lib/python3.7/site-packages/sympy/physics/mechanics/kane.py", line 282, in _form_fr
    vel_list, f_list = _f_list_parser(fl, N)
  File "/home/yumat/PYTHON_ENVIRONMENT_1/lib/python3.7/site-packages/sympy/physics/mechanics/functions.py", line 724, in _f_list_parser
    vel_list, f_list = unzip(list(flist_iter()))
  File "/home/yumat/PYTHON_ENVIRONMENT_1/lib/python3.7/site-packages/sympy/physics/mechanics/functions.py", line 711, in flist_iter
    obj, force = pair
TypeError: cannot unpack non-iterable Particle object

This occurs on two different machines, and similar errors happened with other examples.

What could be wrong?

Yuri Matiyasevich

Andy Froncioni

unread,
Jul 2, 2022, 11:27:04 AM7/2/22
to PyDy
I get the same error.   :-(

Jason Moore

unread,
Jul 2, 2022, 12:27:25 PM7/2/22
to py...@googlegroups.com
kanes_equations() had a deprecation some years back. The API is now:

fr, frstar = kane.kanes_equations(particles, forces)


And more info on the deprecation:


Jason

--
You received this message because you are subscribed to the Google Groups "PyDy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pydy+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pydy/c710e943-c38c-471a-85eb-1e320c80093cn%40googlegroups.com.

Andy Froncioni

unread,
Jul 2, 2022, 12:37:32 PM7/2/22
to PyDy
Thanks a bunch, Jason!  Hope you're well, buddy.

Jason Moore

unread,
Jul 2, 2022, 12:49:07 PM7/2/22
to py...@googlegroups.com
Andy,

Yes, doing good. I started a project with Garmin/Tacx so maybe we'll connect sometime in the future.

Also, I just wrote this book for my class that uses SymPy mechanics:


It may also be a good resource.

Jason

Reply all
Reply to author
Forward
0 new messages