A: In one sense the cost is indeed zero. You do not write checks for the electricity produced by your solar panels so in that sense it is zero. However, a more common definition is the Levelized Cost of Energy (LCOE) which is the upfront cost of the array divided by the amount of kWh it produces over its lifetime. This works out to be about 5c/kWh if you have a sunny roof and about 10c/kWh if your roof is in about half shade.