simulate energy flow among nodes using system of ODEs