Financial Payback and Sensitivity Analysis for Renewable Energy
Arrays & HashingAuto-graded · 2 test casesLast updated
Perform quantitative financial modeling and sensitivity analysis for renewable energy pilot projects.
An energy firm is assessing two potential renewable pilot projects operating under a fixed electricity selling price of $40 per MWh.
-
Solar Facility:
- Initial Capital Investment: $12.5 million
- Operating Expenses: $0/MWh
- Annual Generation: 75% probability of high yield (150,000 MWh/year) and 25% probability of low yield (50,000 MWh/year).
-
Ethanol Facility:
- Initial Capital Investment: $2.5 million
- Operating Expenses (Variable Cost): $30/MWh
- Annual Generation: Deterministic 100,000 MWh/year.
Write a function evaluate_pilot_sensitivity that calculates key financial baseline figures and sensitivity break-even values for both plants:
solar_expected_mwh: The expected annual output for the solar facility (MWh).solar_payback_years: Simple payback period for solar in years ($\frac{\text{Initial Capital}}{\text{Annual Cash Flow}}$).ethanol_expected_mwh: The annual output for the ethanol facility (MWh).ethanol_payback_years: Simple payback period for ethanol in years.ethanol_price_for_2_year_payback: The required electricity selling price ($/MWh) for ethanol to achieve a 2.0-year payback period, holding variable costs constant.solar_minimum_sunny_fraction_for_3_year_payback: The minimum high-yield sunny probability $s$ required for solar to achieve a payback period of at most 3.0 years at $40/MWh.
Constraints
- The function takes no input arguments and returns a dictionary with exact float values corresponding to the keys specified above.
Examples
Example 1
Input: evaluate_pilot_sensitivity()
Output: {'solar_expected_mwh': 125000, 'solar_payback_years': 2.5, 'ethanol_expected_mwh': 100000, 'ethanol_payback_years': 2.5, 'ethanol_price_for_2_year_payback': 42.5, 'solar_minimum_sunny_fraction_for_3_year_payback': 0.5416666666666667}
Hints
Hint 1
Calculate annual expected MWh by taking the probability-weighted average of generation outputs.
Hint 2
Annual cash flow equals MWh generated multiplied by the unit net margin (Price - Variable Cost).
Hint 3
To solve for break-even parameters, set Payback = Capital / Cash Flow and isolate the target variable.
Worked solution
Easy Try it yourself first — then compare your approach, complexity and edge cases.
Approach
The problem requires straightforward quantitative financial modeling and sensitivity solving:
-
Expected Output Calculation:
- Solar: Weighted average output $E[\text{MWh}] = 0.75 \times 150,000 + 0.25 \times 50,000 = 125,000\text{ MWh/yr}$.
- Ethanol: Fixed output of $100,000\text{ MWh/yr}$.
-
Simple Payback Period:
- $\text{Cash Flow} = \text{MWh} \times (P - \text{Variable Cost})$.
- Solar Cash Flow = $125,000 \times ($40 - $0) = $5,000,000$. Payback = $\frac{$12.5\text{M}}{$5.0\text{M}} = 2.5\text{ years}$.
- Ethanol Cash Flow = $100,000 \times ($40 - $30) = $1,000,000$. Payback = $\frac{$2.5\text{M}}{$1.0\text{M}} = 2.5\text{ years}$.
-
Ethanol Price Sensitivity:
- For a 2.0-year payback, required annual cash flow is $\frac{$2,500,000}{2.0} = $1,250,000$.
- Margin required = $\frac{$1,250,000}{100,000\text{ MWh}} = $12.50\text{/MWh}$.
- Required price $P = $30.00 + $12.50 = $42.50\text{/MWh}$.
-
Solar Sunny Fraction Sensitivity:
- For a 3.0-year payback, required annual cash flow is $\frac{$12,500,000}{3.0} \approx $4,166,666.67$.
- Required MWh = $\frac{$4,166,666.67}{$40} = 104,166.67\text{ MWh}$.
- Output formula: $150,000 \cdot s + 50,000 \cdot (1 - s) = 50,000 + 100,000 \cdot s$.
- Solving $50,000 + 100,000 \cdot s = 104,166.67$ gives $s = \frac{54,166.67}{100,000} = \frac{13}{24} \approx 0.541667$.
Complexity
- Time Complexity: $\mathcal{O}(1)$ as calculations consist of closed-form arithmetic evaluations.
- Space Complexity: $\mathcal{O}(1)$ for storing constant dictionary outputs.
from typing import Dict
def evaluate_pilot_sensitivity() -> Dict[str, float]:
price = 40.0
# Solar metrics
solar_expected_mwh = 0.75 * 150_000 + 0.25 * 50_000
solar_cash_flow = solar_expected_mwh * price
solar_payback_years = 12_500_000 / solar_cash_flow
# Ethanol metrics
ethanol_output_mwh = 100_000.0
ethanol_margin_per_mwh = price - 30.0
ethanol_cash_flow = ethanol_output_mwh * ethanol_margin_per_mwh
ethanol_payback_years = 2_500_000 / ethanol_cash_flow
# Ethanol target price for 2.0-year payback
ethanol_price_for_2_year_payback = 30.0 + 2_500_000 / (2.0 * ethanol_output_mwh)
# Solar minimum sunny fraction for 3.0-year payback
solar_output_at_3_year_payback = 12_500_000 / (3.0 * price)
minimum_sunny_fraction = (solar_output_at_3_year_payback - 50_000) / (150_000 - 50_000)
return {
"solar_expected_mwh": solar_expected_mwh,
"solar_payback_years": solar_payback_years,
"ethanol_expected_mwh": ethanol_output_mwh,
"ethanol_payback_years": ethanol_payback_years,
"ethanol_price_for_2_year_payback": ethanol_price_for_2_year_payback,
"solar_minimum_sunny_fraction_for_3_year_payback": minimum_sunny_fraction,
}