Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++


The aim - Create a Code to calculate the ROI ( return on investment - is a performance measure used to evaluate the efficiency or profitability ROI tries to directly measure the amount of return on a particular investment, relative to the investment’s cost. To calculate ROI, the benefit  of an investment is divided by the cost of the investment. The result is expressed as a percentage or a ratio) of PV (photovoltaic) power station. 
Overview of the situation. In Lithuania, all household electricity consumers (who cannot build a PV power plant on their own roof) can purchase a part of a PV power plant (located anywhere in the country). PV power plants/parks in Lithuania are developing and maintaining by various private companies. 
When a consumer purchases part of a power plant, he receives all the electricity produced by his part of purchased power plant by paying only the electricity grid ("storage"" fee". 
If the consumer is short of electricity (this can happen in winter), the consumer pays the full price for the missing electricity according to the contract
The solar energy produced in the PV plant / park transmitted to the ESO (power distribution operator) electricity grid. The amount of electricity the consumer use at home metered and consumer pays ESO a network "storage" fee every month according to the billing method consumer chose. Unused energy is stored in the electricity grid and transferred to the next month in the accounting. Unused electricity accumulated from April 1 of each year until March 31 of the following year. However, it happens that during this period consumer does not use the entire amount of stored energy. Then consumer entitled to compensation. Last year it was 0.0698 €/kwh (the average electricity price in NORD POOL market) 

DATA for task:
Initial costs 
A 1.5kW PV power plant was purchased.
The price of 1KW of power is 920 €. 
The state reimburses (refunds) 30% of the power plant price. 
Annual service costs (PV station requires maintance)
22.9 € per 1kW of power. 

Data of first 2 years of electricity production, consumption ad prices.
Date	Electricity consumed, kWh	Electricity produced, kWh	Full price for 1kWh of electricity, € 	Electricity grid „storage" fee price per kWh, €
2021 January	285 	7,83	0,141	0,05445
2021 February	242	57,03	0,141	0,05445
2021 March	220	114,29	0,141	0,05445
2021 April	153	176,04	0,141	0,05445
2021 May	125	221,95	0,141	0,05445
2021 June	104	275,22	0,141	0,05445
2021 July	92	247,78	0,152	0,05445
2021 August	109	166,77	0,152	0,05445
2021 September	182	149,32	0,152	0,05445
2021 October	174	117,42	0,152	0,05445
2021 November	211	35,66	0,152	0,05445
2021 December	176	7,71	0,152	0,05445
2022 January	226	19,21	0,167	0,04477
2022 February	228	52,86	0,167	0,04477
2022 March	220	207,2	0,167	0,04477
2022 April	136	207,35	0,167	0,04477
2022 May	129	218,31	0,167	0,04477
2022 June	121	224,19	0,167	0,04477
2022 July	92	220,31	0,1826	0,04477
2022 August	108	225,58	0,1826	0,04477
2022 September	160	151,25	0,1826	0,04477
2022 October	167	92,12	0,1826	0,04477
2022 November	202	17,08	0,1826	0,04477
2022 December	225	6	0,1826	0,04477

Use the average electricity consumption for each subsequent year (calculate the average for each month from the available 2 years of data).
For each subsequent year, calculate a decrease in electricity production of 1% from the average (calculate the average for each month from the available 2 years of data).
Allow manual methods to enter the full price of electricity and electricity grid "storage" fee, twice a year in January and July.

Task Calculate in how many months the money invested in the PV (solar) power plant will return. Calculate with (30% refunds from government) and without state support.

Show calculation result in columns: months, production, consumption, payback, payback minus service cost, cumulative payback. You can add extra columns (electricity price, stored electricity in grid, price of network fee) 


What I have tried:

I tried somthings but i dont think it will be helpfull in any manner .
Posted
Updated 3-Jan-23 1:58am

1 solution

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

Just posting your assignment and saying "I tried" isn't going to get you anywhere.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
Comments
marcialo malphigi 3-Jan-23 8:33am    
#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main()
{
// Initial costs
double powerPlantPrice = 1500.0;
double powerPrice = 920.0;
double stateReimbursement = 0.3;
double annualServiceCostPerKW = 22.9;

// Calculate initial cost after state reimbursement
double initialCost = powerPlantPrice * (1 - stateReimbursement);

// Electricity production and consumption data for first 2 years
double electricityConsumed[24] = {285, 242, 220, 153, 125, 104, 92, 109, 182, 174, 211, 176, 226, 228, 220, 136, 129, 121, 92, 108, 160, 167, 202, 225};
double electricityProduced[24] = {7.83, 57.03, 114.29, 176.04, 221.95, 275.22, 247.78, 166.77, 149.32, 117.42, 35.66, 7.71, 19.21, 52.86, 207.2, 207.35, 218.31, 224.19, 220.31, 225.58, 151.25, 92.12, 17.08, 6};
double fullPricePerKWH[24] = {0.141, 0.141, 0.141, 0.141, 0.141, 0.141, 0.152, 0.152, 0.152, 0.152, 0.152, 0.152, 0.167, 0.167, 0.167, 0.167, 0.167, 0.167, 0.1826, 0.1826, 0.1826, 0.1826, 0.1826, 0.1826};
double gridFeePerKWH[24] = {0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.05445, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477, 0.04477};

// Calculate total revenue and expenses over 2 years
double totalRevenue = 0.0;
double totalExpenses = 0.0;
for (int i = 0; i < 24; i++)
{
totalRevenue += electricityProduced[i] * (fullPricePerKWH[i] - gridFeePerKWH[i]);
totalExpenses += annualServiceCostPerKW * electricityProduced[i];
}

// Calculate ROI
double ROI = (totalRevenue - totalExpenses - initialCost) / initialCost;

// Print ROI
printf("ROI: %.2f%%\n", ROI * 100);

return 0;
}
OriginalGriff 3-Jan-23 9:12am    
And?
When were you going to start writing the code to address the assignment?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900