Introduction

For a sustainable future, challenges such as greenhouse gas emissions, global warming, and the diminishing supply of fossil fuel require an immediate response. The electrification of transportation is viewed as a potential remedy for this issue, as it is one of the main causes of the increase in hazardous emissions. By offering an emission-free substitute and lowering reliance on petroleum imports for transportation, electric vehicles (EVs) increase energy security. Many homeowners find it difficult to install EV charging stations in their garages or parking spaces. The integration of electric vehicles has a significant effect on the functioning of the grid, and various studies, such as1,2,3,4, have analyzed the effects of EV integration on different factors, such as transformer utilization, voltage variation and power loss, on distribution feeders.

Renewable energy-based production methods, such as photovoltaics (PVs), are becoming increasingly important for generating a sustainable and economical form of electricity, as fossil fuel-based electricity generation is a major contributor to climate change. Energy storage is necessary for dependability, flexibility, and increased utilization, as the peak PV generation period and peak load usage do not coincide. EVs’ batteries may be efficiently used to store extra PV energy for use during evening peak demand periods because they spend the majority of their time parking. Vehicle-to-grid (V2G) is an acronym for this term, and many studies have been conducted on this term, encompassing all facets5.

In recent years, research has focused on the possibility of EVs exchanging energy with one another, also referred to as transactive energy systems, which have been suggested to lower the cost of charging, load levelling, and distribution network upgrades6.

Mantilla et al. in7 evaluated various clustering strategies, including clustering by price, clustering by preference, k-means, and spectral clustering, to assess their effectiveness in segmenting participants in flexible markets, which are essential for maintaining reliable grid services while providing revenue opportunities for flexible providers.

Research in8 focused on the optimization of electric vehicle (EV) charging demand through the development of transactive energy (TE) systems incorporating distributed energy resources (DERs). In3, a transactive real-time management framework for EV charging was proposed, specifically tailored for the building energy management system (BEMS) of commercial structures equipped with onsite photovoltaic (PV) generation and EV charging facilities. To increase the revenue potential of the BEMS during real-time operations, the demand for EV charging is strategically utilized to mitigate the uncertainties associated with PV output and the dynamics of EV parking behaviors.

The work in9 developed a charging model for optimizing the time of usage for EV charging, and the work was implemented on different load profiles; however, the work has considered the energy management of EVs and solar-based energy sources by considering the grid, but there is no two-sided interaction for developing charging tariffs, which is a less popular approach and a more centralized control method for charging. In10, the author proposed a charging strategy that considers battery storage and solar-based renewable energy. This work has proposed a unilateral charging strategy for EV users without considering the user input.

Innovative decentralized control techniques, such as transactive energy (TE) control, are required for managing numerous dispersed energy resources (such as EVs). Since users play a crucial role in the decision-making process, TE approaches are more attractive to EV users than are centralized control methods. EV customers are autonomous without sacrificing their privacy because of the restricted information sharing (price and energy transferred) in TE trading. “Transactive control aims to solve complex power system issues by standardizing a scalable, distributed mechanism through the exchange of data regarding generation and consumption11. presented energy management between EV users and power utility to optimize the voltage profile of the system and increase the benefits to users via the game theory-based optimization method. The work has been implemented with the objective of maximizing the benefits of the consumer with an added objective to reduce the overloading of the network components. However, the energy management model in this work does not consider the flexibility of price and user convenience. Similarly, in12,13,14, work was implemented to minimize the electricity buying cost for EVs and transaction of energy between solar-based resources and utilities. These works have several drawbacks, as they do not consider the uncertainty in solar generation, the stochastic nature of EV demand or the effect of battery degradation. Owing to the vehicle-to-grid approach, battery degradation becomes a significant aspect. In15, a 24 h-ahead transactive energy model for PV-based EV charging stations was developed. The model considers the uncertainty in the solar generation model. The hierarchical design of the scheduling method described in16 allows each EVCS to independently schedule its activities to maximize profits. To carry out the market clearing procedure, this study uses a one-sided transaction method that lacks comprehensive information. The author of17 proposed a double-sided trading mechanism among microgrids on the basis of energy valuation to decrease dependency on the utility grid; however, the bid price is unrestricted, which may result in an inefficient market equilibrium, meaning that it could be higher or lower than the utility price or feed-in tariff.

The research in18 suggested a P2P trading model based on game theory for integrated microgrids powered by renewable sources to reduce system operating costs. However, the selected bidding approach is not supported by any social or economic rationale. According to an analysis of relevant research on EV-based transactive energy trading, most of the studies do not consider either market participant preferences or demand data sharing, which raises privacy problems. Furthermore, none of the papers provide market participants with flexibility regarding bid value. To give EV aggregators a greater variety of bid prices and improve their chances of obtaining the necessary energy. Therefore, this work has implemented an energy trading mechanism from an EV aggregator and solar generation resources so that the energy demand can be satisfied with energy exchange between different components of the electric distribution system. Table 1 shows the detailed work done in the transactive energy management of electric vehicles in a smart grid.

