<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Obed Sims on Medium]]></title>
        <description><![CDATA[Stories by Obed Sims on Medium]]></description>
        <link>https://medium.com/@obedsims?source=rss-1027fd152a6f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WryKOa7vEmKJt6GAC8XGhQ@2x.jpeg</url>
            <title>Stories by Obed Sims on Medium</title>
            <link>https://medium.com/@obedsims?source=rss-1027fd152a6f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 15:45:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@obedsims/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Can UK Cities get to Net Zero by 2030? (using Python and QGIS)]]></title>
            <link>https://medium.com/@obedsims/can-uk-cities-get-to-net-zero-by-2030-using-python-and-qgis-1cd28820a1f1?source=rss-1027fd152a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1cd28820a1f1</guid>
            <category><![CDATA[solar-energy]]></category>
            <category><![CDATA[environment]]></category>
            <category><![CDATA[renewable-energy]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[energy]]></category>
            <dc:creator><![CDATA[Obed Sims]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 09:11:13 GMT</pubDate>
            <atom:updated>2022-12-08T09:11:13.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M5_PcaBRHse_jhX9erQZhw.png" /><figcaption>City of Bristol — Image by Author</figcaption></figure><p>The increasing significance of the legally binding 100% CO₂ emissions reduction has led most major organisations in the public and private sectors to take a view on how the UK energy system will evolve to 2050. Though a few have stood out as forerunners in reaching this target before 2050. For example, the city of Bristol has <strong>declared an ambition to become net zero carbon by 2030</strong>. We will be looking at this specific case and analyse if is this a realistic goal, if so, how can it be achieved?</p><p>Policy and planning decisions toward that goal are not straightforward, given the many possible technological options and the different social and political barriers they face. Energy system optimization models can inform decisions by identifying system configurations to reach a target such as zero emissions with minimum cost (the discounted financial fixed and variable costs). Half of the 30 integrated assessment models of climate change that inform the Fifth Assessment of the IPCC are based on cost optimization [1]. However, cost optimality alone ignores the social and environmental dimensions that are more important for real-world political feasibility and that models have difficulties depicting. For example, the deviation in cumulative total system costs from the cost-optimal scenario for the UK in 1990–2014 is equal to 9–23% under various technology, cost, demand, and discount rate assumptions [1].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QYyf7SJzb5NumfQSItQmqw.png" /><figcaption>Difference between real-world and cost-optimal transitions — [1]</figcaption></figure><p>To address these shortcomings we introduce a method that generates spatially explicit practically optimal results (SPORES). This allows us to generate a number of alternative scenarios which are within a certain range from the optimal cost.</p><h3>What progress has Bristol City made?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c4pxSWelTK9AKntn" /><figcaption>Bristol City — Photo by <a href="https://unsplash.com/@john090780?utm_source=medium&amp;utm_medium=referral">John McMahon</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This article will only consider the route to decarbonizing Bristol’s electricity supply. With the sheer scale and range of energy consumers in areas such as heat, waste, and transportation it would require more than an short article to dismantle the entire energy system.</p><p>Bristol currently produces about 8% of its electricity consumption from renewables situated in the city (circa. 35% for GB as a whole) [2]. Moreover, electricity-related emissions currently constitute 30% of Bristol’s total carbon emissions. When it comes to investing within the city, land availability is the one of the main issues. Space for wind onshore and utility-scale solar is limited, especially when under contention with other developments such as housing. This reduces the quantity and range of viable clean technologies. One ideal technology for dense cities is rooftop solar, which directly provides building owners electricity bill savings without the requirement for more land or planning permission.</p><p>Consequently, technologies considered in the modelling are based around the feasibility (e.g. land availability), viability and whether the technology is likely to be market-ready by 2030. This likely leaves out technologies such as hydrogen or direct air carbon capture.</p><h3><strong>Model Creation</strong></h3><p>The optimisation model described below was built in Python and is implemented in the widely used open-source <strong>Calliope </strong>framework [3]. It was developed to answer problems about the transition to renewable energy. As a basis for comparison, we first start with a discussion of model results from the cost-minimizing optimal solution.</p><p>This baseline scenario ensures all electrical generation inside Bristol City’s boundaries is consumed within Bristol, but imports are avoided because the UK grid won’t be decarbonised by 2030. Constraints have been set depending on resource availability and viability; for example, rooftop PV could potentially be installed on 142k rooftops across Bristol, but with a minimum rate of return (IRR) constraint of 5%, the number of viable rooftops drops to circa. 95k. Similarly, utility-scale solar potential is dependant on available undeveloped land that isn’t labelled under high grade agricultural land, parks, natural reserves or sports grounds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ppjfgjratO2bOnfq" /><figcaption>Photo by <a href="https://unsplash.com/@aj5tdt?utm_source=medium&amp;utm_medium=referral">Anders J</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Thanks to the <strong>WPD Open Data</strong> platform, half-hourly electricity demand data is accessible for each of the 20 primary substations, displayed below. A random forest model was used to fill in the missing data <a href="https://github.com/obedsims/bristol_net_zero/tree/main/missing_data_random_forest">(link to model)</a>. For simplicity, it has been assumed that electricity demand stays relatively constant until 2030, this is based on energy efficiency measures reducing demand in Bristol by 20% since 2005 [2]. Though this is stabilising and with the anticipated adoption of electric vehicles (EVs) and heat pumps this will likely result in a rise in demand.</p><p>Links between the various voltage levels, including primaries, Bulk Supply Points (BSP), and Grid Supply Points (GSP), are shown below, with the current firm capacity of each substation added as a constraint for simplicity. These locations are linked together by AC distribution lines. By consuming electricity in one location and producing it in another linked location, the links allow resources to be drawn from the system at a different location from where they are brought into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzrg_ORQ7e4NOcF2Zlt3Uw.png" /><figcaption>Distribution Power Links — Image by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFwKs2G1fg-CYe_qePWWZw.png" /><figcaption>Map of Bristol City Distribution Network — Image by Author</figcaption></figure><p>Existing generation has also been connected to various substations, this includes; 28MW of rooftop solar, 3.6MW of utility-scale solar, 48.8MW of Energy-from-Waste (EfW) and 30MW of onshore wind.</p><p>During the optimisation, technology mix decisions are made in three dimensions: which technologies to deploy, where their installed capacity is located (supply region), and how much of that capacity is required to operate the system. If supply is unable to match demand then this would be labelled as ‘unmet electricity demand’ which indicates a blackout.</p><h3>Optimisation Results</h3><p>The cost-optimal configuration from the model’s first, conventional run shows a significant increase in rooftop PV capacity (+766MW — 50-60% of all rooftops in Bristol City), followed by utility-scale solar (+123MW). To accompany this generation are significant additions of utility-scale and small-scale battery storage (995 and 1,119MW), respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jIH1X0LqqE4wvyJooN2URg.png" /><figcaption>Cost-optimal result capacity expansion (CCGT CCS = gas turbines with carbon capture storage)— Image by Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HUwPEEeTPxKGnp7_zhS6oQ.png" /><figcaption>Capacity expansion in each supply region — Image by Author</figcaption></figure><p>The remarkable levels of rooftop solar and small-scale BESS required throughout the city can be seen above, with practically all regions requiring their full solar PV generation and storage capacity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KgGECGfvXU3TPRaG5Q5CbQ.png" /><figcaption>Week of operation during the summer &amp; winter — Image by Author</figcaption></figure><p>Despite all the renewable generation and storage capacity, there still remains significant unmet demand (shown in grey) in the winter, as well as in the evenings and early mornings throughout the summer. Proving that imports from outside Bristol City are necessary to ensure that supply meets demand. Subsequently, all further scenarios (SPOREs) conducted will contain imports, but to maintain the net-zero restriction, all imports will be sleeved renewable (zero-carbon) generation originating from outside Bristol.</p><h3>SPOREs</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ls_ZjXMNqzaeUUm-YxuO_A.png" /><figcaption>Frequency Distribution of Capacity Expansion Potential Utilization across the 60 SPOREs — Image by Author</figcaption></figure><p>At a 10% optimal cost relaxation, the chart above shows the frequency distribution of the capacity expansion implemented by each technology. Across all 60 SPORES battery storage capacity is consistently maximised as this falls hand-in-hand with the expansion of rooftop solar PV. Synergy between daily PV fluctuations and short-term battery storage frequently reduces the need for the more costly gas turbine capacity for intra-day balancing.</p><p>When a higher investment margin is made available (10% cost relaxation), the coexistence of multiple strategies becomes less possible (less wind, solar and tidal), and competition effects weaken overall, suggesting an increase in risks associated with the reliance on a single strategy. Meanwhile, the existing EfW is shown to be structurally hard to replace, predominantly due to the very low or potentially negative operating/waste costs to produce electricity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8WYnaMBWlNJYg-Df3K0GNg.png" /><figcaption>Image by Author</figcaption></figure><p>The importance of storage capacity is shown above, such a high overall variable renewable capacity could potentially lead to a non-negligible increase in curtailment, i.e., peak production exceeding demand. For example, St Pauls 11kv, the darkest region in the right hand figure is the region closest to curtailment at a value of 0.925 (above 1 being the region where supply exceeds demand and distribution capacity). Curtailment may be seen as a problem, since it is lost revenue from the perspective of the operators, but it also signifies overcapacity. Under unfavourable weather conditions, the combination of such overcapacity with a large storage capacity may contribute to providing the required redundancy for stable system operation. Not only that, if grid capacities were to be upgraded, this would reduce the need for excessive battery storage to store this energy but would promote greater flow between each supply region.</p><h3>So how far off net-zero would the City of Bristol be?</h3><p>To visualise this we can consider the amount of green imports required, ranging from 597GWh (37% of the total demand and equal to the annual electricity consumption of 49k average UK homes) in the cost-optimal scenario up to 783GWh (49% of the total demand) in the worst-case SPORE. Hypothetically, if generated by a 4.5MW onshore turbine (around £5.4m per turbine) just north of Bristol City, a minimum of circa. 44 (total 198MW) and a maximum of 57 (total 257MW) of these turbines would be necessary. This would, in turn, have to be matched by even more battery storage and grid reinforcement to ensure the imported wind generation is meeting demand when required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfjhgiLAwDdr1cyORk_4UQ.png" /><figcaption>That’s a lot of turbines — Image by Author</figcaption></figure><p>Energy system scenario modelling is useful in providing an insight into the range of possible futures, and can be a strong tool in convincing those in power to make decisions. Major infrastructure decisions need to be made in the near future and quickly implemented. These changes are unprecedented in their overall scale, but large-scale transitions have been achieved successfully in the UK before, such as the natural gas switchover in the 1970s.</p><p><strong>So what changes are needed?</strong></p><ul><li>Energy efficiency measures, that reduce demand for energy, making the scale of the challenge smaller</li><li>Societal choices that lead to a lower demand for carbon-intensive activities</li><li>Extensive electrification, particularly of transport and heating, supported by a major expansion of renewable and low-carbon power generation, as well as storage solutions. In addition to significant network investment to aid with balancing costs and speed up the transition to a decarbonised network.</li></ul><p>Bristol City have taken the first step by announcing a “climate emergency” and are making strides in tackling this big task. Other cities around the UK are yet to commit to such a challenge and will be watching Bristol’s decisions closely and whether they’ll lead a successful net-zero strategy.</p><h3><strong>Do you think Bristol and the UK can achieve their respective net-zero commitments?</strong></h3><p>Share your thoughts in the comments, or message me with your questions on <a href="https://www.linkedin.com/in/obedsims/">LinkedIn</a> where I try and post content about data science surrounding energy and climate change. For those of you interested, you can find the methodology (coming soon!) and all the code at my <a href="https://github.com/obedsims/bristol_net_zero">github repository</a>.</p><h3><strong>Improvements</strong></h3><ul><li>Further research into forecasted electrical demand in Bristol.</li><li>Only foreseeable technologies have been included in the model so far, but with the rapid learning rates of technologies such as batteries and solar, other technologies could be considered.</li><li>Consider a range of scenarios including weather years, technology costs and demand.</li></ul><h3><strong>References</strong></h3><p>[1]: <a href="https://www.researchgate.net/profile/Evelina-Trutnevyte">Evelina Trutnevyte</a>, University of Geneva— Does cost optimization approximate the real-world energy transition? (March 2016)</p><p>[2]: Centre for Sustainable Energy with Ricardo and Eunomia— Bristol net zero by 2030: The evidence base (Dec 2019)</p><p>[3]: <a href="https://calliope.readthedocs.io/en/stable/index.html">Calliope: a multi-scale energy systems modelling framework</a></p><p>[4]: Lombardi et al., Joule 4, 2185–2207 October 14, 2020 ª 2020 Elsevier Inc. <a href="https://doi.org/10.1016/j.joule.2020.08.002">https://doi.org/10.1016/j.joule.2020.08.002</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1cd28820a1f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agrivoltaics in Africa: Opportunities]]></title>
            <link>https://medium.com/@obedsims/agrivoltaics-in-africa-opportunities-2d0f1ebea7f8?source=rss-1027fd152a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d0f1ebea7f8</guid>
            <category><![CDATA[agrivoltaics]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[africa]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Obed Sims]]></dc:creator>
            <pubDate>Sat, 12 Mar 2022 14:00:58 GMT</pubDate>
            <atom:updated>2022-03-13T19:26:14.054Z</atom:updated>
            <content:encoded><![CDATA[<h3>Agrivoltaics : Opportunities in Africa</h3><h4>Using Python to show the possibilities of this technology to help poorer rural communities tackle food and energy security challenges</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ea4Hco5zMg798E4EWCuf1w.png" /><figcaption>Agrivoltaic System — Image by Sinovoltaics</figcaption></figure><p>What are agrivoltaic (AV) systems? A merging of agriculture with raised photovoltaic (PV) solar generation. Evidenced impacts include greater crop yields due to shade from the panels reducing heat and water loss stress, improved PV generation efficiencies due to cooler panels, and reduced irrigation demands due to reduced evaporation and increased soil water retention, which in turn offer food, energy and water security. This has become especially vital in regions most significantly impacted by rising global temperatures.</p><h4>Can this be used across all crops?</h4><p>No, there is very little information about the shade tolerance of crops beneath PV modules. However, as shown below it is known that at higher light intensities the photosynthesis (growth) rate reaches saturation after which further increases in irradiance have little effect on the photosynthetic rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/1*Z1MrEzRbOeMe_dZ686xa5w.png" /><figcaption>Light Saturation Curve — Image by Author</figcaption></figure><p>Certain crops such as wheat, rice, potato and lettuce have lower light saturation points, occurring at a lower Photosynthetically Active Radiation (PAR) levels, making these crops ideal for agrivoltaic applications. Studies have actually found that using AV systems can increase crop yield, which is most likely due to this phenomenon and a reduction in heat stress [1].</p><h4><strong>Why do we need Agrivoltaics?</strong></h4><p>Because most agrivoltaic experiments are located in the Global North, the extent of their potential to provide socioeconomic, environmental, and livelihood benefits in the Global South is only estimated at this time. However, such benefits are likely to be greatest in parts of the Global South, where there is abundant solar radiation, a huge need for decentralised energy solutions, extensive food security challenges, and an increase in the frequency of droughts due to climate change. This is an unparalleled opportunity for AV systems to bring sustainable livelihood benefits along with food and energy security.</p><h4>Modelling an Agrivoltaic System in Ethiopia</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q4_pHR_h8Ol4IOaj" /><figcaption>Photo by <a href="https://unsplash.com/@ytetbyflex?utm_source=medium&amp;utm_medium=referral">Yonatan Tesfaye</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A 0.23 acre (76 kWp) agrivoltaic system in Ethiopia’s Lake Tana Basin was modelled to better understand the potential benefits and operation of this system.</p><p>A North-South array orientation was used to ensure a more even distribution of sunlight throughout the day for the underlying crops. The <a href="https://pvlib-python.readthedocs.io/en/stable/package_overview.html#">PVLIB</a> python library was used to estimate the spatial-temporal interception of direct and diffuse sunlight of both the fixed-tilt panels and the ground beneath using a view factors approach. Moreover, bifacial panels (double-sided panels) were considered to see the additional benefits they could provide in collecting the reflected diffuse and direct irradiance from the surrounding surfaces. As shown below the introduction of the panels results in noticeable reduction in the irradiance reaching the plants, however still tending to rise above the daily useful PAR for lettuce at circa. 213 𝑊/𝑚₂ [2].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UlYZ3CmcgEyY8tM3mD0gpw.png" /><figcaption>Image by Author</figcaption></figure><h4>Plant growth model</h4><p>Lettuce (Great-lakes cultivar) was the crop of choice which in Ethiopia is commonly planted after the end of rainy season in September and harvested by the end of the year. With reduced rainfall during this period, the AV system would be expected to reduce temperatures under the panels by a couple of degrees [1], minimising heat stresses and transpiration. A dynamic hourly lettuce growth model by <a href="https://www.sciencedirect.com/science/article/abs/pii/S0308521X94902801">Van Henten (1994)</a> [3] was used which considers air temperature, CO₂ concentration and solar irradiance (beneath the panels) as input variables. Starting in August (hour 5088), once the lettuce crop reaches the desired fresh weight per head then the crop is harvested and the cycle restarts after three days — imitating the replanting of lettuce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CiDVqaZcY-dFeJwU5QPlMw.png" /><figcaption>Plant Growth Curve — Image by Author</figcaption></figure><h4>Optimising the model</h4><p>Three variables were considered; array height, azimuth and tilt. Firstly, as displayed below, array height can be seen to have minimal impact on both the solar generation and crop yield. However, its important to ensure it lies above the height required for workers and equipment to operate beneath yet minimises the cost of infrastructure. Secondly, the azimuth can be seen to have an impact on solar generation with the optimal angle being 173<strong>° </strong>which faces the panels south (towards the sun). Finally, the tilt angle appears to have the greatest influence on both solar and crop yield. Lowering the tilt reduces inter-row shading but eventually causes the panels to face away from the sun. Lettuce profits rise 52% by reducing the tilt angle from 50<strong>°</strong> to 1°, all due to an increase in daily average PAR. Consequently, this reduces the optimal tilt from 14° for a ground-mount system to 7° for this AV system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXLNFr_BH7iAjfhIbAf8-Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4t2Qs1g637-9ixliIz8tqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GF2GAg5RbYBM4crf079Ww.png" /><figcaption>Image by Author</figcaption></figure><h4>Results</h4><p>Annual solar generation totalled 137,466 kWh from the front-side of the panels and 22,927 kWh (~17% bifacial gain at quite a low albedo!) from the back-side of the panels. Assuming an off-grid solar PV system and appropriately sized battery this could power approximately 40 average UK homes or 500 average East African homes. This shows how a significantly smaller system or non-bifacial system could still provide the needs of a rural community. If grid connected then a proportion of the annual generation income ($6.7k) to the developer should be used to fund community development and grid-connection of homes.</p><p>Lettuce yields were at 43 t/hectare (13,194 head) and took an average of 61 days to mature after transplanting, which is a good yield despite the presence of panels; this time range is within the expected range for the growth of this type of lettuce.</p><h4>Conclusions</h4><ul><li>There is a growing portfolio of evidence demonstrating the performance of agrivoltaic systems in the Global North [4], which provides a valuable evidence base for developing agrivoltaics elsewhere. Similar evidence now needs to be generated from pilot projects in East Africa and the Global South, where environmental and socio-economic conditions mean the sustainable development and livelihood benefits are even greater.</li><li>With 75% of the East African population dependent on rainfed agriculture [4], AV will help mitigate the expected decrease in crop yields for those subject to the harshest effects of climate change.</li><li>Off-grid solar generation can be used as a means to develop rural communities and make them self-sufficient or act as an enabler to connect these communities to the grid.</li><li>With consumption levels in both households and enterprises remaining very modest in East Africa even small (&lt;10kW) AV projects could provide significant community benefits.</li></ul><p>Feel free to share your thoughts in the comments, or message me your questions on <a href="https://www.linkedin.com/in/obedsims/">LinkedIn</a> where I try and post content about data science surrounding energy and climate change.</p><p>Check out the code <a href="https://github.com/obedsims/Agrivoltaic_model">here</a>. Methodology will be added soon…</p><h4>References</h4><p>[1]: Brecht Willockx , Bert Herteleer and Jan Cappelle (June, 2020) — <em>Combining photovoltaic modules and food crops: first agrivoltaic prototype in Belgium</em></p><p>[2]: Muhammad Hussnain Riaz (Department of Electrical Engineering, Lahore University) — <em>Crop-specific Optimization of Bifacial PV Arrays for Agrivoltaic Food-Energy Production: The Light-Productivity-Factor Approach</em></p><p>[3] Van Henten — IMAG-DLO(1994) — <em>Sensitivity analysis of a dynamic growth model of lettuce</em></p><p>[4] Richard J. Randle-Boggis (June 2021)— <em>Agrivoltaics in East Africa: Opportunities and challenges</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d0f1ebea7f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where should we be placing EV charging stations? — using QGIS and PulP]]></title>
            <link>https://medium.com/data-science/where-should-we-be-placing-ev-charging-stations-using-qgis-and-pulp-d2bb7b664a55?source=rss-1027fd152a6f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2bb7b664a55</guid>
            <category><![CDATA[electric-car]]></category>
            <category><![CDATA[maps]]></category>
            <category><![CDATA[hands-on-tutorials]]></category>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[editors-pick]]></category>
            <dc:creator><![CDATA[Obed Sims]]></dc:creator>
            <pubDate>Wed, 12 Jan 2022 16:37:16 GMT</pubDate>
            <atom:updated>2022-07-01T13:17:57.874Z</atom:updated>
            <content:encoded><![CDATA[<h4><a href="https://towardsdatascience.com/tagged/hands-on-tutorials">Hands-on Tutorials</a></h4><h3>Where Should We Be Placing EV Charging Stations? (Using QGIS and PulP)</h3><h4>A journey to develop a model that indicates optimal locations for EV charging stations in Manchester</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*axSXLcv1swEiGah4nMRqjA.png" /><figcaption>Road Map of the City of Manchester — Image by Author</figcaption></figure><p>To persuade potential electric vehicle (EV) buyers it is essential that the current charging station network is developed. The terminology “range anxiety” describes the situation where EV owners are worried about exhausting their EV battery during a trip. Currently, most EV owners have access to home charging, whereas home charging is almost impossible for those living in an apartment or a condo, this is especially visible in the city of Manchester. Therefore, to meet the demands of all potential buyers, it is necessary to grow the charging network wisely.</p><h3>Working with GIS Data</h3><p>The approach for this study was to place high importance on geographical information such as traffic flow, existing EV charging, potential car park locations for the chargers and land-use classification.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0UdlTosHdj8vADGXKIe6g.png" /><figcaption>GIS data inputs in 68km² grid — Images by Author from QGIS</figcaption></figure><p>Charging demands were calculated based on the daily car traffic flow at different measurement points ranging from 39 to 140k (Figure 1). Because the measurement points of traffic flow aren’t evenly distributed and may be missing in some areas, a 68 km² grid network is constructed where the average traffic flow is calculated in each grid cell (Figure 2). For those grids that do not include any measurement points, the traffic flow would be the average of the surrounding grids. Land-use classification shown in Figure 3 was also used to determine suitable locations for fast and slow chargers as it’s assumed fast chargers would be installed in commercial or mixed-used areas, while slow chargers are allocated around apartments and flats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mjSb1ncWRc86OgLcx8FpHQ.png" /><figcaption>Car parks (left) &amp; existing EV chargers (right) — Images by Author from QGIS</figcaption></figure><p>Figure 4 shows the potential EV charging locations, where we have used council-managed car parks, predominantly due to this data being readily available (you can change this depending on your viable locations). Figure 5 displays the existing EV charging locations, consequently, these areas are where charging demand is already being met. In turn, our model must consider these factors by selecting the most suitable car parks with the highest charging demand.</p><h3>Developing the Optimisation Model</h3><p>This section goes through the integral parts of the Python code for the problem formulation, the full picture can be found at <a href="https://github.com/obedsims/Musk-Model.git">github</a>. Our first step is to create a function that produces sets for the demand locations (centroids of the grid cells) and the potential EV charging locations (car parks).</p><pre>def gen_sets(df_demand, df_parking):<br>    <em>&quot;&quot;&quot;Generate sets to use in the optimization problem&quot;&quot;&quot;<br>    </em># set of charging demand locations (i)<br>    demand_lc = df_demand.index.tolist()</pre><pre>    # set of candidates for charging station locations (currently    existing parking lots) (j)<br>    chg_lc = df_parking.index.tolist()<br><br>    return demand_lc, chg_lc</pre><p>Secondly, a distance matrix is used to generate the concept of the service area, if the distance between the demand centroid and car park is greater than 500m (willing walking distance of drivers to charge a car is considered as 500 meters) then a binary variable will be set to 0 otherwise its value will be 1. This can also be performed in QGIS, using the distance matrix function.</p><pre># distance matrix of charging station location candidates and charging demand location<br>coords_parking = [(x, y) for x, y in zip(df_parking[&#39;Easting&#39;], df_parking[&#39;Northing&#39;])]<br><br>coords_demand = [(x, y) for x, y in zip(df_demand[&#39;centroid_x&#39;], df_demand[&#39;centroid_y&#39;])]<br><br>distance_matrix = distance.cdist(coords_parking, coords_demand, &#39;euclidean&#39;)<br>scaling_ratio = 1<br>distance_matrix2 = scaling_ratio * distance_matrix<br>distance_matrix3 = pd.DataFrame(distance_matrix2,index=df_parking.index.tolist(), columns=df_demand.index.tolist())</pre><p>We then need to create a function that contains all the parameters gen_parameters, and a function gen_demand that contains the demand currently being met by the existing EV charging stations in each grid cell<em> i</em> (this comes from the GIS modeling). We can then formulate the Mixed Integer Linear problem, which consists of the objective function, variables and the constraints. Our objective function aims to maximize the profits from the stations by subtracting the total capital and operating costs from the charging revenue. The constraints ensure cars charged at a station are less than both the capacity of the station and the charging demand, in addition to guaranteeing demands in grid cell <em>i</em> are in the service area of the station.</p><pre>def optimize(df_demand, df_parking):<br><br>    # Import i and j set function<br>    demand_lc, chg_lc = gen_sets(df_demand, df_parking)<br><br>    # Import parameters function<br>    di, m, p, t, ci_j, cr_j, ce_j, pe, alpha, lj, N, distance_matrix     = gen_parameters(df_demand, df_parking)<br><br>    # Import current demand of car park z in cell i<br>    diz = gen_demand(df_demand)<br><br>    # set up the optimization problem<br>    prob = LpProblem(&#39;FacilityLocation&#39;, LpMaximize)</pre><pre>    # Variables<br>    n = LpVariable.dicts(&quot;no_of_chgrs_station_j&quot;,<br>                         [j for j in chg_lc],<br>                         lowBound=0)<br>    q = LpVariable.dicts(&quot;Remaining_dem_station_j&quot;,<br>                         [j for j in chg_lc],<br>                         0)<br>    c = LpVariable.dicts(&quot;Tot_costs_station_j&quot;,<br>                         [j for j in chg_lc],<br>                         0)<br>    x = LpVariable.dicts(&quot;UseLocation&quot;, <br>                         [j for j in chg_lc], <br>                         0, 1, LpBinary)</pre><pre>    # Equality Equations</pre><pre>    r = np.full([len(demand_lc), len(chg_lc)], None)<br><br>    for i in demand_lc:<br>        for j in chg_lc:<br>            if distance_matrix[i][j] &lt;= 500:<br>                r[i][j] = 1<br>            else:<br>                r[i][j] = 0</pre><pre>    # Create empty dictionary for the remaining demand in cell i</pre><pre>    zip_iterator = zip(demand_lc, [None]*len(demand_lc))<br>    dr = dict(zip_iterator)<br><br>    # For each cell i subtract the existing number of charging   stations from the charging demands in cell i</pre><pre>    for i in demand_lc:<br>        for j in chg_lc:<br>            dr[i] = di[i] - diz[i] * m[j]<br>            if dr[i] &lt; 0:       # limit minimum demand to zero<br>                dr[i] = 0</pre><pre>    # Objective function</pre><pre>    prob += lpSum(p[j] * t[j] * x[j] - c[j] for j in chg_lc)<br><br><br>    # Constraints</pre><pre>    for j in chg_lc:<br>        prob += c[j] == (cr_j[j] + ce_j[j] + ci_j[j] + 0.1 * ce_j[j] + 0.1 * ci_j[j]) * n[j]+ pe * alpha * q[j]<br>    for j in chg_lc:<br>        prob += q[j] - n[j] * m[j] &lt;= 0                            <br>    for j in chg_lc:<br>        prob += q[j] &lt;= lpSum(r[i][j] * dr[i] for i in demand_lc)<br>    for i in chg_lc:<br>        prob += lpSum(x[j] * r[i][j] for j in chg_lc) - 1 &lt;= 0<br>    for j in chg_lc:<br>        prob += n[j] - x[j] &gt;= 0<br>    for j in chg_lc:<br>        prob += n[j] - lj * x[j] &lt;= 0<br>    prob += lpSum(x[j] for j in chg_lc) == N <br><br>    prob.solve()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9k1m8171bi5dZbFd-EAphA.png" /><figcaption>Red dots indicate best car parks for EV chargers - Image by Author from QGIS</figcaption></figure><h4>Results</h4><p>If we’re only considering implementing 10 fast chargers (40 min charge time to 80%), the optimization produces the results above. Car parks 1–6 are all located along the high traffic routes into the city (darker regions), indicating higher charging demand. In addition to this, all identified fast charger locations are situated around commercial/mixed use areas (yellow regions) such as supermarkets, malls and restaurants. You will also notice, a greater proportion of the chargers are located outside the city center (center-left of image) as approximately 50% of all existing EV chargers are already situated in the centre and meeting the existing demand.</p><h3>Conclusion</h3><p>If you’ve reached this part, I hope this case study has encouraged you to recreate this in your own city, all you need is some readily available geographical information in the UK, such as traffic flow, places you may want to place stations and existing EV charging locations. The optimal location of the charging stations in this model is mainly determined by the geographical distribution of traffic flow and different charging possibilities based on the land-use classification, so geographical information plays an important role in the optimization process. However, there are some limitations to this model. In a future study, varying the size of the grid would be essential to find out its sensitivity. Moreover, the way charging demand has been modeled doesn’t consider the structure of traffic flow, specifically the origin and destination of vehicles. Consequently, the state of the EVs battery is unknown in each demand node.</p><p>Feel free to share your thoughts in the comments, or message me your questions on <a href="https://www.linkedin.com/in/obedsims/">LinkedIn</a> where I try and post content about data science surrounding energy and climate change.</p><h3>References</h3><p>[1]: Caiyun Bian, Hailong Li, Fredrik Wallin, Anders Avelin, Lu Lin, Zhixin Yu (August 2018) Finding the optimal location for public charging stations — a GIS based MILP approach <a href="https://www.sciencedirect.com/science/article/pii/S1876610219300803">https://www.sciencedirect.com/science/article/pii/S1876610219300803</a></p><p>[1]: Ge, S., Feng, L., &amp; Liu, H. (2011, September). The planning of electric vehicle charging station based on grid partition method. In Electrical<br>and Control Engineering (ICECE), 2011 International Conference on (pp. 2726–2730). IEEE.</p><h3>Data Sources</h3><p><a href="https://www.gov.uk/guidance/find-and-use-data-on-public-electric-vehicle-chargepoints">Existing EV charger locations</a></p><p><a href="https://www.manchester.gov.uk/open/homepage/3/manchester_open_data_catalogue">Council Managed Car Parks</a></p><p><a href="https://www.ordnancesurvey.co.uk/business-government/products/open-map-roads">Road shapefiles</a></p><p><a href="https://data.gov.uk/dataset/8b8c5df3-d7e3-484c-89d8-c7b819205002/national-historic-landscape-characterisation-250m-grid-england/">Land-use classification</a></p><p><a href="https://roadtraffic.dft.gov.uk/local-authorities/85">Daily traffic flow</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2bb7b664a55" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/where-should-we-be-placing-ev-charging-stations-using-qgis-and-pulp-d2bb7b664a55">Where should we be placing EV charging stations? — using QGIS and PulP</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>