Hi David,
On Wed, Mar 2, 2016 at 12:50 PM, David Colson <
scal...@gmail.com> wrote:
> Hello,
>
> This issue has bothered me for a few days I can seem to see what's wrong. So
> I resorted to asking for help.
>
> I'm trying to derive the equations of motion for a double pendulum system
> using Lagrangian mechanics. It involves some unpleasant algebra to solve and
> I thought sympy would be ideal. Sympy worked perfectly right up until the
> end. I have two dependant second order differential equations, the idea
> being to substitute one into the other and solve for the second derivative
> term. That way I obtain two differential equations that are not linked by a
> second order term so I can solve it with a numerical solver.
>
> But in this substitution and solving step the result being given by sympy is
> wrong. I've gone over it countless times, and compared against the known
> solution, but it's wrong, and I can't see why. I've remembered to subtract
> the term on the right hand side of the equation so I'm solving for something
> equal to zero. But still the answer is wrong. I don't believe it possible
> that sympy is wrong, but I cannot see where I am making a mistake. I'd
> appreciate it if someone else took a glance at it.
It's definitely possible that SymPy is wrong. We need to investigate
this further to see if it's a bug in sympy or in your derivation.
In general SymPy is pretty well tested, but once in a while you can find a bug.
> Here is an ipython notebook containing the entire derivation and solution.
> I've left some notes explaining where it goes wrong.
Here is a view of your notebook:
http://nbviewer.jupyter.org/urls/dl.dropboxusercontent.com/u/53792213/Double%20Pendulum%20Solution.ipynb
Unfortunately I don't have time right now to look into it. You might
also be interested in trying
pydy.org, which uses sympy and it has a
double pendulum example:
http://www.pydy.org/examples/double_pendulum.html
Ondrej
>
> Thank you kindly for any help!
>
> David.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sympy+un...@googlegroups.com.
> To post to this group, send email to
sy...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/sympy.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/sympy/09bfc087-b6c1-49db-9ab7-3ae1bd610667%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.