Table 1 Literature on transactive energy, P2P trading, V2G, and EV charging in microgrids.

A comprehensive review of the recent literature highlights that several critical limitations prevent the application of the existing approaches to multi-parking lot EV charging ecosystems with distributed PV participation. Indeed, aggregator DSO coordination studies yield useful price-setting frameworks but fail to design a flexible double-sided bidding mechanism between multiple parking lots and PV owners or formulate a mixed-integer market-clearing structure that can capture parking-lot–level decisions under PV-generation uncertainty. Battery degradation is often modeled in a linearized or decomposed manner; hence, most relevant research focuses on real-time pricing without considering flexible double-sided bidding between parking lots and PV units or jointly treating PV and EV-charging uncertainties within a unified mixed-integer clearing process. For their part, peer-to-peer market designs remain predominantly tailored to household or microgrid contexts and hence are not extensible to EV parking-lot trading involving fleets of PVs or monetized degradation costs. Similarly, aggregator-based two-stage control strategies continue to rely on centralized pricing and limited uncertainty modeling. Finally, incentive-based and game-theoretic works also fall short of enabling PV–parking-lot double-sided trade while excluding battery degradation monetization in the clearing mechanism. Even sophisticated stochastic EV arrival studies do not incorporate bilateral or double-sided trading between PV producers and parking-lot aggregators or embed degradation cost terms in market clearing. Privacy- or preference-oriented energy trading frameworks lack multi-parking lot exchange via flexible double-sided bidding with mixed-integer clearing, whereas scalable transactive frameworks fail to model PV uncertainty or internalize degradation costs within discrete clearing decisions. Reviews of battery degradation modeling approaches further note the common simplification or omission of degradation in optimization, reinforcing the need for a monetized degradation term inside market clearing. Although DRO/MPC methods adequately handle uncertainty at the charging station level, they are not structured as multiagent double-sided markets connecting parking-lot aggregators with the owners of PV panels. Simulation-driven degradation studies also do not embed degradation into market objectives, whereas V2G compensation analyses do not consider flexible double-sided PV–parking-lot bidding under uncertainty. Operational RES+BESS research at EV charging stations lacks double-sided bidding, mixed-integer clearing, and degradation monetization. Network-level stochastic SOC research also does not consider transactive markets. Reinforcement learning approaches manage stochasticity but do not design market mechanisms, whereas planning-oriented papers address infrastructure layout without proposing operational double-sided markets for day-ahead trading. Policy and feasibility studies also do not deliver a flexible, operational double-sided auction with mixed-integer clearing and embedded degradation costs for coordinated interaction among parking lots and PV owners.

To address these gaps, this work introduces a novel double-sided bidding market that enables flexible bid ranges between multiple parking lots and PV owners, includes monetized battery degradation costs, and performs MI market clearing under both PV generation and EV charging uncertainties. The proposed mechanism extends the concepts of transactive energy at the operational scale of parking lots, thus enabling coordination in a distributed, scalable, and uncertainty-aware manner. The direct embedding of degradation costs within the clearing objective allows the capture of realistic EV battery wear and enhances economic fairness for participants. The combination of double-sided bidding, explicit uncertainty modeling, and MI formulation is significantly different from the current literature and establishes a holistic market architecture for future high-PV-penetration EV charging ecosystems.

This research aims to achieve the following objectives.

  1. 1.

    A flexible price-based energy exchange model is developed for energy management between EV charging stations and PV-based renewable energy sources.

  2. 2.

    In this work, a double-sided bidding-based energy transaction is proposed to minimize the cost associated with charging the EV, buying electricity from the utility and the cost associated with battery degradation due to the participation of the EV in the energy exchange via the V2G approach.

  3. 3.

    This problem has been formulated as a mixed integer-based method, and in this model, uncertainties regarding EV demand and solar generation have been considered.

Methodology

In this work, six parking lots are taken into consideration, with each lot serving as an EV aggregator. Each parking lot EMS uses power from the grid and PV system to meet its charging needs. The suggested system with parking lots is depicted in Fig. 1. On the basis of the demand and tariff, the distribution system operator will manage the bid received from various units and schedule the energy transaction on the basis of the strategy discussed. Figure 2 shows the strategy followed by the energy management operator for making decisions on the basis of the energy requirements.

Different network components are directly monitored by the EMS. The forecast PV production, EV demand, EV parking metrics, trade incentives, and cost are some of the aspects that the EMS takes into account to determine the optimal operating conditions. The EMS supervises all EVs for energy arbitrage and controls EV charging and discharging via the charging controller in the chargers. The initial state of charge (SoC), goal SoC, parking time, and charging fee are considered by the aggregator when deciding whether to charge or discharge individual EVs.

The energy management approach is followed in various stages as described.

  1. a)

    The energy management system operator uses the forecasted solar generation and EV charging demand.

  2. b)

    After this, the excess energy demand is calculated by satisfying the EV charging demand from solar and grid generation.

  3. c)

    Finally, the EMS will participate in energy transactions on the basis of the excess energy calculated by the EV aggregator and solar generation to minimize the cost. This is double-sided, as both the solar-based energy source owner and the EV aggregator participate in this transaction of energy.

