## 2 Materials and Methods
### Economic Assessment  
In this section, we present the second stage of the evaluation methodology, which describes the estimation of the economic feasibility of using energy flexibility in aluminium smelting in various deployment scenarios based on different aluminium prices and electricity peaks. The ongoing costs of the aluminium smelter are not considered in the economic assessment, as they largely depend on the market price of electricity. Given the significant variation in electricity prices, this aspect is not covered in this paper. We detail the methodology of the economic calculation for different types of applications or investments. The combination of various investment types and input prices can be used for diverse evaluation scenarios of the use of energy flexibility services for the assessment of its economic viability.  
The baseline economic calculation methodology assumes no additional investment, meaning the surplus of PV production is directly utilised for aluminium smelting.  
For this case, we use only the surplus of PV production at the national level, which we limit to the peak consumption of the large aluminium smelter. First, we calculate aluminimum smelting based on the amount of the production surplus and the typical electricity consumption to produce a tonne of aluminium as follows:  
\[AL(y)=\frac{EV(y)}{E_{AL}}\ [t], \tag{6}\]  
where \(AL(y)\) represents the yearly aluminium production for the \(y\)-th year; \(EV\) [MWh] is the amount of production surplus on a national level, limited to the peak consumption of the large aluminium producer; and \(E_{AL}\) [MWh/t] is the amount of electricity needed to produce a tonne of aluminium.  
The next step is to calculate the profitability metric, specifically the Return On Investment (\(ROI\)), for a given year \(y\), taking into account the price of aluminium and the surplus of electricity, as follows:  
\[ROI(y)=AL(y)*p_{AL}-F*EV(y)-AL(y)*c_{AL}\ [\text{EUR}], \tag{7}\]  
where \(p_{AL}\ [\text{EUR}/\text{t}]\) is the price of a tonne of aluminium; \(F\ [\text{EUR}/\text{MWh}]\) is the market price of 1 MWh of electricity surplus; and \(c_{AL}\ [\text{EUR}/\text{t}]\) represents the production cost per tonne of aluminium, which includes raw materials, labour, and maintenance. Considering an initial investment (INV) of 0, we then calculate the Net Present Value (NPV) using the established approach, taking the discount rate (\(r\)) into account, as follows:  
\[INV=0 \tag{8}\] \[NPV=\sum_{y=1}^{N}\frac{ROI(y)}{(1+r)^{y}}-INV\ [\text{EUR}],\]  
where \(N\) is the number of years.  
To further assess economic feasibility, we calculate the Internal Rate of Return (IRR) and the Payback Period (PP). The IRR offers insight into the profitability relative to the investment, while the PP indicates the time required to recover the initial costs, aiding in better investment decision making. The IRR is the discount rate that makes the NPV equal to zero. Since \(INV=0\) in this case, the IRR is not applicable. The payback period (PP) is the time required to recover the initial investment. For \(INV=0\), the payback period is immediate.  
The following subsections provide details of modifications made to the baseline economic calculation methodology for a large aluminium smelter's investment into a proprietary PV system and, ultimately finally, into the battery system.