Simulation Notes Europe, Volume 29(2), June 2019

Direct Implementation of ARGESIM Benchmark C7 'Constrained Pendulum' in MATLAB and EXCEL

Simulation Notes Europe SNE 29(2), 2019, 105-110
DOI: 10.11128/sne.29.bne07.10478

Abstract

This Benchmark Report with educational aspects presents a straightforward and direct implementation of ARGESIM Benchmark C7 ‘Constrained Pendulum’ in MATLAB and in EXCEL: the given models are implemented without any change, and the tasks are directly simulated without any rearrangement. Central issue of this benchmark is the detection and handling of a state event: when the pendulum hits or releases a pin, pendulum length and angular velocity are changing discontinuously.
The MATLAB approach makes use of the event termination feature of the ODE solvers, and a MATLAB script loops between long and short pendulum and handles the event changes. The EXCEL approach solves the overall ODEs by Euler algorithm (a simple EXCEL recursion). The events are synchronized with the chosen time step (detection with delay), and handled by distinction of cases in any state update (no event, hit, release, velocity jump). The MATLAB implementation is straightforward but makes use of different models necessary. The EXCEL implementation shows that a spreadsheet tool – not really designed for simulation - can do simulation by direct implementation of ODE algorithms, but event-handling causes elaborate case-bycase analysis.