Fig. 1
Fig. 1The alternative text for this image may have been generated using AI.
Full size image

Schematic of the proposed system for transactive energy management.

Fig. 2
Fig. 2The alternative text for this image may have been generated using AI.
Full size image

Transactive method for energy management in a distribution network.

Solar Output Forecasting

Solar power generation is intermittent in nature, and the output is generally dependent on climatic conditions such as weather and temperature. Different methods have been used for forecasting solar generation36. However, neural network-based methods are more capable of forecasting than are statistical methods. Therefore, in this work, a recurrent neural network-based method known as long short-term memory (LSTM)37,38 is utilized to forecast the solar irradiance and thereby calculate the solar power generated via the formula shown in Eq. 1.

$$P_{Solar}=\eta\: \times \:A \:\times \: S_{irradiance} \left( 1-\frac{T_c - 25}{200}\right)$$
(1)

Long short-term memory (LSTM) is a special type of recurrent neural network (RNN) capable of learning long-term dependencies in time series data. LSTMs are well suited for solar power forecasting because of their ability to remember past data and handle issues such as vanishing gradients, which often affect traditional RNNs. In this work, an LSTM-based model is employed to forecast solar irradiance, which is then used to estimate solar power generation. Figure 3 shows the flowchart for implementing the LSTM-based method for forecasting solar irradiance. The LSTM model is trained on historical data obtained from NREL.

The dataset is divided into training and testing sets, while 70% is sued for training data and remaining for validation and testing. The training carried out using the Adam optimizer, which provides adaptive learning rate adjustment and fast convergence.

The hyperparameters for the described LSTM method is.

Parameter

Value

Input window size

24 time steps

Number of LSTM hidden units

50

Optimizer

Adam

Learning rate

0.001

Batch size

32

Number of epochs

100

The performance of the proposed LSTM-based forecasting model is evaluated using standard statistical error metrics, including the root mean square error (RMSE) and mean absolute error (MAE). The obtained accuracy indicates that the model effectively captures the nonlinear and time-dependent behavior of solar irradiance.

The following are the step-by-step procedures for implementing an LSTM-RNN model for solar power forecasting.

The steps of the implementation of RNN-based LSTM are as follows:

  1. 1)

    Importing different libraries requires TensorFlow.

  2. 2)

    Define various LSTM models and various equations that are required for developing the LSTM layer areas.

The first LSTM model is defined by using LSTM cell equations, which consists of four main components.

  1. a.

    Forget Gate: It estimates that the retention of the previous cell is retained and is expressed as

$${F}_{t}=\sigma\left({W}_{i}*\left[{h}_{t-1},{x}_{t}\right]+{b}_{i}\right)$$
(2)

The input gate equation is expressed as \({N}_{t}=\sigma\left({W}_{i}*\left[{h}_{t-1},{x}_{t}\right]+{b}_{i}\right)\). This equation controls the addition of information to a cell, and updating the cell state is implemented by

$${C}_{t}={\text{t}\text{a}\text{n}\text{h}(W}_{i}*\left[{h}_{t-1},{x}_{t}\right]+{b}_{c})$$
(3)
  1. b.

    Now after this, the cell state is updated via

$${{C}^{{\prime}}}_{t}={f}_{t}*{C}_{t-1}+{i}_{t}*{C}_{t}$$
(4)
  1. c.

    Now, the output of the cell state is calculated via

$${C}_{t}={{\upsigma}(W}_{o}*\left[{h}_{t-1},{x}_{t}\right]+{b}_{o})$$
(5)
  1. d.

    After this, the loss is computed via the predicted output values, and the gradient is calculated via

$${g}_{t}={\nabla}_{\theta}*{L}_{t}$$
(6)

3) After this updating, the weights are adjusted via the Adam optimizer to adjust the learning rates via the following equations.

  1. a.

    First-moment updating via \({M}_{t}={\beta}_{1}{M}_{t-1}+\left(1-{\beta}_{1}\right){g}_{t}\) and second-moment estimation via \({v}_{t}={\beta}_{2}{v}_{t-1}+\left(1-{\beta}_{2}\right){g}_{t}^{2}\).

  2. b.

    After that, bias correction is applied via.

$${{{M}^{{\prime}}}_{t}=\frac{{M}_{t}}{1-{\beta}_{1}^{t}}and{v}^{{\prime}}}_{t}=\frac{{v}_{t}}{1-{\beta}_{2}^{t}}$$
(7)

Incorporating the Adam optimizer in the training methodology leads to.

4) Update the LSTM parameters via

$${\theta}_{t+1}={\theta}_{t}-\frac{\eta}{\sqrt{{{v}^{{\prime}}}_{t}+\epsilon}}{{M}^{{\prime}}}_{t}$$
(8)

5) Evaluate the model via the RMSE via

$$RMSE=\sqrt{\frac{{\sum}_{i=1}^{N}\left({y}_{i}-{y}_{i+1}\right)}{N}}$$
(9)

