Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double Pendulum example lacks explanations #529

Open
muendlein opened this issue Aug 20, 2022 · 1 comment
Open

Double Pendulum example lacks explanations #529

muendlein opened this issue Aug 20, 2022 · 1 comment

Comments

@muendlein
Copy link

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).

@ChrisRackauckas
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants