Power dissipation in a Darlington built with an optocoupler and NPN
The simplest answer is that you should not use this configuration. Instead, try







simulate this circuit &ndash; Schematic created using CircuitLab

A few notes:

You can calculate the opto current from the input current times the CTR, which you get from the data sheet. Then, since this is PWM, Q2 will be switched hard on and off, and in the on condition will only have a gain of 10 to 20 (it's called being in saturation), so you can calculate the load current from that.

Knowing the opto current in mA, multiply by about 11 to get power in mW. Voltage times current, right?

If you want to reduce opto power, place another resistor from +12 to the collector of the opto, sized to drop about 9 or 10 volts at the opto current.