Figure 4 shows the forecasted solar irradiance in this research work.

Fig. 3
Fig. 3The alternative text for this image may have been generated using AI.
Full size image

Schematic of the forecasting technique applied for solar irradiance forecasting.

Fig. 4
Fig. 4The alternative text for this image may have been generated using AI.
Full size image

Solar irradiance estimated via the proposed method.

Electric vehicle charging demand

The EV charging demand is very uncertain, and in this work, six parking lots are considered. In EV load modeling, the charging requirement of the EV at the completion of the journey is estimated by the travel distance, number of trips, and trip range. The EV driving range is probabilistic since each user in a practical situation drives a different distance; hence, the travel patterns followed by EV users are probabilistic in nature and are expressed as follows:

$$f\left({\mu}^{t},{\alpha}^{t}\right)=\frac{1}{{\alpha}^{t}{\left(2\text{*}\pi\right)}^{1/2}}\text{*}{e}^{-\frac{{\left(t-{\mu}^{t}\right)}^{2}}{\left.2\text{*}{\left(\alpha\right.}^{t}\right)}}\forall0<{\mu}^{t}<{\infty}$$
(10)

The energy requirement at the end of the trip for charging an EV [10] is calculated by Eq. 11

$${\text{E}}_{demand}^{j}=\left\{\frac{{\mathcal{S}}_{j}^{req}*{\mathcal{B}}^{battery}}{{\eta}^{ch}}\right\}$$
(11)

Figure 5 shows the flowchart used to calculate the electric vehicle charging demand. Table 2 shows the different probability functions for different parameters.

Fig. 5
Fig. 5The alternative text for this image may have been generated using AI.
Full size image

Flow chart for estimating the electric vehicle load.

Table 2 Probability distribution functions of different parameters.

Problem formulation

The problem formulation proposed in this manuscript has been implemented based on scenario-based approach using a mixed integrer linear programming optimization model to coordinate electric vehicle charging, solar photovoltaic utilization and perform a transactive energy exchange among various EV parking lots. The main objective of optimization is to minimize the operating cost of EV while satisfying technical and market clearing constraints. The proposed optimization problem can be expressed as mixed integer linear programming.

Uncertainty in solar PV generation and EV charging demand is incorporated through a scenario-based stochastic framework, where multiple scenarios are generated around forecasted values and each scenario is associated with a probability of occurrence. The optimization minimizes the expected operating cost across all scenarios, thereby improving the robustness of the proposed energy management strategy against forecasting errors.

The MILP model as expressed as

$$min={c}^{T}X+{d}^{T}y$$
(12)

which is subjected to

$$Ax+By\le b$$
(13)
$$x\ge0,y\in\left\{\text{0,1}\right\}$$
(14)

Where \(x\) denotes the vector of continuous variable and \(y\) represents the binary decision variables associated with energy exchange model. The vector \(c\&d\)define the cost coefficient while matrices \(A,B,vectorb\) represent system constraints.

  1. i).

    Objective Function.

Owing to the significant cost associated with the adoption of electric vehicles, the main aim of this work is to optimize the cost in this problem formulation. The cost function consists of several factors, such as the cost of buying electricity from the grid, the battery degradation cost of the battery, as the vehicle is used in V2G mode, and the lowest cost of energy for solar generation, which has been added to increase the practicality of the problem. Therefore, these factors are also taken into consideration in the formulation of the objective function shown in Eq. 15.

$$Min({O.F)}_{cost}^{total}=\sum_{m=1}^{{P}_{L}}\sum_{t=1}^{T}\sum_{i=1}^{{N}_{ev}}\left[{P}_{i,t,m}.{R}_{t}^{elec}+({P}_{i,t,m}^{v2g}.{B}_{cost}^{deg})+\left\{\left({P}_{i,t,m}^{pv2ev}+{P}_{i,t,m}^{pv2g}\right).{C}_{lcoe}\right\}-\{\left({P}_{i,t,m}^{v2g}+{P}_{i,t,m}^{pv2g}\right).{R}_{FIT}^{t}\right]$$
(15)

In this equation, the first term refers to the expression of the cost of electricity bought from the grid, and battery degradation is represented by the second term. The third term represents the marginal cost of solar power generation, which is essentially the lowest cost of energy for solar generation. The last term represents the energy power that is bought by the utility. The parking lot, which has been considered, also consumes energy, and its energy exchange is shown by Eq. (16).

$${P}_{total}^{solar}=\sum_{m=1}^{{P}_{L}}\sum_{t=1}^{T}\sum_{i=1}^{{N}_{ev}}\left[\left\{\left({P}_{i,t,m}^{pv2ev}+{P}_{i,t,m}^{pv2g}\right)\right\}\right]$$
(16)

This expression has two parts: one denotes the solar power sold to utility, and the other term denotes the power used for charging vehicles.

  1. i).

    Constraints of the problem formulation:

a) Charging Constraints: The charging and discharging of vehicles are constrained by power limits. Therefore, each EV is constrained to the following power limits.

