SimulateTwolink.m uses inverse dynamics to simulate the torque trajectories required for a two-link planar robotic manipulator to follow a prescribed trajectory. It also computes total energy consumption. This code is provided as supplementary material for the paper:
'Engineering System Co-Design with Limited Plant Redesign'
Presented at the 8th AIAA Multidisciplinary Design Optimization Specialist Conference, April 2012.