Find the total power dissipated in the circuit below using the node voltage method.

The chosen node voltage variables are shown in brown; the voltage shown in blue was added to facilitate the solution.
I will sum the currents out of the nodes.
Node A
There is a slight difficulty with node A due to the voltage source in series with the 12 ohm resistor. I have added the variable V12 to help with determining the current out of node A through the 12 ohm resistor. Not that the polarity of V12 was chosen so that the current leaving the node enters the positive reference.
We know that the total voltage from node A to the reference node (which is just VA) must equal the summ of the voltages across the 12 ohm resistor and the voltage source, thus
VA = V12 - 40
so
V12 = VA + 40
Now we can write KCL at node A
Multiply through by 300
25 VA + 1000 + 12 VA + 15 VA - 15 VB + 1500 = 0
52 VA - 15 VB + 0 VC = - 2500 (Equation 1)
Multiply through by 40
2 VB - 2 VA + VB - VC - 300 - 200 = 0
- 2 VA + 3 VB - VC = 500 (Equation 2)
Multiply through by 40
VC - VB + VC + 300 = 0
0 VA - VB + 2 VC = - 300 (Equation 3)
Solving the three equations gives
VA = - 10
VB = 132
VC = - 84
First the resistors.
12 Ohm
P12 = (V12)2 / 12 = 302 / 12
P12 = 75 W20 Ohm
P20 = (VA - VB)2 / 20 = (-142)2 / 20
P20 = 1008.2 W25 Ohm
P25 = VA2 / 25 = (-10)2 / 25
P25 = 4 W40 Ohm (right side)
P40A = (VB - VC)2 / 40 = 2162 / 40
P40A = 1166.4 W40 Ohm (bottom)
P40B = VC2 / 40 = (-84)2 / 40
P40B = 176.4 WThe total power dissipated by the resistors is the sum of the above, or
PR = 2430 W
Now we need to determine if any of the sources are actually absorbing power.
The power generated by the 40 Volt source is 40 (V12 / 12) = 40 (-10 + 40) / 12
Since this is obviously positive, the 40 volt source is NOT absorbing power.The power generated by the 5 amp source is (VB - VA) (5) = (132 + 10) (5)
This is also positive, thus the 5 amp source is NOT absorbing power.The power generated by the 7.5 amp source is (VB - VC) (7.7) = (132 + 84) (7.5)
This again is positive, so the 7.5 amp source is NOT absorbing power.The total power absorbed in the circuit is thus equal to the total power absorbed by the resistors which we found above to be
PR = 2430 W