Pendulum with dry friction

Hi,

I have decided to implement dry friction into one of my simulation models. As a first step, I created a simple example of a pendulum that I would like to share.

I am already using DifferentialEquations.jl for my project so I decided to implement the friction using the combination of a continuous callback and mixed complementarity problem solved with JuMP. I have taken the general idea from Russ Tedrake’s “underactuated” course and reformulated it so that it works in continuous time while also using a single MCP instead of three LCPs with slack variables.

Altogether I think it’s a concise and readable example that models behavior which can be quite tricky to implement. That being said, I might have made a mistake somewhere so don’t hesitate to correct me.

4 Likes

Yeah it’s cool how simple that turns out to be. Thanks for sharing!