Skip to content

Double Pendulum example lacks explanations #529

Open
@muendlein

Description

@muendlein

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions