Castigliano theorem.pdf