$${P}_{i,t,m}+{P}_{i,t,m}^{pv2v}\le{P}_{max}$$
(17)
$$\beta*\left({P}_{g2v}+{P}_{pv2v}\right)+\left(1-\beta\right){P}_{v2g}$$
(18)

b) Limit on the state of charge of the battery.

$${SoC}_{min}^{i}\le{SoC}_{t}^{i}\le{SoC}_{max}^{i}$$
(19)

This constraint on the battery limits the battery from deep discharge and increases the life of the battery.

c) Constraint on the usage of solar power:

$$\frac{\sum_{i=1}^{N}{P}_{i,t,m}^{pv2ev}}{\eta}+\frac{{P}_{i,t,m}^{pv2g}}{{\eta}_{dc-dc}}\le{P}_{pv}\le{P}_{max,pv}$$
(20)

This allows the curtailment of excess solar power usage beyond the rated capacity.

Energy Exchange Model

In this work, the energy management operator has information on solar energy generation and the charging demand of vehicles. Therefore, on the basis of the requirements, the operator will estimate the excess energy or required energy that is available for transactions in the network. This value is then available for all the electric parking lots. Hence, on the basis of this evaluation of energy, the buyer can make the decision of energy buying/selling after calculating the energy requirements of the respective parking lots. The energy management operator, on the basis of this information, allows the buyer and sellers to submit their price on the basis of their respective evaluation. The energy that is required and excess energy available by parking lots at time t is represented by Eqs. (21) and (22).

$${E}_{t,m}^{req}=\sum_{i=1}^{N}{P}_{i,t,m}*\varDelta tm\in{m}_{sell}$$
(21)
$${E}_{t,m}^{excess}=\sum_{i=1}^{N}\left({P}_{i,t,m}^{v2g}+{P}_{i,t,m}^{pv2g}\right)*\varDelta tm\in{m}_{buy}$$
(22)

The excess energy that is available per parking lot is represented by Eq. 23:

$${{E}_{t,m}^{avg}=\frac{E}{m}}_{buy}^{excee,avg}$$
(23)

The energy that each parking lot is buying by submitting the bid is calculated by considering the required and excess energy available at each lot, which is described in Eq. 24.

$${E}_{t,m}^{val}={E}_{t,m}^{req}-{E}_{t,m}^{excess}$$
(24)

Therefore, using this energy valuation, each parking lot will submit its buying electricity price to an energy management operator. The energy selling and buying of electricity is constrained by the feed-in tariff rate or utility price. The feed-in tariff is represented by \({R}_{FIT}^{t}\), and the utility price is represented by \({R}_{t}^{elec}\).

This constraint on the tariff benefits energy exchange between parking lots instead of buying from the grid. This will also lead to a lower cost of charging of electric vehicles, which will subsequently have an impact on the user adoption of vehicles. The price of electricity at which the buyer will submit its bid is calculated via Eq. (25):

$${Cp}_{t,m}=\frac{{R}_{t}^{elec}-{R}_{FIT}^{t}}{2}*{E}_{t,m}^{val}$$
(25)

Market clearing model

In this proposed work a transactive energy management system EV parking lots acts as market participation that can submit bids either to buy or sell energy depending on their local energy surplus or deficit. The interaction among parking lots is modeled using a price-based double-sided bidding mechanism, where both buyers and sellers actively participate in the energy transaction process. The EMS collects all buying and selling bids from participating parking lots and it clears market at each time interval based on bid prices and available energy quantities. This double is implemented a double-sided auction where the bids for buying are sorted in descending order of bid prices and selling bids are sorted in ascending manner. The interaction between the parking lots is modelled as that where both buyers and sellers actively participate in the energy transition process. The EMS collects all buying and selling bids from participating in parking lots and clears the market at each time interval based on bid prices and available energy quantities. The market-clearing price is implicitly determined within the bounds of the bid prices and remains lower than the grid electricity price and higher than the feed-in tariff. This ensures that both buyers and sellers achieve economic benefits compared to trading directly with the utility grid. The network constraints are embedded in the optimization framework which includes EV charging, state of charge constraints and solar generation capacity. The EMS supervises all transactions and schedules energy flows such that no technical limits of EV batteries or charging infrastructure are violated. By integrating the bidding mechanism within the mixed-integer optimization framework, the proposed approach ensures that market-clearing decisions are both efficient and technically feasible.

The buyer will bid for energy at the price defined by Eq. 25. The energy demand is calculated via Eq. 24 where a parking lot is interested in buying from a transaction of energy.

The energy management operator will allocate the energy per the bid price of buying electricity from the parking lot received. The operator will arrange these bids accordingly. A lot that has made a higher bid will be given priority. For example, if buyer 1 is higher than the market clearing price than buyer 2 is, then they can purchase the required amount of energy satisfying their energy requirements, and subsequently, other parking lots will purchase energy on the basis of their bid price. The higher the bid price is, the greater the likelihood of obtaining the required amount of energy. The bid price that is outside the bounds of \(\left({{R}_{t}^{elec},Cp}_{t,m}\right)\) is excluded from the bid evaluation.

