It's been done and it's called the levelized cost of electricity. Do your homework.
The levelized cost of electricity (LCOE) is given by:
{\displaystyle \mathrm {LCOE} ={\frac {\text{sum of costs over lifetime}}{\text{sum of electrical energy produced over lifetime}}}={\frac {\sum _{t=1}^{n}{\frac {I_{t}+M_{t}+F_{t}}{\left({1+r}\right)^{t}}}}{\sum _{t=1}^{n}{\frac {E_{t}}{\left({1+r}\right)^{t}}}}}}
It:investment expenditures in the year t
Mt

perations and maintenance expenditures in the year t
Ft:fuel expenditures in the year t
Et:electrical energy generated in the year t
r:discount rate
n:expected lifetime of system or power station