SPSUnipi / EnergyCommunity.jl

Optimization of Energy Communities in Julia
GNU General Public License v3.0
6 stars 5 forks source link

Add business plan plot #11

Closed davide-f closed 10 months ago

davide-f commented 1 year ago

It is useful to add a function into ECModel.jl to show the business plan. Something like the following image: image

The function shall have as mandatory argument only the ECModel, as optional arguments an object that specifies what user shall be plotted and a second object representing the specific final distribution allocation of the total profit. This last parameter by default is nothing, which means that the overall costs are highlighted, whereas if a specific user is requested the plot the business plan of that specific user is plotted. As a remark, when a specific user is requested, the additional input of the final distribution allocation is needed to specify how to distribute the rewards across the users

davide-f commented 1 year ago

@TomFer97 , we discussed about this, may you be interested in addressing this issue? :)

TomFer97 commented 1 year ago

Absolutely, I'll open a Pull request asap

davide-f commented 1 year ago

Awesome! :)

As a guideline, I feel like the procedure could be as follows:

  1. add DataFrames in the dependencies (from REPL "] add DataFrames")
  2. in the Project.toml, add a line for DataFrames in compact 'Dataframes = "1"' [This is needed for publishing the new release of EnergyCommunity v0.1.1 (example)]
  3. add a function to describe the business plan. The function shall return in output a DataFrame where in the columns we have the different economic quantities and in the rows there are the different quantities for different years. Once column shall also be "year" to track that
  4. add a plotting function to plot the business plan. This function internally calls the function created in point 3 and then plot the outputs.

Both functions created in 3 and 4 shall have an optional argument to describe what user the business plan belongs to, as described in the introduction of this issue

TomFer97 commented 1 year ago

Which is the differences between?

- C_REP_tot_us[y, u] # Replacement costs

+ R_RV_tot_us[y, u] # Residual value

I do not understand the differences

davide-f commented 1 year ago

REP stands for replacement. They are the costs to replace the components once they reach their lifetime.

RV stands for recover value. They represent equivalent revenues for the components that at the end of the project could last longer. For example, if PVs last 25y but the project last 20, at the end of the project a 20% (5/25) of the value of the PV is reimbursed

davide-f commented 1 year ago

RV is always 0 for all years but the last

davide-f commented 10 months ago

Closed by #12