SciMLTutorials.jl icon indicating copy to clipboard operation
SciMLTutorials.jl copied to clipboard

Double Pendulum example lacks explanations

Open muendlein opened this issue 2 years ago • 1 comments

The double pendulum example has a certain mismatch between the code and the explanations surrounding it: https://tutorials.sciml.ai/html/models/01-classical_physics.html

It firstly lists the underlying equations but then provides the some code without any context while also introducing additional variables (i.e. m1, m2). This ODE function needs some context, currently no equations or additional information are provided:

function double_pendulum(xdot,x,p,t)
    xdot[1]=x[2]
    xdot[2]=-((g*(2*m₁+m₂)*sin(x[1])+m₂*(g*sin(x[1]-2*x[3])+2*(L₂*x[4]^2+L₁*x[2]^2*cos(x[1]-x[3]))*sin(x[1]-x[3])))/(2*L₁*(m₁+m₂-m₂*cos(x[1]-x[3])^2)))
    xdot[3]=x[4]
    xdot[4]=(((m₁+m₂)*(L₁*x[2]^2+g*cos(x[1]))+L₂*m₂*x[4]^2*cos(x[1]-x[3]))*sin(x[1]-x[3]))/(L₂*(m₁+m₂-m₂*cos(x[1]-x[3])^2))
end

The initial equations block only makes sense in the next subchapter (Poincaré section).

muendlein avatar Aug 20 '22 00:08 muendlein

Yes indeed, I agree with you that it would be good to get this one fleshed out a bit more.

ChrisRackauckas avatar Aug 31 '22 17:08 ChrisRackauckas