Planning and Optimizing Charging Infrastructure and Scheduling in Smart Grids with PyPSA-LOPF: A Case Study at Cadi Ayyad University
Round 1
Reviewer 1 Report
Comments and Suggestions for Authors- Highlight the novelty of the findings relative to existing studies. Discuss the broader implications of the findings.
- All tables and figures must be interpreted and explained in the text.
- All equations and the variables must be explained in the text.
- Be consistent in using the decimal point. Ex. '5,2 hours' in Table 5 but '5.2 hours' in the text.
- Noor Solar Project is not an abbreviation
- Improve the academic discussion of the paper by citing the most recent and relevant academic (peer-reviewed) literature. Reduce gray literature.
- Improve the quality of all figures, making sure that all fonts are readable (ex. Fig. 7, Fig. 2) and information is clear (colors in Fig. 8 are indistinguishable)
- What are the main limitations of the study in terms of the scope, model, method, data, analysis, case study, etc.? How can these be addressed in future research?
- Please rewrite the whole paper and follow the journal template.
- Please check the spacing between sentences.
- Do not cut words in the tables.
- Check the capitalizations. Ex. 'Where' in equations
- Improve the referencing. You may cite the author instead of 'reference'. Ex. Reference [16] should be 'Zhang et al. [16]; 'The paper [22]' should be 'Brown, Hörsch, & Schlachtberger [22]'
- Are there any 'patents'? see section 6. Patents
- L205: 'Cadi Ayyad University (FST)' should be 'Cadi Ayyad University FST' since FST was already defined.
Author Response
We greatly appreciate your thorough feedback, which has helped improve the manuscript. Below are our responses to your comments, along with the revisions made.
Comments 1:Highlight the novelty of the findings relative to existing studies. Discuss the broader implications of the findings.
Response 1: We thank the reviewer for highlighting this important point. To clarify the novelty and broader implications of the study, we have revised the review sections to better emphasize how our findings differ from existing research and the potential impact of our work on future energy management strategies in EV charging infrastructure.
Revised text: See pages 5-6, lines 182-210
"To underscore the originality and significance of our proposed model, we conduct a comparative analysis with recent representative studies referenced in this review: Zhang et al. [16], Kassab et al. [26], and Wu et al. [29]. These studies focus on the planning and optimization of EV charging infrastructure in the context of enhanced renewable energy integration. However, each study presents certain limitations, including constraints related to the scope of data utilized, the integration of grid and storage considerations, or the comprehensive modeling of EV charging behavior."
And
“As illustrated in Table 2, Zhang et al. [16] employ a stochastic optimization approach to account for uncertainties in renewable energy availability, but their reliance on synthetic data and limited modeling of charging infrastructure reduce the applicability of their findings to real-world deployment. Kassab et al. [26] emphasize multi-objective optimization for energy systems, yet their infrastructure modeling lacks technical depth and omits actual EV charging behavior. Wu et al. [29] focus on optimizing PV capacity for EV charging on a university campus, but their work stops short of modeling charger-level scheduling or integrating time-dependent grid constraints. Moreover, they do not utilize open-source grid optimization frameworks, limiting the replicability of their approach. In contrast, our study introduces a comprehensive, open-source framework using PyPSA-LOPF, which uniquely enables us to follow the PV generation profile, enhancing PV self-consumption and minimizing grid dependency. By leveraging real-world PV production and EV charging data from Cadi Ayyad University, we model dynamic charging behaviors at the charger level, incorporate grid availability and analyze multiple optimization scenarios”
Comments 2: All tables and figures must be interpreted and explained in the text.
Response 2: We appreciate the reviewer’s comment. We have thoroughly revised the manuscript to ensure that all tables and figures are properly explained in the text. Each figure and table is now referenced and discussed in detail to provide context for the findings.
Comments 3: All equations and the variables must be explained in the text.
Response 3: We have revised the manuscript to ensure that all equations are fully explained in the text.
Comments 4: Be consistent in using the decimal point. Ex. '5,2 hours' in Table 5 but '5.2 hours' in the text.
Response 4: Thank you for pointing this out. We have carefully reviewed the manuscript and ensured consistent usage of the decimal point throughout, following the correct formatting conventions.
For example, in the text: "The charging time for SC3 was reduced by 0,9 hours compared to SC4, which shows a clear improvement in system performance."
We have now ensured that all instances of decimal points are consistent.
Comments 5: Noor Solar Project is not an abbreviation.
Response 5: We have corrected this as requested.
Comments 6: Improve the academic discussion of the paper by citing the most recent and relevant academic (peer-reviewed) literature. Reduce gray literature.
Response 6: We appreciate the suggestion and have updated the manuscript to include more recent, peer-reviewed academic references. We have replaced some gray literature with the most relevant and current academic sources.
Comments 7: Improve the quality of all figures, making sure that all fonts are readable (ex. Fig. 7, Fig. 2) and information is clear (colors in Fig. 8 are indistinguishable) – done.
Response 7: Thank you for your detailed comments on the figures. We have revised the figures to ensure that all fonts are readable and the colors are distinguishable. We have also improved the clarity of the visual information in figures, including making the legend text and axis labels clearer.
Comments 8: What are the main limitations of the study in terms of the scope, model, method, data, analysis, case study, etc.? How can these be addressed in future research?
Response 8: In the conclusion section, we have now addressed the limitations of the study in greater detail, including the model, data, and case study constraints. We also propose how these limitations can be addressed in future work.
Revised conclusion text: "However, several limitations remain. The model simplifies certain aspects, such as EV arrival/departure variability, battery degradation, and seasonal PV intermittency. Additionally, the LOPF approach does not fully capture nonlinear grid constraints like voltage stability and thermal limits, which are relevant for high-density charging.
To enhance model realism and applicability, future research will integrate stochastic behavior modeling, nonlinear power flow formulations, and infrastructure-specific constraints. Additionally, sensitivity analysis and a wider set of real-world datasets would allow for a more robust validation of the model. Despite these limitations, this work establishes a solid foundation for planning and optimizing EV charging systems that support urban energy transition goals and can be adapted to various grid configurations and user patterns."
Comments 9: Please rewrite the whole paper and follow the journal template.
Response 9: We have carefully reviewed and rewritten sections of the paper to follow the journal template more closely. The formatting and structure now align with the guidelines provided by the journal.
Point 1: Please check the spacing between sentences.
Response 1: We have reviewed the manuscript for proper spacing between sentences.
Point 2: Do not cut words in the tables.
Response 2: We have adjusted the tables to ensure that words are not cut off, and all text is clearly legible.
Point 3: Check the capitalizations. Ex. 'Where' in equations.
Response 3: We have checked the manuscript for consistency in capitalization and corrected any instances where capitalization was inconsistent, particularly in equations.
Point 4: Improve the referencing. You may cite the author instead of 'reference'. Ex. Reference [16] should be 'Zhang et al. [16]; 'The paper [22]' should be 'Brown, Hörsch, & Schlachtberger [22].'
Response 4: We have updated the citations to correctly reference the authors instead of using generic terms like "reference". For example: "Zhang et al. [16] demonstrated that ...", "Brown, Hörsch, & Schlachtberger [22] also found that ..."
Point 5: Are there any 'patents'? see section 6. Patents.
Response 5: We have reviewed Section 6.
Point 6: 'Cadi Ayyad University (FST)' should be 'Cadi Ayyad University FST' since FST was already defined.
Response 6: We have corrected this as requested, ensuring that the abbreviation FST is only used after it has been defined.
Reviewer 2 Report
Comments and Suggestions for AuthorsPlease find my comments below. I believe addressing these questions will add value to the manuscript
- How representative is the PV production data from March 26, 2020, for year-round optimization?
- How does the assumed 10% EV adoption rate affect the scalability and effectiveness of the infrastructure design?
- To what extent does the model account for the variability in individual EV charging demands and usage patterns?
- How sensitive are the optimal charging schedules and infrastructure configurations to changes in electricity tariffs?
- Does the model consider the impact of simultaneous charging on the local grid infrastructure at Cadi Ayyad University?
- What are the limitations of using Linear Optimal Power Flow (LOPF) for a potentially non-linear real-world charging system?
Author Response
Thank you very much for your time and constructive feedback on this manuscript. We appreciate the opportunity to clarify and improve the paper in response to your comments
Comment 1: How representative is the PV production data from March 26, 2020, for year-round optimization?
Response 1: Thank you for this important observation. The PV data from March 26, 2020, was deliberately selected because it corresponds to one of the highest PV production days recorded during regular academic hours (9:00 AM to 6:00 PM) within the university calendar (September–June). While it does not reflect average seasonal conditions, it offers an optimal case for evaluating system performance under favorable solar conditions. This approach helps validate the upper limits of system efficiency during peak sunlight hours. As noted in the revised manuscript, future research will incorporate seasonal and weather-related variations to represent Morocco's diverse climate more comprehensively.
Revised text: See page 11, paragraph 1, lines 388-391.
"Among various generation profiles, March 26, 2020, was selected as it corresponds to one of the highest PV output days during regular academic hours. While not representative of year-round data, it serves as a high-performance validation scenario. Future work will address seasonal variability."
Comment 2: How does the assumed 10% EV adoption rate affect the scalability and effectiveness of the infrastructure design?
Response 2: Thank you for raising this point. The 10% EV adoption rate used in the model reflects the current level of EV penetration on campus. Specifically, the proposed infrastructure targets a parking area with 20 spaces intended for 20 faculty members, representing 10% of the total 198 staff. This figure establishes a realistic and practical baseline for a pilot implementation given current parking constraints and EV ownership rates. The system is designed to be scalable and can be adapted for future scenarios with higher adoption rates, as discussed in the revised manuscript.
Revised text: See page 11, paragraph 1, lines 383–387.
"The proposed infrastructure is designed for a parking area accommodating 20 spaces, intended for approximately 20 faculty members, which represents an initial adoption rate of 10% out of a total of 198 staff members. This figure reflects the current penetration of EVs on campus and the constraints of available parking, establishing a practical baseline for a pilot phase."
Comment 3: To what extent does the model account for the variability in individual EV charging demands and usage patterns?
Response 3: The current model assumes an average EV charging demand based on typical usage patterns observed in urban academic environments. However, we acknowledge the limitation of not modeling individual variability. We have added this as a limitation and proposed probabilistic or agent-based approaches as future work.
Revised text: See page 21, paragraph 3, lines 672–673.
"The model simplifies certain aspects, such as EV arrival/departure variability, battery degradation, and seasonal PV intermittency."
Comment 4: How sensitive are the optimal charging schedules and infrastructure configurations to changes in electricity tariffs?
Response 4:Thank you for this insightful comment. The proposed algorithm is specifically designed to maximize the use of PV energy, which directly contributes to minimizing overall energy costs. Given the significant difference between the electricity tariffs—1.172 MAD/kWh for grid electricity and 0 MAD/kWh for solar energy—the algorithm prioritizes PV energy whenever available.
Revised text: See page 16, paragraph 3, lines 533–543.
"Figure 5 further analyzes the operational cost profile, which is calculated based on the electricity tariff structure (1.172 MAD/kWh for grid electricity and 0 MAD/kWh for solar energy)."
Comment 5: Does the model consider the impact of simultaneous charging on the local grid infrastructure at Cadi Ayyad University?
Response 5: Thank you for raising this important concern. The current model primarily focuses on optimizing the use of PV energy and reducing grid dependency by aligning charging schedules with solar production. However, it does not fully account for the impact of simultaneous charging on the local grid infrastructure at Cadi Ayyad University, particularly in terms of voltage stability and thermal limits.
Comment 6: What are the limitations of using Linear Optimal Power Flow (LOPF) for a potentially non-linear real-world charging system?
Response 6: We fully agree with this observation. LOPF simplifies network modeling by assuming linear relationships, which may not capture some nonlinear behaviors in power systems. This trade-off was made to maintain computational efficiency. We have acknowledged this in the conclusion and suggested using non-linear or mixed-integer programming models in future studies.
Revised text: See page 21, paragraph 3, lines 675–676.
"Additionally, the LOPF approach does not fully capture nonlinear grid constraints like voltage stability and thermal limits, which are relevant for high-density charging."
Reviewer 3 Report
Comments and Suggestions for AuthorsThe manuscript presents an optimization framework for EV charging infrastructure at Cadi Ayyad University (FST Marrakech) using PyPSA-LOPF, with a focus on minimizing costs, maximizing solar energy utilization, and reducing grid dependency. While the topic is timely and relevant, several critical issues must be addressed to enhance the clarity, and novelty of the work.
- The integration of PyPSA-LOPF for EV charging infrastructure optimization is not novel, as similar tools (e.g., MILP, stochastic optimization) have been extensively applied in prior studies (e.g., [16], [27], [29]). The manuscript lacks a clear articulation of its unique contribution compared to existing literature. For instance, how does this work differ from [29], which also focuses on university campuses and solar-PV integration?
- The case study at Cadi Ayyad University is a strength, but the authors should better highlight regional-specific challenges (e.g., Morocco’s solar potential, grid reliability) and how their model addresses them.
- The objective function combines installation costs, grid energy consumption, and charging time. However, the rationale for selecting the weighting factors (λ₁, λ₂) is not provided. A sensitivity analysis is necessary to justify these parameters.
- Constraints such as EV arrival/departure patterns, battery degradation, and PV intermittency (e.g., seasonal variations) are overlooked. These factors significantly impact real-world charging schedules and infrastructure design. The LOPF formulation lacks critical details (e.g., line capacity constraints, voltage stability), which are essential for validating grid interactions.
- The results (e.g., SC5’s balanced performance) are presented descriptively but lack statistical significance testing. For instance, is the difference in grid dependency between SC3 (33.16%) and SC5 (41.65%) statistically meaningful? Charging time reduction in SC4 (0.9 hours) assumes ideal conditions (e.g., 150 kW chargers). Practical limitations (e.g., thermal constraints, charger availability) are ignored.
Author Response
We greatly appreciate your insightful comments, which have allowed us to further refine the manuscript. Below are our responses to your comments, along with the revisions made.
Comment 1: The integration of PyPSA-LOPF for EV charging infrastructure optimization is not novel, as similar tools (e.g., MILP, stochastic optimization) have been extensively applied in prior studies (e.g., [16], [27], [29]). The manuscript lacks a clear articulation of its unique contribution compared to existing literature. For instance, how does this work differ from [29], which also focuses on university campuses and solar-PV integration?
Response 1: hank you for this important observation. While it is true that PyPSA-LOPF and other optimization frameworks have been used in previous studies, our contribution lies in the real-world deployment of PyPSA-LOPF in a context-specific case study, Cadi Ayyad University in Morocco. This case integrates actual PV production and EV charging data, and addresses regional solar potential, grid limitations, and behavioral charging patterns specific to the Moroccan context areas that have received limited attention in existing literature.
To further clarify the unique contribution, we have added the following distinction to the manuscript: See pages 5-6, lines 182-210
"Zhang et al. [16] employ a stochastic optimization approach to account for uncertainties in renewable energy availability, but their reliance on synthetic data and limited modeling of charging infrastructure reduce the applicability of their findings to real-world deployment. Kassab et al. [26] emphasize multi-objective optimization for energy systems, yet their infrastructure modeling lacks technical depth and omits actual EV charging behavior. Wu et al. [29] focus on optimizing PV capacity for EV charging on a university campus, but their work stops short of modeling charger-level scheduling or integrating time-dependent grid constraints. Moreover, they do not utilize open-source grid optimization frameworks, limiting the replicability of their approach. In contrast, our study introduces a comprehensive, open-source framework using PyPSA-LOPF, which uniquely enables us to follow the PV generation profile, enhancing PV self-consumption and minimizing grid dependency. By leveraging real-world PV production and EV charging data from Cadi Ayyad University, we model dynamic charging behaviors at the charger level, incorporate grid availability and analyze multiple optimization scenarios."
Comment 2: The case study at Cadi Ayyad University is a strength, but the authors should better highlight regional-specific challenges (e.g., Morocco’s solar potential, grid reliability) and how their model addresses them.
Response 2: We appreciate the suggestion and agree that emphasizing regional context is essential. We have revised the manuscript to include a more detailed description of Morocco’s energy landscape.
The revised text: See pages 10, lines 368-381
"The optimization algorithm is implemented in a practical case study aimed at the planning and design of an EV charging infrastructure at Cadi Ayyad University, specifically within the Faculty of Science and Technology (FST) in Marrakech. This location presents both opportunities and challenges that are emblematic of the Moroccan context. The region's high solar irradiance renderswith average Global Horizontal Irradiance (GHI) levels exceeding 2,000 kWh/m²/year [41], it particularly suitable for the integration of solar energy, and the project seeks to leverage this potential by developing a cost-effective charging system that maximizes the utilization of PV energy, thereby supporting the university's commitment to sustainable mobility and the transition to green energy."
Comment 3: The objective function combines installation costs, grid energy consumption, and charging time. However, the rationale for selecting the weighting factors (λ₁, λ₂) is not provided. A sensitivity analysis is necessary to justify these parameters.
Response 3: Thank you for pointing this out. The weighting factors (λ₁, λ₂) are critical to our optimization framework, as they balance the trade-offs between cost minimization (installation and operational costs) and user equity (charging time). We recognize that the lack of explanation on the rationale for selecting these factors is a limitation, so we have now included a sensitivity analysis to explore how different weightings affect the outcomes.
The updated section of the manuscript now : See pages 8, lines 277-286
"Equation 1 aims to minimize the total cost of the EV charging infrastructure by balancing three key factors: reducing the installation cost C_(Install ), minimizing grid energy consumption E_Gridto promote sustainability, and reducing charging time T_Charge for efficiency. The weighting factors λ1 and λ2 control the importance of grid energy usage and charging speed, allowing the optimization to prioritize specific goals based on system requirements.
To ensure a balanced contribution of each term in the objective function and prioritize charging time as per our design objectives, the weighting factors λ1 and λ2 are computed based on the ratio between the installation cost and the maximum expected values of energy demand and charging time."
Comment 4: Constraints such as EV arrival/departure patterns, battery degradation, and PV intermittency (e.g., seasonal variations) are overlooked. These factors significantly impact real-world charging schedules and infrastructure design. The LOPF formulation lacks critical details (e.g., line capacity constraints, voltage stability), which are essential for validating grid interactions.
Response 4: We appreciate your detailed comment on this matter. As noted, EV arrival/departure patterns, battery degradation, and PV intermittency are important factors that were initially simplified in the model. In response, we have expanded the discussion to acknowledge these limitations and outline how we plan to address them in future iterations of the model.
Additionally, we have updated the manuscript to clarify the LOPF limitations related to line capacity constraints and voltage stability. Future work will aim to incorporate these factors to better simulate real-world grid interactions.
Revised text: See pages 21, lines 673-683
"However, several limitations remain. The model simplifies certain aspects, such as EV arrival/departure variability, battery degradation, and seasonal PV intermittency. Additionally, the LOPF approach does not fully capture nonlinear grid constraints like voltage stability and thermal limits, which are relevant for high-density charging.
To enhance model realism and applicability, future research will integrate stochastic behavior modeling, nonlinear power flow formulations, and infrastructure-specific constraints. Additionally, sensitivity analysis and a wider set of real-world datasets would allow for a more robust validation of the model. Despite these limitations, this work establishes a solid foundation for planning and optimizing EV charging systems that support urban energy transition goals and can be adapted to various grid configurations and user patterns."
Comment 5: The results (e.g., SC5’s balanced performance) are presented descriptively but lack statistical significance testing. For instance, is the difference in grid dependency between SC3 (33.16%) and SC5 (41.65%) statistically meaningful? Charging time reduction in SC4 (0.9 hours) assumes ideal conditions (e.g., 150 kW chargers). Practical limitations (e.g., thermal constraints, charger availability) are ignored.
Response 5: Thank you for your thoughtful comment. We recognize the need for statistical significance testing to provide more robust insights into the differences observed in the results. In response, we have now included a statistical analysis of the differences between the scenarios.
.
Revised text: "SC5, by contrast, integrates three Level 2 AC chargers (7 kW) with four Level 3 DC chargers (22 kW) for a total cost of 79,500 MAD. This configuration reduces charging time to 3.3 hours, offering a well-rounded compromise between investment and operational performance.
In conclusion, SC4 prioritizes speed at a high cost, while SC2 focuses on affordability at the expense of scalability. SC1 presents a balanced but less flexible model. SC3 and SC5 stand out as intermediate options, with SC5 offering slightly superior efficiency, making it the most advantageous scenario when considering both economic and functional criteria."
And “ From a graphical standpoint, Figure 4 highlights the cost-effective nature of SC2 and the high-capacity design of SC4, while SC5 clearly stands out as a middle-ground solution, balancing cost and performance, Figure 5 reinforces this position, showing that SC2 offers the lowest operational cost, but SC5 maintains a competitive operational profile while accommodating broader sustainability and energy efficiency goals”
And “SC4 and SC5 also encounter charger saturation between 12:00 and 14:00. However, it is important to note that SC5 manages to limit this congestion to a shorter timeframe and less intensity compared to SC3 and SC4. Despite operating under a multi-objective strategy that integrates moderate infrastructure investment, significant renewable energy use, and demand-side efficiency, SC5 does not collapse under peak demand conditions. It maintains adequate performance, ensuring that charging needs are met during most periods, without gasping for capacity or severely restricting user access”
And “By contrast, SC5 offers a well-balanced strategy that integrates solar energy optimization, cost control, and time efficiency. Charging is distributed evenly from 09:00 to 15:00, with pronounced peaks at 09:00, 12:00, and 15:00 as shown Figure 13. The energy distribution is more uniform across all EVs, minimizing disparities and maximizing infrastructure utilization. This scenario effectively mediates the trade-offs between operational cost, renewable energy integration, and equitable access”
Round 2
Reviewer 1 Report
Comments and Suggestions for AuthorsThe authors made significant changes to improve the manuscript.
However, some comments were not properly addressed. Specifically,
- Make sure that all fonts are readable in the figures.
- Use the appropriate URLs for the references, preferably the DOI.
- Some URLs in the references do not directly link to the studies/reports but only to the website. e.g. [15], [42-48]
- Do not use "n.d."; this reflects a poor review of the literature. Either find the publication year or a better academic source.
- Remove "6. Patents"
Author Response
Thank you for your helpful comments. They helped us improve the manuscript. Below are our responses to each point, and the changes have been made in the revised version
Comment 1: Make sure that all fonts are readable in the figures.
Response 1: Thank you for your feedback. We have redrawn and enlarged the figures, particularly Figures 4, 5, 6, and 7, to ensure that all fonts and graphical elements are clearly visible.
Comment 2: Use the appropriate URLs for the references, preferably the DOI.
Response 2: We appreciate your suggestion. We have added DOIs for all journal articles where available. For references that are reports or studies without a DOI, we have carefully reviewed and updated the URLs to ensure they link directly to the full report or study, rather than to a general website.
Comment 3: Some URLs in the references do not directly link to the studies/reports but only to the website. e.g. [15], [42–48]
Response 3: Thank you for pointing this out. Regarding reference [15], I have replaced it with a publication that addresses the same topic and includes a direct link to the full publication https://doi.org/10.1016/j.rser.2014.03.031. As for references [42–48], I have updated the URLs to point directly to the specific pages containing all the technical details related to the EV charging stations. Unfortunately, I was not able to replace them with academic articles, as the detailed specifications and information about these chargers are only available on the official websites of the manufacturers or on trusted commercial platforms where the products are listed.
Comment 4: Do not use "n.d."; this reflects a poor review of the literature. Either find the publication year or a better academic source.
Response 4: We agree with this observation. We have carefully reviewed all references marked "n.d." and either retrieved the correct publication year .
Comment 5: Remove "6. Patents"
Response 5: we have removed Section 6 “Patents” from the manuscript.
Reviewer 2 Report
Comments and Suggestions for Authorsno further comments, thanks for your efforts
Author Response
Thank you for reviewing our manuscript.
Reviewer 3 Report
Comments and Suggestions for AuthorsI have no comments.
Author Response
Thank you for reviewing our manuscript.