Castiglianos theorem with truss example