! APMonitor Modeling Language ! http://www.apmonitor.com ! Pendulum - Index 2 DAE Model pend2 Parameters m = 1 g = 9.81 s = 1 End Parameters Variables x = 0 y = -s v = 1 w = 0 lam = m*(1+s*g)/2*s^2 End Variables Equations x * v + y * w = 0 $x = v $y = w m*$v = -2*x*lam m*$w = -m*g - 2*y*lam End Equations End Model