The proposed energy exchange model is shown in Eq. 26. which describes energy exchange or buyer lots while selling parking lots, the energy exchange is shown in Eq. 27.

$$\begin{aligned}Min({O.F)}_{cost}^{total}&=\sum_{m=1}^{{P}_{L}}\sum_{t=1}^{T}\sum_{i=1}^{{N}_{ev}}\big[({P}_{i,t,m}-\frac{{E}_{buy,t,m}}{\varDelta t})*{R}_{t}^{elec}+\left({P}_{i,t,m}^{v2g}*{B}_{cost}^{deg}\right)+\left\{\left({P}_{i,t,m}^{pv2ev}+{P}_{i,t,m}^{pv2g}\right)*{C}_{lcoe}\right\}\\&- \{\left({P}_{i,t,m}^{v2g}+{P}_{i,t,m}^{pv2g}\right)*{R}_{FIT}^{t}+\sum_{m=1}^{PL}\sum_{t=1}^{T}\left(\frac{{E}_{buy,t,m}}{\varDelta t}*{Cp}_{t,m}\right)\big]\end{aligned}$$
(26)
$$\begin{aligned}Min({O.F)}_{cost}^{total}&=\sum_{m=1}^{{P}_{L}}\sum_{t=1}^{T}\sum_{i=1}^{{N}_{ev}}\big[\left({P}_{i,t,m}\right)*{R}_{t}^{elec}+\left({P}_{i,t,m}^{v2g}*{B}_{cost}^{deg}\right)+\left\{\left({P}_{i,t,m}^{pv2ev}+{P}_{i,t,m}^{pv2g}\right)*{C}_{lcoe}\right\}\\& -\{\left({P}_{i,t,m}^{v2g}-\frac{{E}_{sell,t,m}}{\varDelta t}+{P}_{i,t,m}^{pv2g}\right)*{R}_{FIT}^{t}+\sum_{m=1}^{PL}\sum_{t=1}^{T}\left(\frac{{E}_{sell,t,m}}{\varDelta t}*{Cp}_{t,m}\right)\big]\end{aligned}$$
(27)

The proposed problem formulation involves different binary variables, some of which are continuous in nature. Therefore, owing to the nonlinearity of the problem, a new variable m is introduced to linearize the problem.

$$m=s*y$$
(28)
$$m\le y$$
(29)
$$m\ge y-\left(1-s\right)*t$$
(30)
$$m\le s*t$$
(31)

where s & y represent binary and continuous variables, respectively, and t represents a large quantity.

The indices used are describes as

\({P}_{dis}^{\text{m}\text{a}\text{x}}\): Maximum charging and discharging power of EVs (kW).

\(SO{C}^{\text{m}\text{i}\text{n}}\), \(SO{C}^{\text{m}\text{a}\text{x}}\): Minimum and maximum allowable state of charge of EV batteries.

\({\lambda}_{t}^{grid}\): Electricity price from the utility grid at time \(t\)($/kWh).

\({\lambda}_{t}^{fit}\): Feed-in tariff at time \(t\)($/kWh).

\({C}^{deg}\): Battery degradation cost per unit of discharged energy ($/kWh).

\({C}^{pv}\): Marginal cost of solar PV generation ($/kWh).

\({P}_{m,t,s}^{pv}\): Available solar PV power at parking lot \(m\)under scenario \(s\)(kW).

\({D}_{m,t,s}^{ev}\): Aggregated EV charging demand at parking lot \(m\)under scenario \(s\)(kW).

\({\pi}_{s}\): Probability of occurrence of scenario\(s\).

Uncertainty modeling in the problem formulation

The EV charging demand is assumed to follow a Gaussian probability distribution due to the aggregation effect of multiple charging events, while solar generation uncertainty is represented using a truncated Gaussian distribution to account for physical generation limits.

The probability density function (PDF) of EV charging demand is expressed as

$$\begin{array}{cccc}&{f}_{\text{ch}}\left({P}_{\text{ch}}\right)=\frac{1}{\sqrt{2\pi{\sigma}_{\text{solar}}^{2}}}\text{e}\text{x}\text{p}\left\{-\frac{\left({P}_{\rm solar}-{\mu}_{\text{solar}}{)}^{2}\right.}{2{\sigma}_{\text{solar}}^{2}}\right\}&&\end{array}$$
(32)

where \({\mu}_{\text{ch}}\)and \({\sigma}_{\text{ch}}\)denote the mean and standard deviation estimated from historical EV charging data.

Similarly, the probability density function of solar power generation is modeled using a truncated Gaussian distribution as

$$\begin{array}{cccc}&{f}_{\text{solar}}\left({P}_{\text{solar}}\right)=\frac{\frac{1}{\sqrt{2\pi{\sigma}_{\text{solar}}^{2}}}\text{e}\text{x}\text{p}\left\{-\frac{\left({P}_{\rm solar}-{\mu}_{\rm solar})^{2}\right.}{2{\sigma}_{\rm solar}^{2}}\right\}}{{\Phi}\left(\frac{{P}_{\rm max}-{\mu}_{\text{solar}}}{{\sigma}_{\text{solar}}}\right)-{\Phi}\left(\frac{0-{\mu}_{\text{solar}}}{{\sigma}_{\text{solar}}}\right)}&&\end{array}$$
(33)

These probability function has been discretised into finite number of representative scenarios. Uncertainty is present in the forecasting of solar generation and in the charging demand of electric vehicles. In this work, different uncertainties are modeled by representing them via probability functions. The discrete probability function for solar generation and EV charging demand is shown in Eqs. 34 & 35

$${U}_{solar}=\left({P}_{solar}^{1}{\sigma}_{solar}^{1}\right),\left({P}_{solar}^{2}{\sigma}_{solar}^{2}\right)\dots\dots\dots\dots\dots\dots\left({P}_{solar}^{z}{\sigma}_{solar}^{z}\right)$$
(34)
$${U}_{ch}=\left({P}_{ch}^{1}{\sigma}_{ch}^{1}\right),\left({P}_{ch}^{2}{\sigma}_{ch}^{2}\right)\dots\dots\dots\dots\dots\dots\dots\dots.\left({P}_{solar}^{z}{\sigma}_{solar}^{z}\right)$$
(35)
Fig. 6
Fig. 6The alternative text for this image may have been generated using AI.
Full size image

Six parking lots with solar-based distributed energy sources in the IEE-33 network.

The probability associated with every scenarios z is obtained by summing corresponding probability function over the scenario interval

$$\begin{array}{cccc}&{\sigma}^{z}={\int}_{{P}_{z}^{\text{m}\text{i}\text{n}}}^{{P}_{z}^{\text{m}\text{a}\text{x}}}f\left(P\right)dP&&\end{array}$$
(36)

In this Eq, each pair consists of an expected value and a probability-based value, which is represented by \(\sigma\), where z represents the number of scenarios and the sum of all these probability distributions is unity.

$$\begin{array}{cccc}&\sum_{z}{\sigma}^{z}=1.&&\end{array}$$
(37)

These discrete scenarios and their corresponding probabilities are integrated into the MILP formulation using an expected-value approach to explicitly account for uncertainty in solar generation and EV charging demand.

The effects of uncertainty are analyzed by generating five representative scenarios using ± 10% deviations around the forecasted values of both solar generation and EV charging demand. These scenarios capture low, nominal, and high realizations of uncertainty and are incorporated into the optimization model to evaluate the robustness of the proposed energy management strategy.

Results and discussion

The proposed model is implemented in MATLAB via mixed integer-based programming on an IEEE radial network, as shown in Fig. 6. The effectiveness and main contribution of the proposed work has analyses in two cases where the EV charging is demand satisfied from grid electricity and solar generation but in the proposed case the surplus energy which from solar which was is exchanged among EV parking lots through the proposed double-sided bidding mechanism instead of being sold to the grid, however, the surplus solar energy is exchanged among EV parking lots through the proposed double-sided bidding mechanism instead of being sold back to the grid, which leads to better economic performance.

As a result, parking lots with surplus solar generation power are incentivized to sell energy locally rather than exporting it to the grid at a lower feed-in tariff, while the parking lots which require energy procure it at a reduced cost compared to grid purchase. This interaction leads to a more efficient allocation of available energy, which leads to improved solar utilization, and reduced reliance on grid electricity. The effects of this proposed framework is reflected in the lower system costs across all parking lots, as shown in Fig. 7 and summarized in Table 3.

In contrast, the base case does not allow double-sided bidding or local energy trading; therefore, surplus energy is either curtailed or sold to the grid, and deficit energy is fully met through grid purchases.

The battery degradation cost per kWh is 0.038$, and the lowest cost of solar energy is 0.07$/kWh. The feed-in tariff value is 0.047$/kWh, and the variable feed-in tariff is 79% of the grid price. Table 3 summarizes the comparative results obtained for the base case and the proposed case under both constant and dynamic tariff structures.

Table 3 Results of the Simulation.

The base case results for the constant tariff are 77.88 $, but for the proposed case, it is 76.42 $. For the flexible and dynamic tariffs, the base case results in 74.30, whereas the proposed case results in 67.26. The cost reduction for the base case is 4.48%, whereas for the proposed case, it is 11.8%. This shows that the proposed case results in a lower charging cost. Furthermore, the results indicate that the cost reduction achieved by the proposed strategy is more pronounced under dynamic tariff conditions, highlighting the additional economic benefits of combining local energy trading with time-varying electricity prices. The work done in39 model multi-source uncertainty in PV–BESS–EV systems, while40 incorporate EV demand uncertainty and battery degradation in smart charging frameworks. Compared to these works, the proposed approach jointly considers PV and EV uncertainties along with the tariff variations and degradation costs within a unified stochastic MILP formulation, leading to improved expected operational performance. This shows that proposed framework not only considers the uncertainty in the EV and solar but also analyses the effect on different tariff structure. The results have shown its wider applicability and can also be implemented in real like scenarios.

Figure 7 shows the variation in system cost, which is defined as the objective and for the base case for the first to sixth parking lots. In all six parking lots, the proposed case consistently results in a lower system cost compared to the base case. This reduction is primarily due to the local exchange of surplus solar energy among parking lots through the proposed double-sided bidding mechanism, which reduces dependency on higher-priced grid electricity. In contrast, in the base case, surplus energy is either reduced or sold back to the grid at a lower feed-in tariff, leading to higher overall charging costs.

The results show that the system cost is lower in the proposed case because of the trading of excess energy within the parking lot instead of the base case where the energy required for charging is bought from the grid. The proposed case reduces the energy cost by 11.8% as excess energy is traded between parking lots, which leads to a lower cost of charging vehicles and leads to better utilization of solar generation. However, the marginal price of solar power generation decreases over time, and this proposed methodology allows better usage of solar generation, which results in a lower operating cost of the system. Table 4 shows the energy requirements for each parking lot and an energy evaluation based on the priority factor of each charging station. The priority factor assigned to each parking lot reflects the relative importance of charging demand, which is considered during energy allocation. Afterwards, to determine the effect of the uncertainty of solar generation on the cost of the system, a scenario- based analysis is conducted as described Sect.  2.6, and the impact on.

Fig. 7
Fig. 7The alternative text for this image may have been generated using AI.
Full size image

Variations in the system cost for the proposed and base cases for the first to sixth parking lots.

Fig. 8
Fig. 8The alternative text for this image may have been generated using AI.
Full size image

Variation in system cost due to uncertainty in solar generation and EV charging demand.

the problem formulation is calculated for each scenario. The results are shown in Fig. 8 &the system cost is calculated by varying the \(\pm10\%\) change in value of the parameters. The results demonstrate that, under all uncertainty scenarios, the proposed model consistently achieves lower system costs compared to the base case, indicating improved robustness against forecasting errors. This confirms that the proposed double-sided bidding-based energy management strategy effectively mitigates the adverse effects of uncertainty in both solar generation and EV charging demand.

Table 4 Energy requirements for each parking lot.

Effect of the variation in the cost of battery degradation on the system cost

Battery degradation plays a vital role in charging cost estimation. As the energy is exchanged via the vehicle-to-grid methodology, the battery cycle counts faster, which leads to the degradation of the health of the battery, which will eventually lead to a higher charging cost. Generally, related works in the field do not consider this aspect of batteries, but for practical model simulations, these negative effects cannot be ignored. Therefore, the cost of battery degradation has been varied to determine the effect on the cost and how the proposed model performs. Figure 9 shows the variation in the system for different costs of degradation.

The battery degradation cost is modelled as linear function of the battery charging and discharging energy and is incorporated directly into the objective function.

The degradation cost is expressed as

$${C}_{\text{deg}}={c}_{\text{deg}}\sum_{t}\left({P}_{\text{ch}}\left(t\right)+{P}_{\text{dis}}\left(t\right)\right){\Delta}t$$
(38)

where \({P}_{\text{ch}}\left(t\right)\)and \({P}_{\text{dis}}\left(t\right)\)represent the charging and discharging power of the battery at time \(t\), respectively, \({\Delta}t\)is the time step, and \({c}_{\text{deg}}\)denotes the degradation cost coefficient.

The degradation cost coefficient is calculated as

$${c}_{\text{deg}}=\frac{{C}_{\text{bat}}}{{E}_{\text{bat}}\times{N}_{\text{cycle}}}$$
(39)

where \({C}_{\text{bat}}\)is the battery replacement cost, \({E}_{\text{bat}}\)is the rated battery energy capacity, and \({N}_{\text{cycle}}\)is the expected cycle life of the battery. This formulation enables the degradation cost to be expressed in monetary units per unit of energy and integrated in the MILP based framework.

The results of the case shown in Table 2 are taken as the base case. The variation in the cost of battery degradation is taken from the base, as shown in Table 5. The results show that when the degradation cost of the.

Fig. 9
Fig. 9The alternative text for this image may have been generated using AI.
Full size image

Comparison of the system cost for different values of degradation cost.

battery increases; it leads to a higher system cost but is much better than that of the base case. This shows that the proposed case gives much better results when the degradation cost is considered, but as is obvious, the cost increases as the cost of degradation increases in the model.

Table 5 Variation in system cost for different values of degradation cost.

Conclusion & future work

This research has implemented a transactive energy management approach for EV charging stations integrated into a distribution network. The proposed framework enables local energy exchange among EV parking lots through an auction-based trading methodology and is compared with a base where energy exchange between the parking lots was not considered. The results have shown that the proposed transactive energy management has achieved lower system cost than a grid-based energy exchange approach. The effect of battery degradation cost also has been analyzed and impact of the uncertainty in solar generation and EV charging demand on the system cost has been investigated. The results also shows the robustness of the proposed framework as the variation of EV charging demand & solar based generation has been included and tested on the proposed problem formulation. These comparisons and sensitivity analyses provide deeper insights into the behavior of the proposed model under different conditions and demonstrate its adaptability and effectiveness across a wide range of realistic scenarios.