no place has as high a capacity factor for solar pv as 50%; the world average is 14% (i.e., 14 watts average output per 100 watts nameplate output) and the country with the highest is egypt at 35%

(this doesn't mean that you get zero power for 65% or 86% of the day. it means that you get lower than max power at all times except noon. to a great extent you can compensate by that by just installing more panels, but at night you need a better strategy)

but the capacity factor is irrelevant to the fact that solar energy on the power grid generally sells for about half the price that coal-generated electricity sells for, on the same grid, when storage capacity is insufficient. in fact, prices used to go negative at night (to avoid shutting down slow-ramping baseload plants) and now they go negative in the day

https://pv-magazine-usa.com/2020/05/28/record-low-solar-ppas... is an article from four years ago giving some specific prices: a solar ppa had just been signed for 15 dollars per megawatt hour, while the cost of production with coal at the san juan generating station was 44.90 dollars per megawatt hour, even though it was built right on top of a coal mine to save on shipping costs. that's why the san juan generating station has been decommissioned. if you look, you'll find stories like this all over the place, and solar panels now cost half of what they did when that story was written

now, it's true that a ppa that includes battery storage will be more expensive than the 1.5¢ per kilowatt-hour ppa in that article. (https://emp.lbl.gov/pv-ppa-prices has a queryable database of all the ppas signed in the usa, although the usa is less reliable as an indicator of true costs because of how its prices are artificially inflated by protectionist tariffs.) how much more expensive depends on how much utility-scale storage is needed; you suggest 12 hours, but a much more typical number in practice is 3–4 hours, partly because there are still coal plants and partly because electrical demand drops a lot at night

also, you are incorrectly assuming that 'conventional' plants have a capacity factor of 100%, when a more typical capacity factor for a coal plant is 60%

so let's consider a kind of worst case: replacing your suggested 2 gigawatts (nameplate) of coal plants in the usa, where construction costs are ridiculously inflated. before we swung the wrecking ball, those coal plants were generating 1.2 gigawatts (real) of power (10.5 billion kilowatt hours per year), so we need 1.2 gigawatts (real) of solar panels. in the usa the average capacity factor is 21% (the article i linked above is from an area with more sun than average) so that's 5.7 gigawatts peak. typical costs for utility-scale fixed-tilt solar plants in q1 02024 were 98¢ per peak watt https://www.seia.org/research-resources/solar-market-insight... including costs like permitting, design and engineering, etc. so that's 5.6 billion dollars. utility bond yields in the usa are currently at 4.35%, and often these things are amortized over 25 years. i think the amortization calculation is that you have to pay 372 million dollars a year, which works out to 3.5¢ per kilowatt hour or 35 dollars per megawatt hour. definitely too cheap for coal to compete with, but still a lot more expensive than the price that ppa came in at

so, suppose we need 4 hours of storage for our 1.2 gigawatts. that's 4800 megawatt hours. six months ago lithium-ion batteries have fallen precipitously to 139 dollars per kilowatt hour https://about.bnef.com/blog/lithium-ion-battery-pack-prices-... so we need to spend another 670 million dollars on the batteries, which adds about 12% to the cost of the project. except that in real life you need more than just a pile of batteries, you need to pour concrete and run wires and connect inverters and so on. and the batteries won't last 25 years, maybe 8, so you have to amortize this capex over a much shorter period. but it should be clear that this is not a crushing cost that dwarfs the cost of the solar farm

(theoretically lead-acid might be cheaper by a factor of 1.5 or 2 or so, but lithium-ion's advantages seem to have driven it out of the utility-scale market)

aha, here we go.
https://atb.nrel.gov/electricity/2023/utility-scale_battery_... says that a 4-hour 60-megawatt lithium-ion battery system costs 446 dollars per kilowatt hour and has 240 megawatt hours of storage. so our required 4800 megawatt hours cost 2 billion dollars. that's about three times the cost estimate above for just the batteries, but that's an estimate from before the batteries dropped in cost by half, so 1.3 billion dollars is a better estimate. this plus the 5.6 billion dollars for the solar plant gives us a total up-front cost of 6.9 billion dollars

since it's getting late, i'll just link you to this four-year-old profile of a ppa for 20 dollars a megawatt hour for generation plus 20 dollars a megawatt hour for storage https://www.energy-storage.news/battery-storage-at-us20-mwh-... and this lawrence radiation lab brief https://eta-publications.lbl.gov/sites/default/files/utility...

the main reason for the difference seems to be how sunny the location is; the technical brief explains:

> Aided by the ITC, most recent PPAs in our sample are priced around $20/MWh
(on a levelized basis, expressed in real 2021 dollars, and including bundled energy, capacity, and RECs) for
plants located in the West, and $30-$40/MWh for plants elsewhere in the continental United States.

the itc is a subsidy, so the real cost is a bit higher (due to the tariffs)