<?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 Mohammed El Batya on Medium]]></title>
        <description><![CDATA[Stories by Mohammed El Batya on Medium]]></description>
        <link>https://medium.com/@forgemo?source=rss-e61312835e59------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zbE3Z4vyX0wGAOE09Y11dg.png</url>
            <title>Stories by Mohammed El Batya on Medium</title>
            <link>https://medium.com/@forgemo?source=rss-e61312835e59------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 14:43:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@forgemo/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[The Smart Charging Paradox]]></title>
            <link>https://medium.com/comsystoreply/the-smart-charging-paradox-db2b9bbf043e?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/db2b9bbf043e</guid>
            <category><![CDATA[fleet-management]]></category>
            <category><![CDATA[sutainability]]></category>
            <category><![CDATA[ev-charging]]></category>
            <category><![CDATA[mobility]]></category>
            <category><![CDATA[electric-vehicles]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 08:47:31 GMT</pubDate>
            <atom:updated>2025-07-29T08:48:46.339Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why does smart EV charging orchestration remain unreachable?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eeyzLU6PnyX3L2rP" /></figure><p><strong>Short answer—</strong>it’s unlikely to happen in the private sector unless regulators heavily intervene. Instead, the potential lies in controlled environments like industrial premises or distribution centers.</p><p><strong>AI Disclaimer—</strong>This article has <strong>not</strong> been written by an LLM but was reviewed by an LLM, mostly for grammar and spelling. In addition, this article contains quoted paragraphs containing AI-generated comments or summaries, marked as such.</p><p><strong>Author’s Note—</strong>This analysis combines industry research with personal insights and opinions. While key claims are cited, this is not an academic study. Please verify information independently for business decisions.</p><h3>Ideal vs. reality</h3><p>Electric vehicles have become omnipresent in modern society.</p><p>In an ideal world, every parking lot would have a charging point. The power grid would have enough capacity to charge all vehicles at the same time. The charging equipment would be compatible with all vehicle types. The cost of charging would be transparent and uniform across the country. And every electric vehicle would be charged (electrically and financially) right away when parked, without user intervention.</p><p>Unfortunately, this ideal world doesn’t exist and is unlikely to exist in the near future. Car manufacturers are building different cars with incompatible standards. With charging equipment, it’s the same story. Covering every parking lot with a charging point would be extremely inefficient. Every charging network has its individual user management system, price structure, and coverage area. Drivers have to plan ahead, manage range anxiety, and search for charging points along the way, hoping to find them unoccupied.</p><h3>Smart Charging is HARD</h3><p>Although grid capacity and charging infrastructure are growing year after year worldwide, there is still no way around smart charging if we want to tackle peak demand problems, economic inefficiencies, grid stability issues and renewable integration.</p><p>Unfortunately, being smart about charging is quite difficult.</p><p>Let’s say you want to go for a ride tomorrow morning. For an optimal decision on when and how much to charge, you would need to ask yourself most of these questions:</p><ul><li>What is my current state of charge?</li><li>What is my range tomorrow morning?</li><li>How cold/warm will it be, and how will it impact my range?</li><li>How does the charging time impact the energy price? (e.g., off-peak tariff)</li><li>How much charge will I require for my trip?</li><li>How much charge should I keep as a buffer for unplanned detours?</li><li>Should I charge right away or, e.g., later at night when the dynamic price tariff is cheaper?</li><li>Will I have charged enough if I wait for the cheaper energy price?</li><li>Do I require a charging station on my way?</li><li>What charging stations can I use on my way?</li><li>Are the charging stations compatible with my car?</li><li>How fast can I charge at which charging station?</li><li>What is the chance of finding the charging station occupied or defective?</li><li>What alternative options do I have if I can’t use the charging station</li></ul><p>This is, of course, overwhelmingly complex, especially as part of a daily routine. But even with smart charging software solutions, this is too complex to be practically solved. Most people will probably consider only a maximum of 4 aspects [1].</p><h3>Information asymmetry</h3><p>The problem already starts with acquiring the needed information to answer those questions.</p><p>Most of the data is hidden behind a walled garden so that it it is only accessible by individual companies and their partners, to be used in their interest. This is to protect and grow their market share against competitors, which is understandable to some extent [2].</p><p>However, for the individual EV owners and our society as a whole, there is no chance to get centrally coordinated smart charging that is capable of putting societal interests first, unless …</p><ul><li>… unless one big vertically integrated entity controls the whole ecosystem, including the vehicle with its software, the charging station, the power grid, the energy tariff, the route planner, the home solar system, the drivers&#39; calendar, etc.</li><li>… unless the government heavily intervenes with regulations to incentivize all involved parties to open up and play along, using open standards.</li></ul><p>I’m convinced most of us would rather not see the first option happening. The adverse effects would outweigh the positives.</p><p>On the second option, I’m conflicted. It could go either way.</p><p>All in all, the fragmented, decentralized nature of the EV ecosystem is generally a great advantage in terms of flexibility and resilience, but at the same time, it is its biggest weakness for becoming holistically smart.</p><blockquote>The key insight here is the <strong>information asymmetry problem. </strong>Each player in the ecosystem (car manufacturers, charging networks, energy providers) hoards their data to maintain competitive advantage, making holistic optimization nearly impossible. This creates a classic coordination failure, where the sum of individually rational decisions leads to suboptimal outcomes for everyone. (claude.ai)</blockquote><h3>Opportunistic charging is SIMPLE</h3><p>Due to the mentioned reasons, most EV drivers and companies owning EV fleets didn’t care much about smart charging.</p><p>Instead, they tend to charge as much as possible as fast as possible, whenever possible [3]. This holds true for the private sector, but anecdotal evidence suggests that it also holds true for commercial fleets, duty vehicles, and even warehouse robots.</p><p>This opportunistic behavior discards any potential for global optimization of limited resources (time, money, charging stations, electric vehicles, access to power grids, etc.).</p><p>For a long time, this behavior seemed to be considered “good enough” in most cases. But this is changing with increasing momentum. The demand and market pressure for being able to tap into that optimization potential can be expected to steadily grow [4][5].</p><p>What remains to be seen is whether legislators can develop frameworks that balance innovation with data sharing and interoperability, ensuring that these advances serve broader societal interests. As of now, I’m not overly optimistic, though.</p><h3>Controlled environments</h3><p>In closed and controlled environments, however, the outlook is much more promising. Since most of the charging ecosystem must be under one’s own control, controlled environments provide advantageous preconditions.</p><p>Company premises, commercial fleets, public transport, industrial complexes, and logistics facilities are the ideal candidates for such controlled environments.</p><p>The idea is to build a smart central charging orchestration system that collects all the needed information, processes it, and orchestrates the overall charging process so that one or many optimization objectives are met.</p><h3>Data, Data, Data…</h3><p>But what data needs to be collected? The following list provides an sketch of what holistic smart charging would probably require. The list, however, is neither exhaustive nor prescriptive.</p><p><strong>Vehicle Data</strong></p><ul><li>Current battery state of charge (SOC) and capacity</li><li>Vehicle location and movement patterns</li><li>Energy consumption rates under different conditions (temperature, driving style, terrain)</li><li>Charging capabilities (max charging rate, connector types, charging curves)</li><li>Planned routes and departure/arrival times</li><li>Vehicle availability windows and usage schedules</li></ul><p><strong>Infrastructure Data</strong></p><ul><li>Real-time charging station availability and status</li><li>Charging station capabilities (power output, connector types, compatibility)</li><li>Maintenance schedules and equipment health monitoring</li><li>Grid connection capacity and limitations at each charging point</li><li>Maneuvering/parking options</li></ul><p><strong>Energy and Grid Data</strong></p><ul><li>Real-time and forecasted energy prices (dynamic tariffs, peak/off-peak rates)</li><li>Grid load conditions and capacity constraints</li><li>Renewable energy availability and forecasts</li></ul><p><strong>Environmental and External Factors</strong></p><ul><li>Weather conditions and forecasts (temperature impacts on battery performance)</li><li>Traffic patterns and route optimization data</li></ul><p><strong>Business and Operational Data</strong></p><ul><li>Fleet utilization schedules and priorities</li><li>Cost optimization parameters and budget constraints</li><li>Service-level agreements and performance metrics</li><li>Regulatory compliance requirements</li><li>Carbon footprint and sustainability targets</li></ul><p><strong>User and Behavioral Data</strong></p><ul><li>Driver preferences and behavioral patterns</li><li>Historical charging and usage data</li></ul><h3>Collecting the data</h3><p>The chances to get hold of all that data within a controlled environment are much higher but still pose a considerable challenge. Especially when the site and installed systems have been initially set up without central charging orchestration in mind.</p><p>It is up to a site/fleet owner to ensure that all relevant infrastructure components, used systems, and vehicles are collecting relevant information and sending it to a central system. How exactly to do that depends heavily on the individual context and would exceed the scope of this article, but here are some generally applicable strategies:</p><ul><li>Prefer software solutions that allow you to export relevant data in machine-readable, well-documented formats via APIs.</li><li>Implement standardized APIs and protocols. (e.g., OCPP, ISO 15118)</li><li>Install local data aggregation nodes that can collect information from legacy systems that weren’t designed for central reporting.</li><li>Ensure that future equipment purchases include contractual obligations for data sharing and API access.</li><li>Store relevant historical data for future training of machine learning models.</li></ul><h3>Processing the data</h3><p>Having all the data made available, the next step sounds deceptively simple: create an optimal charging schedule for the next 1–3 days so that all vehicles know their ideal charging times and locations.</p><p>Unfortunately, perfectly solving this optimization problem in practical timeframes is in most cases beyond the power of modern technology due to its <a href="https://en.wikipedia.org/wiki/NP-hardness">NP-hardness</a>. Instead, “good-enough” solutions need to be found. What constitutes as “good enough” is very specific to individual use cases. In general, the solution can be considered good enough when the benefits of the schedules justify the effort within a given amortization time frame. With advancements in technology and learnings from experience, those solutions can and should then be continuously improved over time to constantly increase business value and shorten amortization.</p><p>There is a growing number of solutions promising to solve “smart charging,” but most, if not all, are currently limited to a subset of the listed aspects above. It is crucial to research and compare the latest capabilities of current solutions on the fast-moving market when introducing a new centralized charging orchestration system. Especially black-box marketing claims like “AI-Powered Optimization” should be questioned and looked into.</p><p>I won&#39;t promote any products or solution providers since this market is moving fast. But you can quickly get an upto-date overview by asking your LLM of choice with web research capabilities a prompt like this.</p><blockquote>What are the current solutions providers for smart charging and charging orchestration for EV fleets on the market, and how do they differentiate themselves?</blockquote><p>Alternatively, you can implement a custom central orchestration system, but it is critical to not underestimate the computational complexity. The sweet spot for a solution is likely to be found in hybrid approaches that combine heuristic algorithms with machine learning models [7][8][9][10]. But even those will only be coming up with “good enough” solutions.</p><h3>Applying the schedule</h3><p>The final challenge is to apply the charging schedules to the individual workflows through real-time coordination and adaptive feedback loops. Successful implementation requires sub-minute data processing with sub-hour decision intervals for critical adjustments while maintaining 24+ hour optimization horizons. Drivers receive instructions through mobile apps with push notifications for schedule changes, while autonomous systems integrate directly via API for seamless routing adjustments. Fleet telematics systems monitor actual versus planned charging events, with deviations triggering immediate re-optimization.</p><p>The technical architecture must support continuous bidirectional communication between vehicles, charging infrastructure, and the central orchestration system. Edge computing capabilities ensure continued operation during connectivity outages by falling back to a local optimization logic. Successful deployments combine automated enforcement through smart charging hardware that follows central commands with comprehensive change management programs.</p><h3>Conclusion</h3><p>Central charging orchestration for EV fleets represents a classic coordination failure: the technology exists to save millions through optimized charging, but the fragmented ecosystem prevents its widespread implementation. Information asymmetry keeps critical data locked within corporate silos, while the computational complexity of true optimization remains formidable even with modern AI capabilities.</p><p>The private sector will likely continue defaulting to opportunistic charging (simple, immediate, but wasteful) unless regulatory frameworks force data sharing and interoperability. However, waiting for such intervention may be unnecessary.</p><p>The real opportunity lies in controlled environments where single entities can overcome coordination barriers. Corporate campuses, industrial facilities, logistics centers, and dedicated fleet operations can capture most optimization benefits by controlling their charging ecosystem end-to-end. These environments offer the data access, infrastructure control, and economic incentives needed to justify implementation complexity.</p><p>For organizations considering central orchestration, the path forward is clear: start small in controlled environments, focus on hybrid solutions that combine proven algorithms with machine learning, and build systems that can adapt schedules in real-time. The technology is ready, the benefits are substantial, but success depends on choosing the right battleground.</p><p>The millions in potential savings are real, but they’ll be captured incrementally by forward-thinking fleet operators in controlled environments rather than through grand societal coordination.</p><h3>Sources:</h3><p>[1] <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC5822395/">Human Cognitive Limitations. Broad, Consistent, Clinical Application of Physiological Principles Will Require Decision Support</a></p><p>[2] <a href="https://www.linkedin.com/pulse/unlocking-power-proprietary-data-how-companies-habib-baluwala-ph-d/">Unlocking the Power of Proprietary Data: How Companies are Gaining Strategic Advantages</a></p><p>[3] <a href="https://www.nature.com/articles/s44333-024-00023-3">Large-scale empirical study of electric vehicle usage patterns and charging infrastructure needs</a></p><p>[4] <a href="https://www.pnas.org/doi/10.1073/pnas.2317599121">Grid Constraints Study — PNAS (Strongest Academic Evidence)</a></p><p>[5] <a href="https://www.iea.org/reports/global-ev-outlook-2024/trends-in-electric-vehicle-charging">Trends in electric vehicle charging</a></p><p>[6] <a href="https://en.wikipedia.org/wiki/NP-hardness">NP-Hardness</a></p><p>[7] <a href="https://www.sciencedirect.com/science/article/pii/S2666546820300070">Data-driven smart charging for heterogeneous electric vehicle fleets</a></p><p>[8] <a href="https://www.sciencedirect.com/science/article/pii/S036054422501878X">Assessing flexibility from electric vehicles using an open-source energy system model: trade-offs between smart charging, vehicle-to-grid and an extensive charging infrastructure</a></p><p>[9] <a href="https://www.sciencedirect.com/science/article/abs/pii/S036054422501117X">Reinforcement learning-based multi-objective smart energy management for electric vehicle charging stations with priority scheduling</a></p><p>[10] <a href="https://www.nature.com/articles/s41598-025-97473-7">Multi-objective optimization framework for electric vehicle charging and discharging scheduling in distribution networks using the red deer algorithm</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db2b9bbf043e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/the-smart-charging-paradox-db2b9bbf043e">The Smart Charging Paradox</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ ISO 15118–20: The Future of Plug&Charge for Seamless EV Charging]]></title>
            <link>https://medium.com/comsystoreply/iso-15118-20-the-future-of-plug-charge-for-seamless-ev-charging-f548f8e7901e?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/f548f8e7901e</guid>
            <category><![CDATA[electric-vehicles]]></category>
            <category><![CDATA[charging-electric-vehicle]]></category>
            <category><![CDATA[charging-station]]></category>
            <category><![CDATA[charging-infrastructure]]></category>
            <category><![CDATA[charging]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Tue, 10 Dec 2024 09:32:01 GMT</pubDate>
            <atom:updated>2024-12-10T09:32:01.694Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Cards on a table with e-mobility motives in pastel colors." src="https://cdn-images-1.medium.com/max/1024/1*P03zkOT0ewLq4cTwidgg_w.png" /></figure><p>Electric vehicle (EV) adoption is on the rise, but the charging process can still be inconvenient and fragmented. Users often need multiple charging cards or apps to access different charging networks, and navigating these various systems adds friction to the overall EV experience. This lack of standardization is holding back a truly seamless charging process, leading to frustration among users and higher costs. Addressing these issues requires standards that can make EV charging as easy and reliable as plugging in your vehicle — without the hassle of cards or apps.</p><p>A big step in this evolution is ISO 15118, an international standard that sets up how EVs and charging stations communicate. This standard is becoming increasingly important as the industry moves towards an easier “🔌Plug&amp;Charge” experience, which lets users start charging their vehicles without requiring physical cards or apps.</p><h3>🔄 The Evolution of ISO 15118</h3><p>ISO 15118, first introduced in 2014 by the International Organization for Standardization (ISO), aims to make the EV charging experience easier. Its most well-known feature is “Plug&amp;Charge,” which lets EVs automatically start charging. This works by enabling secure communication between the EV and the charging station through digital certificates. When an EV is plugged in, the vehicle and the charging station use these certificates to authenticate each other automatically, eliminating the need for multiple physical cards. This process makes charging smoother and reduces dependency on different apps or payment systems, as everything is handled seamlessly through a secure exchange of information over an IP-based connection over TLS. This ensures that all communications are encrypted, keeping user data secure and allowing for reliable billing without manual intervention.</p><p>The latest version, ISO 15118–20, adds, among other features, the support for multi-contract handling. This means EVs can store more than one contract, which is useful for different situations — like using one contract for public charging and another for free charging at work. This makes managing multiple charging contracts much more convenient for the user, reducing the need to worry about extra fees when using different charging networks.</p><p>ISO 15118–20’s multi-contract handling feature makes it possible for an EV to store several charging contracts, which are automatically selected depending on the context of the charging session. When an EV is plugged into a charging station, the appropriate contract to use is determined. This process uses a combination of location data, user preferences, and contract availability without user intervention. For instance, if an EV is plugged in at a workplace, the system can automatically choose the contract linked to free charging offered by the employer. The digital certificates stored in the vehicle help authenticate this contract seamlessly, ensuring the right billing or authorization is applied for each unique situation.</p><p>However, making ISO 15118 work in real charging systems isn’t easy due to various factors. First, implementing secure communication through digital certificates requires changes to existing infrastructure, including software upgrades at charging stations and compatibility testing with different EV models. Additionally, there are challenges related to standardizing communication protocols across a wide variety of manufacturers and charging networks, each of which may have its own specific requirements and legacy systems. The complexity of ensuring seamless interoperability makes widespread adoption a slow process. I estimate that full adoption of ISO 15118–20 could take up to 5–10 years, as infrastructure is gradually upgraded and standards are harmonized across regions.</p><h3>🚀 The Road Ahead</h3><p>The future of ⚡ EV charging is all about making the process as easy as possible for users. ISO 15118–20, with its ability to handle multiple contracts and enhanced security, is a big step forward. Whether you are a developer, a charging station maker, or just an ⚡ EV enthusiast, the evolution of these standards will significantly improve the experience of smart EV charging and drive the industry towards a seamless, standardized future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f548f8e7901e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/iso-15118-20-the-future-of-plug-charge-for-seamless-ev-charging-f548f8e7901e">🔍 ISO 15118–20: The Future of Plug&amp;Charge for Seamless EV Charging</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flexible EV Energy Consumption Estimation Approach]]></title>
            <link>https://medium.com/comsystoreply/flexible-ev-energy-consumption-estimation-approach-cba9c36d76c7?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/cba9c36d76c7</guid>
            <category><![CDATA[electric-mobility]]></category>
            <category><![CDATA[smart-charging]]></category>
            <category><![CDATA[energy-consumption]]></category>
            <category><![CDATA[simulation]]></category>
            <category><![CDATA[e-mobility-technologies]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Mon, 13 May 2024 08:31:37 GMT</pubDate>
            <atom:updated>2024-05-22T10:02:38.518Z</atom:updated>
            <content:encoded><![CDATA[<h4>Calculating the Energy Consumption of Electric Vehicles for a given track, independent of coordinate system and distance metric.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAdnAWeH69wl1zE2mLisZQ.gif" /></figure><p>This article is about calculating the energy consumption of an electric vehicle on a given track. More precisely, it is about calculating the energy consumption based on recorded or predicted waypoints with attached timestamps.</p><h3>Introduction</h3><p>My approach will be agnostic to the coordinate system of the waypoints. The recordings could originate from a real vehicle or from a virtual vehicle moving in a simulated world. Since this method is also independent<br>of the initial coordinate system, it does not matter if the recordings are using GPS, a Cartesian coordinate system, or something else.</p><p>The only requirement is to be able to calculate the distance between two waypoints. A distinct feature of this method is its ability to take mass into account. This is especially interesting for trucks and public transport vehicles, since they will load/unload cargo and passengers along their path, which can heavily impact energy consumption.</p><p>Though the fundamental principles are very well understood, applying them in a coordinate-system-agnostic way can be challenging. All the necessary calculations and underlying assumptions will be explained so that this method can be easily implemented in an arbitrary programming language for any kind of system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nQhy4WRTLnsjL86O" /></figure><h3>The Waypoints</h3><p>The main goal is to create a method that does not depend on where the data comes from. To ensure this level of independence, it is important to separate the basic physics calculations from the specifics of the data source.</p><p>For this reason, the waypoints will be limited to just a few essential attributes. Enough to allow an accurate calculation of energy consumption — nothing more. The calculations will not need to know anything about the original coordinate system, the exact way distances are measured, or the precise positions of waypoints.</p><p>This is a key decision because positions are closely associated with the coordinate system they’re measured in. Therefore, location-specific attributes like latitude, longitude, or three-dimensional coordinates (x, y, z) will not be used.</p><p>Instead, the focus will be on the attributes that directly impact energy consumption, such as time, distance, altitude, and vehicle mass, as they change from waypoint to waypoint.</p><p>I will assume that the waypoints were recorded or predicted in a previous step, which is outside the scope of this article. In essence, this might be achieved by recording a GPS track of a moving vehicle, or by predicting the track of a vehicle with a route planning system.</p><h4>Waypoint attributes</h4><p>The waypoints are expected to have the following attributes:</p><p><strong>travel time (t)<br></strong>Relative time since departure in seconds.</p><p><strong>distance (s)<br></strong>Relative distance traveled since departure in meters. This is a recording of how far the vehicle has<br>gone since it started moving.</p><p><strong>height (h)<br></strong>Relative altitude difference compared to the altitude at departure. This is important for correct calculations when driving uphill or downhill. If there is no height information available, like in a 2D simulation<br>with an x-y-coordinates system, just set it to 0.</p><p><strong>mass (m)</strong> <br>Total vehicle weight in kg. This can change during the ride, e.g., due to (un)loading cargo or letting passengers in/out.</p><h4>Waypoint indices</h4><p>The waypoints and their attributes are indexed chronologically, starting at zero. I will assume that one waypoint will be recorded about every second.</p><p>Shorter time intervals would increase the resolution, improving the accuracy. Longer intervals will lead to decreased accuracy.</p><p>It depends on the use case what resolution fits best. It is not relevant for the outlined approach, though.</p><p>For simplification, the time is encoded in the indices. This means functions will be written like <em>F_i = m a_i</em> instead of <em>F(t_i) = m a(t_i)</em>.</p><p>The first waypoint has the index 0 and the last one is indexed with <em>n</em>.</p><h3>The Distance</h3><p>Although the traveled distance at each waypoint is needed, this approach is independent of the actual distance metric. Not being concerned with how the distance is measured is a great advantage. Various methods exist to<br>calculate distances, like the Manhattan Distance [1], Haversine [2], or Euclidean Distance [3]. This method works, regardless of which metric is used. The distance could even be calculated from a graph of distances between nodes [4], not using a conventional coordinate system at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EkfrOyALWJXZDXzf" /></figure><h3>Energy Calculation</h3><p>The goal is to calculate the battery charge difference <em>∆B</em> from arrival to departure. This is done by breaking down the journey into segments, from one waypoint to the next, and calculating the small changes in battery charge for each segment <em>∆B_i</em>, where the index <em>i</em> indicates the waypoint where the segment ends.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*prG4NgRA69kmXDWnxqJE6g.png" /></figure><p>This method needs to process two segments before it can calculate the first battery delta. Therefore, the first available battery difference is <em>∆B_2</em>.</p><p>The battery charge for electric vehicles is commonly given in kilowatt-hours (kWh).</p><p>It is worth mentioning that <em>∆B_i</em> can be either positive or negative. The reason is that an electric vehicle can consume and produce energy. Energy production happens through recuperation (also known as regenerative braking) [5], which converts kinetic energy from braking into stored energy.</p><h4>Work, Energy, Efficiency</h4><p>I will focus on the vehicle’s movement and ignore other factors like energy consumption from a HVAC (heating, ventilation, and air conditioning) system.</p><p>A running motor is doing work in the physical sense. That work requires energy coming from the battery. Work (and energy) is commonly given in Joules, but can easily be converted to kWh when needed [11].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*r4CGzxltcsVwA2Ife6CBLA.png" /></figure><h4>Battery-to-Wheel Efficiency</h4><p>A considerable amount of energy gets lost on its path from within the battery, over the powertrain, through the wheels, to the road. This loss needs to be accounted for.</p><p>Modern EVs do have a Battery-To-Wheel (BTW) efficiency of about 75% (ηBTW = 0.75) [7] [5]. This is much better than typical cars with conventional engines, which are around 30% efficient [6] [5].</p><p>With ηBTW , the battery drain for a segment can be calculated, based on the motor’s energy consumption <em>E_motor_i.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*oiXyRj7ETzA0fnScIthWSg.png" /></figure><h4>Recuperation Efficiency</h4><p>There is also a recuperation efficiency factor to account for. It is impossible to recover all the kinetic energy from regenerative braking. Modern EVs seem to have a recuperation efficiency of 70% to 90% e.g., ηG = 0.7 [5]. The remaining braking energy will mainly dissipate as heat.</p><p>Recuperation works by switching the motor’s operation mode to become effectively a generator. The generated electrical energy can also be expressed in kWh. Therefore, it can be easily translated to a battery charge gain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*DY2nFXTjE4MS2lw58u9J6A.png" /></figure><h4>Energy In-/Out-Flow</h4><p>An electric motor can either consume energy, or generate energy by acting as a generator. But it can’t do both at the same time. Therefore, it can be considered a single abstract component that either generates energy or consumes energy. <em>E_motor</em> will represent both operation modes. A positive value indicates that the motor is consuming energy. A negative value indicates that the motor is producing energy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*uhjG-dGpakPM2BMaYKgMcg.png" /></figure><h4>Calculating E_motor_i</h4><p>To calculate E_motor_i, the following reasoning will be applied.</p><p>Since the only available spatial information is distance and height, the waypoints are considered to exist in a two-dimensional space, which will be called distance-height-space, short <em>d/h-space</em>. Generating those 2d-waypoints from recordings in an arbitrary coordinate system is basically a projection into that two-dimensional <em>d/h-space</em>.</p><p>Following this thought, an additional one-dimensional space will be introduced by dropping the height dimension from <em>d/h-space</em>, retaining the distance dimension. It will be named <em>d-space</em>. The waypoints will be projected from <em>d/h-space</em> into the d-space accordingly. This is done to promote the distance (s) attribute from being a scalar in <em>d/h-space</em> to a one-dimensional position vector in d-space, which is an important property for our upcoming calculations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVhtBygo0tz9z6xtdQY3-Q.png" /></figure><p>With position vectors and corresponding waypoint times, the average velocity <em>v_i</em> in <em>d-space</em> between two waypoints can be determined [8]. The index<em> i</em> indicates the end point of the corresponding segment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/248/1*ZHxmOhLxltOTywL1RTB6Kw.png" /></figure><p>It is essential to understand that this velocity vector <em>v_i</em> only exists in the <em>d-space</em>, not in the initial coordinate system of the waypoints. The direction of <em>v_i</em> twill be always positive since it is based on the traveled distance, which can never decrease, while the actual vehicles’ velocity could point in any kind of direction in accordance with its original coordinate system.</p><p>Next, the vehicle’s total kinetic energy at the waypoint <em>i</em> can be calculated, based on <em>v_i</em> [9].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*J2K1qbsImYYhd6w1oFYg-Q.png" /></figure><p>Knowing the total kinetic energy for every waypoint, the difference in kinetic energy between two successive waypoints can be calculated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/372/1*SaGd34Qggrcv3qGJ0oH5wA.png" /></figure><p>The change in kinetic energy <em>∆E_kin_i </em>from one waypoint to the next might have been caused by acceleration from the motor, but could also be explained by other factors, like simply rolling downhill.</p><p>It is, however, certain that one or a combination of multiple forces must have caused this change in kinetic energy.<br>Although the individual forces are still unknown, their total magnitude <em>|F_total_i|</em> can be already determined [9] [10].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*X2ivK55SgM-FRJpR2JcIHQ.png" /></figure><p>In <em>d-space</em>, the vectors <em>F_total_i</em> and ∆<em>s_i</em> are collinear. Therefore, θ (which is the angle between the two vectors) is either 0 or 180 degrees. Thus, <em>cos(θ)</em> will be either 1 or -1.</p><p>Therefore, based on whether the kinetic energy has increased or decreased since the last waypoint, the value of <em>cos(θ)</em> can be determined.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*CElj3iGfmp31YmqXzEj01Q.png" /></figure><p>To put F_total_i into d-space, it still needs a direction. It will be given a general forward direction, where it will be pointing backwards when <em>∆E_kin_i</em> becomes negative. Simply put, <em>F_total_i </em>will point backward when the vehicle slows down and forward when the vehicle speeds up, in the given segment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*6_Gq6SYFNTsSuFHDxoWWhQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/1*BkbPZVdyJ-cLZ8yd2itXvQ.png" /></figure><p>We can assume that rotational forces when driving around corners should not have much effect on energy consumption and will be ignored.</p><p>Since two waypoints are needed to determine the first velocity value and two velocities are needed to calculate the first value for <em>∆E_kin</em>, the first calculable total force will be <em>F_total_2</em>. This is acceptable, since skipping the first ~2 waypoints of a route usually will not matter much (assuming a resolution of 1 waypoint per second and the vehicle standing at the beginning). Alternatively, two artificial “standing” waypoints can be added at the beginning, assuming the actual journey also starts with a standing vehicle.<br><br>Now it is time to look at the individual forces contributing to <em>F_total_i</em>.</p><p>The forces of 1) air drag, 2) gravitation on a slope, 3) rolling resistance of the wheels, 4) the motor’s accelerating force, and 5) the motor’s decelerating resistance (recuperation) will be considered. This is not a complete representation of the real-world physics, but a good enough approximation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*V9AWkhvcBSqAp_P_OjW70g.png" /></figure><p>All mentioned forces can be independently calculated based on the already available information, apart from <em>F_motor_i</em>, which is needed to calculate <em>E_motor_i</em> further down. But when calculating the other forces, <em>F_motor_i</em> also reveals itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*HwaUH2bzia383Ws2KCiZuw.png" /></figure><p>All the forces mentioned in a segment are more or less aligned on a common axis along the vehicle movement path from one waypoint to the next. This will hold true for any kind of initial coordinate system and distance metric.</p><p>Since the forces are aligned, we can simply put them into our d-space. Their magnitude stays the same, and their direction will be decided based on whether they are a primarily resisting or accelerating force.</p><p>Please note that the motor force and the slope force can switch directions. The motor force switches directions when it is used for recuperation. The slope force, assumed to be a primarily resisting force, switches direction<br>when driving downhill.</p><p>Finally, <em>E_motor_i</em> can be calculated, based on <em>F_motor_i</em> [12].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/358/1*1RUQ-TaiZpGVcUCYesaWFw.png" /></figure><p>The next segments will explain how to calculate the missing forces: F_drag_i, F_slope_i and F_rr_i.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HU_e24pHjmj6eA1S" /></figure><h3><strong>Air drag</strong></h3><p>If an object moves fast enough through the air, it will experience considerable air resistance, known as drag. The drag grows disproportionately with increasing speeds and heavily impacts the energy consumption at higher speeds [16].</p><p>The following calculations will not account for any headwinds or tailwinds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/1*P_jJUlyuaglyIsc6aNZp4A.png" /></figure><p><strong><em>F</em></strong> is the drag force in Newton.<br><strong><em>ρ</em></strong> is the fluid density of air in kg/m³.<br><strong><em>v</em></strong> is the object velocity in m/s, relative to the fluid.<br><strong><em>A</em></strong> is the cross-sectional area of the object.<br><strong><em>C_drag</em></strong> is the drag coefficient. This is a dimensionless number, based on the shape of the object, approximating its aerodynamic properties.</p><p>The negation is needed to represent its resisting direction in the d-space.</p><p>Coming up with a very accurate drag coefficient can get involved. Fortunately, this has already been done for most vehicle shapes and can easily be found online. Buses, for example, do have a <em>C_drag</em> of about 0.6 [13] while the Tesla Model 3 has an impressively low <em>C_drag</em> of 0.219 [14].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F0xoWXTJ1o5qaCg6" /></figure><h3>Gravity on a Slope</h3><p>As long as the vehicle drives on a flat ground, its velocity is not directly affected by gravity. This, however, changes as soon as there is a slight slope [15]. The vehicle will have to actively work against that force, trying to maintain its target speed when driving uphill. When driving downhill, the vehicle might need to actively decelerate to maintain its speed.</p><p>Decelerating is usually done by using brakes or just not accelerating until the vehicle slows down on its own, caused by resisting forces. We will assume that the vehicle always makes full use of regenerative braking for maximal energy recovery when engaging the brakes. Real electric vehicles, however, do seamlessly transition between regenerative and conventional braking based on different factors like speed. If the parameters and rules of this transition behavior are known, the presented calculations could be potentially adapted to reflect it. This is not in the scope of this article, though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8YHph95CEdQbClT0oMBrFQ.png" /></figure><p>With an increasing incline, more energy is needed to maintain the speed. With increasing decline, more energy can be recovered. Gravity can’t pull the vehicle straight downwards, unless it is in an unfortunate free fall. Instead, the car will be pulled with a fraction of the full gravitational force downhill along the sloped road. The other fraction is still pulling the vehicle perpendicular toward the ground, ensuring that its wheels stay firmly on the ground.</p><p>Splitting up the gravitational force into these two forces is key to our calculations. As you can see in the diagram, <em>F_gravity_i</em> can be split up into <em>F_slope_i</em> and <em>F_normal_i</em>.</p><p><em>F_slope_i</em> is the force the bus needs to overcome when driving uphill. When driving downhill, it is the force that needs to partially counteracted by braking.</p><p><em>F_normal_i</em> is the force pushing the vehicle’s mass through the tires onto the ground. It heavily affects the vehicle’s rolling resistance.</p><p>Considering the forces diagram and the contained triangles, <em>F_slope_i</em> and <em>F_normal_i</em> can be calculated if the slope’s angle <em>α_i</em> and <em>F_gravity_i</em> is known.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/224/1*M3qfXc_srKfkQl7BbP31Bg.png" /></figure><p>The angle α will change along the traveled path. Similar to the velocity, it is only possible to calculate the average angle <em>α_i</em> for a segment. The idea is to build a triangle with the distance <em>∆s_i</em> and the height difference <em>∆h_i </em>of a<br>segment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*uYjzI3FK1WsAEDJJRYDWGw.png" /></figure><p>With basic trigonometry, the slope’s angle <em>α_i</em> can be calculated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/207/1*zpaGEHBh_5S80O8ACyc8Ew.png" /></figure><p>There is, however, a corner case to be aware of. If the vehicle is not moving (<em>∆s_i = 0</em>), there will not be an angle to calculate. In that case, the last known angle can be used instead, assuming the ground is not tilting while the vehicle is standing still.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*nwazHXQLm0yVrf56lFbXrg.png" /></figure><p>Please note that <em>sin(α_i)</em> can become negative when driving downhill. With <em>sin(α_i)</em>, <em>F_slope_i</em> can be calculated and pointed to the correct direction in d-space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*bktAw-C4412AjYnefwp5MQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*NdgyeLdKFerM2fAZZ6gH5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1klr22nbjT67vnup" /></figure><h3>Rolling Resistance</h3><p>The last missing force is the rolling resistance of the wheels. This resistance is influenced by numerous factors like the involved materials, the road surface, temperature, and wetness. All of those factors are being commonly hidden behind a single coefficient, the so-called rolling resistance coefficient <em>C_rr [17].</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/332/1*7YqmgpFMZZDkh34ViMRL-A.png" /></figure><p>Again, the resulting force vector is to be seen in the context of our d-space, pointing “backwards”, thus being negative.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*EkOmTpYaiQSkCT34DvDNpA.png" /></figure><p><em>F_normal_i</em> is the force pulling the vehicle perpendicular onto the ground by gravity, and can be determined from the previous force triangle on a slope.</p><p>Like with the drag coefficient, it can get quite involved to come up with an accurate <em>C_rr</em>. Fortunately, there are comprehensive tables of <em>C_rr</em> values widely available. Bus wheels, for example, do have a <em>C_rr</em> of about <em>0.008</em> on dry asphalt. Depending on the use-case, it might also be worth considering to dynamically adapting the <em>C_rr</em> per section <em>C_rr_i </em>to changing weather and underground conditions during the ride.</p><p>Since the formula for <em>F_rr</em> does not depend on the velocity, it is important to remember that the rolling resistance force won’t move the vehicle on its own. As soon as <em>F_rr</em> overpowers all opposing forces, it stops applying any additional force, even if it had the capacity to do so. Otherwise, the bus would start rolling backwards. This doesn’t happen because <em>F_rr</em> also opposes itself as soon as the wheel isn’t rolling anymore, equally resisting to both directions at the same time.</p><p>Therefore, <em>F_rr</em> is considered to be “switched on” as soon as the vehicle starts moving and “switched off” as soon as the vehicle stops.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*2Fs2Fj5efi3idfvU8BXAgg.png" /></figure><p>This was the last missing piece for calculating <em>∆Bn_i</em> thus <em>∆B_2_n</em>, which is the journey’s aggregated energy consumption.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*ADSUM4cRpinuiiHBAl62yA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rSZE1E0skQ82Kk-I" /></figure><h3>Summary</h3><p>This is a method for calculating the energy consumption of electric vehicles based on waypoints, each characterized by travel time, travel distance, height, and mass. The method is designed to be coordinate-system-agnostic and capable of handling dynamically changing vehicle masses. A feature particularly relevant for trucks and public transportation. It breaks down a journey into segments between waypoints and computes the energy changes for each, accommodating both energy consumption and recuperation through regenerative braking.</p><p>The energy calculations exclude factors such as HVAC systems, focusing solely on movement-related parameters extracted from projections in a 2D distance/height space (d/h-space) and a 1D distance space (d-space). It outlines the mechanics of determining total kinetic energy changes, air drag, gravity effects on slopes, and rolling resistance. These are synthesized into total force vectors associated with each segment, revealing the motor force and the vehicle’s energy interactions.</p><p>In summary, it is a flexible and versatile algorithm for energy computation for electric vehicles that can be adapted for a wide range of applications, enhancing route planning, vehicle simulation, and energy management systems for electric mobility solutions.</p><h3>Disclaimer</h3><p>As of writing this article, the outlined approach is in a conceptual state and has not yet been validated against real-world vehicle data. In a simulated environment, the results look very plausible, though.</p><p>I’m also no physicist, and therefore, don’t blindly trust my assumptions and calculations, although they already passed a first internal review.</p><h3>Feedback and contact</h3><p>Please let me know if you would like me to write more about e-mobility and smart charging topics. Positive or constructive feedback in the comments section is always welcome, and leave a few claps if you liked it.</p><p>Want to work with me and my colleagues on smart charging solutions? Just contact me or visit <a href="https://www.smartgrid-comsystoreply.de/">smartgrid-comsystoreply.de</a>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*7EqG6XFSAfbCOxP78mfShQ.png" /></figure><h3>References</h3><p>[1] Manhatten Distance,<a href="https://en.wikipedia.org/wiki/Taxicab_geometry">https://en.wikipedia.org/wiki/Taxicab_geometry</a><br>[2] Haversine Formula,<a href="https://en.wikipedia.org/wiki/Haversine_formula">https://en.wikipedia.org/wiki/Haversine_formula</a><br>[3] Euclidean Distance,<a href="https://en.wikipedia.org/wiki/Euclidean_distance">https://en.wikipedia.org/wiki/Euclidean_distance</a><br>[4] Distance (graph theory),<a href="https://en.wikipedia.org/wiki/Distance_(graph_theory)">https://en.wikipedia.org/wiki/Distance_(graph_theory)</a><br>[5] Regenerative Braking, <a href="https://en.wikipedia.org/wiki/Regenerative_braking">https://en.wikipedia.org/wiki/Regenerative_braking</a><br>[6] Where the Energy Goes: Gasoline Vehicles, <a href="https://www.fueleconomy.gov/feg/atv-ev.shtml">https://www.fueleconomy.gov/feg/atv-ev.shtml</a><br>[7] Where the Energy Goes: Electric Cars, <a href="https://www.fueleconomy.gov/feg/atv.shtml">https://www.fueleconomy.gov/feg/atv.shtml</a><br>[8] Velocity, <a href="https://en.wikipedia.org/wiki/Velocity">https://en.wikipedia.org/wiki/Velocity</a><br>[9] Kinetic Energy, <a href="https://en.wikipedia.org/wiki/Kinetic_energy">https://en.wikipedia.org/wiki/Kinetic_energy</a><br>[10] Dot Product, <a href="https://en.wikipedia.org/wiki/Dot_product">https://en.wikipedia.org/wiki/Dot_product</a><br>[11] Joule, <a href="https://en.wikipedia.org/wiki/Joule">https://en.wikipedia.org/wiki/Joule</a><br>[12] Work (physics), <a href="https://en.wikipedia.org/wiki/Work_(physics)">https://en.wikipedia.org/wiki/Work_(physics)</a><br>[13] The experimentally and numerically determination of the drag coefficient of a bus model, https://<br>dergipark.org.tr/tr/download/article-file/579107<br>[14] Tesla Model 3, <a href="https://en.wikipedia.org/wiki/Tesla_Model_3">https://en.wikipedia.org/wiki/Tesla_Model_3</a><br>[15] Inclined Plane, <a href="https://en.wikipedia.org/wiki/Inclined_plane">https://en.wikipedia.org/wiki/Inclined_plane</a><br>[16] Drag Equation,<a href="https://en.wikipedia.org/wiki/Drag_equation">https://en.wikipedia.org/wiki/Drag_equation</a><br>[17] Rolling resistance,<a href="https://en.wikipedia.org/wiki/Rolling_resistance">https://en.wikipedia.org/wiki/Rolling_resistance</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cba9c36d76c7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/flexible-ev-energy-consumption-estimation-approach-cba9c36d76c7">Flexible EV Energy Consumption Estimation Approach</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust Ownership — Animated Intro]]></title>
            <link>https://medium.com/comsystoreply/rust-ownership-animated-intro-4445e662a9ad?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/4445e662a9ad</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Tue, 08 Aug 2023 08:31:46 GMT</pubDate>
            <atom:updated>2023-08-08T08:31:46.056Z</atom:updated>
            <content:encoded><![CDATA[<h3>Rust Ownership — Animated Intro</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_49crmKTkjYrywqcxGeweQ.gif" /><figcaption>Ferris protecting your ownings.</figcaption></figure><p>The web is full of great content <a href="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html">explaining how and why to use the move &amp; borrow semantics</a> in Rust. But it is still hard to build an intuition for it.</p><p>Although it’s important<a href="https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy"> to struggle with abstract concepts to build the intuition</a>, I would still like to ease that struggle a tiny bit for you. — At least for the visual learners among you.</p><h3>Copy</h3><p>A copy can only happen with types that implement the <a href="https://doc.rust-lang.org/std/marker/trait.Copy.html">Copy trait</a>. If you don’t know what a trait is, <a href="https://doc.rust-lang.org/book/ch10-02-traits.html">read this</a>.</p><p>When a copyable value gets assigned to a new variable, it is simply copied.</p><pre>#[derive(Copy)] // ipmlement the Copy trait<br>struct Circle;  // define a type called Cirlcle<br><br>let purple = Circle;  // create a Circle instance and assign it to a variable<br>let green = purple;   // assign the value of `purple` to the variable `green`</pre><figure><img alt="A purple box appears, pointing to a blue circle. Then a green box appears, pointing to a copy of the blue circle." src="https://cdn-images-1.medium.com/max/800/1*oyfFCm20ywmcUULDGdPOpg.gif" /><figcaption>let green = purple; // copies the Circle instance</figcaption></figure><blockquote>Are you kidding!? … It’s ludicrous! … Do I really need to add Copy to all my types? … What about HUGE String instances? … I certainly don’t want to copy those around … Isn’t Rust supposed to be fast and memory efficient!?</blockquote><h3>Move</h3><p>Each value <a href="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#ownership-rules">must be “owned” by exactly one variable</a>.</p><p>If the type value cannot be copied, the value gets <em>moved</em> instead. As a side effect, the initial variable will lose access to the value and become useless.</p><pre>struct Circle; // define a type called Cirlcle, that does NOT implement Copy<br><br>let purple = Circle; // create a Circle instance and assign it to a variable.<br><br>let green = purple;  // assign the value of `purple` to the variable `green`<br>                     // from a point on, the `purple` variable can <br>                     // no longer be used.</pre><figure><img alt="A purple box appears, pointing to a blue circle. Then a green box appears.  The blue circles moves to the green box. Now, only the green box points to the blue circle." src="https://cdn-images-1.medium.com/max/800/1*nhfndS25KJ0Q5kysNZQsmg.gif" /><figcaption>let green = purple; // moves the Circle instance</figcaption></figure><p>Accessing the <em>purple</em> variable after moving its value to <em>green</em> would cause a compile error, <a href="https://doc.rust-lang.org/book/ch04-01-what-is-ownership.html#variables-and-data-interacting-with-move">as shown in the rust book</a>.</p><blockquote>Are you saying that … if a value does not implement Copy … and I pass it to a function as an argument … the function will eat my value … and it is lost forever? … hmm … maybe I could rescue that poor value by using it as return value …. but what about the actual return value?! … that is so silly … Rust just makes no sense!</blockquote><h3>Borrow</h3><p>Often, you would rather not copy or move a value, but still pass it along.</p><p>As a function argument, for example. After the function is done with your value, you want to continue using your variable and its value outside the function.</p><p>This is possible by creating a shared reference to the value, and passing that reference instead of the actual value along.</p><p>This is called <em>borrowing</em> in Rust.</p><p>You can create multiple shared references, also known as <em>borrows</em>, to the same value. That’<em>s</em> why they are “shared”.</p><p>There is a major disadvantage, though. <br>As long as a shared reference to a value exists, it cannot be mutated or moved.</p><p>As soon as all Borrows are gone, the initial owning variable gets the full control back.</p><pre>struct Circle; <br><br>let purple = Circle;<br><br>fn fancy_function(green: &amp;Circle){<br>  // do something with borrowed value until the function ends.<br>}<br><br>// the value of purple get&#39;s borrowed with &amp; and assigned to the parameter<br>// of the fancy_function named &quot;green&quot;.<br>fancy_function(&amp;purple);</pre><figure><img alt="A purple box points to a blue circle. Then the Green box also points to the same blue circle. The connections change from black to grey. The green box then vanishes, and only the purple box points to the circle again. The remaining connection switches back from grey to black." src="https://cdn-images-1.medium.com/max/800/1*E3qFYBFNi_ptNrxH3C3B-w.gif" /><figcaption>fancy_function(&amp;purple); // borrows the Circle instance</figcaption></figure><blockquote>Alright … alright! But what if I want to mutate my value in the function. Let’s say … I wish to change the diameter of the circle! … What should I do?</blockquote><h3>Mutable Borrow</h3><p>In other cases, you want write-access to a value without copying or moving it. The shared borrow with ampersand (&amp;) won’t help you here, since it will make the value read-only as long a borrow exists.</p><blockquote>Arghh … This whole topic suddenly becomes existential! … What does it mean to exist? … Is living and existing the same? … Does the start and end of existence define someone&#39;s lifetime? … Lifetimes … damn … that’s another perplexing Rust concept I need to learn soon… enough! … I need to concentrate! … Back to mutable borrows!</blockquote><p>For these cases, Rust offers you mutable borrows (&amp;mut). Unlike with shared borrows, you are not allowed to have any additional borrow to that value. Even the originally owning variable is not allowed to read or mutate the value, as long as the mutable borrow exists.</p><pre>struct Circle{diameter: u32};<br><br>let purple = Circle{diameter: 5};<br><br>fn fancy_function(green: &amp;mut Circle){<br>  green.diameter = 10;<br>  // at the end of this function, &quot;green&quot; ceases to exist<br>}<br><br>// the value of purple get&#39;s borrowed with mut&amp; and assigned to the parameter<br>// of the fancy_function named &quot;green&quot;.<br>fancy_function(&amp;mut purple);</pre><figure><img alt="A purple box points to a blue circle. Then the Green box also points to the same blue circle. The purple connection disappears. The green box then vanishes, and only the purple box points to the circle again. The connection between the purple box and the circle reappears." src="https://cdn-images-1.medium.com/max/800/1*h7m4ejDVjc5NhSPtvgye_A.gif" /><figcaption>fancy_function(mut&amp; purple); // borrows the Circle instance mutably</figcaption></figure><blockquote>but … but … what if … I really … really … really! … want multiple shared references to a value that allow mutability! … This crazy language is soooo … restrictive!</blockquote><h3>Smart Pointers</h3><p>For most cases, copy, move, shared and mutable references are everything you need. They have been carefully designed and restricted so that a large amount of common programming mistakes are more or less impossible.</p><p>For cases where you require additional flexibility and capabilities for your references, Rust got some remarkable <a href="https://doc.rust-lang.org/book/ch15-00-smart-pointers.html">smart pointer types</a> for you. They are safe to use, too.</p><blockquote>Ok … I guess … I will go now, … and skim through the smart pointer documentation on my own. … Let’s see what other pointer types are out there, … just in case I need them in the future.</blockquote><blockquote>See u later alligator! … and sorry for the bad attitude.</blockquote><h3>Outro</h3><h4>Share the Animations</h4><p>If you think that the animations in this article are useful, just copy and share them. I release them under the <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA 4.0 licence</a>.</p><h4>Feedback and contact</h4><p>Please let me know if you would like me to write more articles like this about Rust. Positive or constructive feedback in the comments section is always welcome, and please leave a few claps if you liked it.</p><p>You can also find me on <a href="https://www.linkedin.com/in/mohammed-el-batya-957209237/">LinkedIn</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4445e662a9ad" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/rust-ownership-animated-intro-4445e662a9ad">Rust Ownership — Animated Intro</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Excel-lent News: Our First Rust Contribution]]></title>
            <link>https://medium.com/comsystoreply/excel-lent-news-our-first-rust-contribution-22d366571a2?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/22d366571a2</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[rust-programming-language]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[open-source-contribution]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Wed, 19 Jul 2023 11:31:41 GMT</pubDate>
            <atom:updated>2023-07-19T11:31:41.075Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mtkcfnCfPnCBsoQ6_vwaTg.gif" /><figcaption>Comsysto Reply ♥ Rust</figcaption></figure><h3>We ♥ Rust</h3><p>It’s a small step for the Rust community but a giant leap for our company, Comsysto Reply. A few days ago, we submitted our <a href="https://github.com/tafia/calamine/pull/330">first contribution</a> to a Rust library (<a href="https://crates.io/crates/calamine">calamine</a>), and it got approved.</p><p>As a company with a focus on JVM-based programming languages and JavaScript/TypeScript, this may not be evident. Java and Kotlin with Spring are our core pillars for backend development, and for the frontend, Flutter, React, or Angular are our frameworks of choice.</p><p>However, some of us fell in love with the Rust programming language and its remarkable community. Moreover, as a company, we decided to trial Rust and its ecosystem to explore its potential.</p><p>Where does Rust fit into our portfolio? What kind of projects should we tackle with Rust? What clients would be interested in using Rust?</p><p>The truth is, we are still trying to figure this out. But the potential is there! That’s why a team of passionate Rust developers at our company has formed to prepare for the day when we have the answers to those questions. We want to build a proven track record of hands-on Rust experience and be on par with our current core technologies in terms of professionalism.</p><p>To do so, we have started a few internal Rust projects. While I cannot disclose them in detail, I can tell you that one project is about automating some internal processes, and another project involves building a simulation framework using the entity component system (ECS) paradigm.</p><h3>The challenge</h3><p>Working on these projects, which have actual business value, allows us to acquire the critical Rust experience required at the professional level that we and our clients expect. It’s always a good start to follow a tutorial or build a proof of concept. Only working on real projects, however, with deadlines, maintenance needs, updates, refactoring, documentation, thorough testing, and delivery can teach us the valuable lessons necessary to achieve the professionalism we strive for.</p><p>While working on the tool that automates an internal process, we encountered an issue with parsing Excel files. Surprisingly, all the Rust libraries we tested failed to read our specific Excel files. This felt quite odd since our files didn’t contain any fancy scripts or formulas, just a simple sheet with some values.</p><p>We were surprised by this issue and had to implement a clumsy workaround. We used LibreOffice to first convert the XLSX file to a CSV and then parsed that CSV file with Rust. This approach worked for a few months, but it felt dissatisfactory to our developer hearts.</p><h3>The solution</h3><p>Eventually, we reached a point where we couldn’t live with that burden and decided to understand the root cause of the problem. It took us a few hours to understand how XLSX files are structured in general. Then, we compared the internal structure and attributes of “good” vs. “bad” XLSX files until we found the difference causing the issue.</p><p>Without bothering you with details, the issue can be described as “missing r-attributes”. — <em>If you are interested in the details, we documented them </em><a href="https://github.com/tafia/calamine/pull/330"><em>here</em></a><em>.</em></p><p>As the next step, we decided to delve into the implementation details of the most popular spreadsheet parsing library in the Rust community (<a href="https://crates.io/crates/calamine">calamine</a>) to understand why it couldn’t handle missing r-attributes. To be honest, we weren’t confident if our Rust skills were advanced enough to understand the implementation details of such a codebase. But we love challenges!</p><p>It turned out that our efforts in reaching the “ultimate Rust professionalism” are slowly showing their effects. We not only understood what was going on, but also identified the actual issue and had an idea of how to fix it.</p><p>Thereafter, we spent a few more hours implementing the fix and writing a solid unit test. We wanted to ensure that we weren’t introducing any bugs with our solution.</p><p>All we had to do after that was to submit a well-documented pull request with a thorough problem analysis for the calamine maintainer to review and, hopefully, accept.</p><h3>The achievement</h3><p>Our pull request was accepted overnight without any remarks! It was our first contribution to an open-source Rust project — a milestone that made us really proud! 🎉</p><p>This achievement may sound insignificant to seasoned Rust veterans, but for us, it felt like a major milestone on our Rust journey.</p><p>It’s important for us to share this accomplishment with the world. If you’re curious about our journey, the “missing r-attributes” issue, or our pull request, please reach out or check the detailed description <a href="https://github.com/tafia/calamine/pull/330">here</a>.</p><p>If you would like to work with Comsysto Reply, just <a href="https://www.comsystoreply.com/contact">contact us</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22d366571a2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/excel-lent-news-our-first-rust-contribution-22d366571a2">Excel-lent News: Our First Rust Contribution</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smart charging in E-Mobility … explained]]></title>
            <link>https://medium.com/comsystoreply/smart-charging-in-e-mobility-explained-4241b4524ec1?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/4241b4524ec1</guid>
            <category><![CDATA[electric-vehicles]]></category>
            <category><![CDATA[electric-mobility]]></category>
            <category><![CDATA[smart-grid]]></category>
            <category><![CDATA[emobility]]></category>
            <category><![CDATA[smart-charging]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Thu, 04 May 2023 08:31:51 GMT</pubDate>
            <atom:updated>2023-05-04T08:31:51.925Z</atom:updated>
            <content:encoded><![CDATA[<h3>Smart charging in E-Mobility … explained</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zogoQfUyllMZ3gJq-H-P1A.gif" /></figure><p>Smart charging — the technology that promises to revolutionize the way we charge our e-vehicles. By leveraging connectivity and data, smart charging promises to optimize the charging process, improve cost efficiency, boost sustainability, and reduce the grid load. In this article, I’ll cover the foundations of smart charging, how it works, why it matters, and what the future holds.</p><h3>What is smart charging?</h3><p>Let’s take a look at the explanation from Wikipedia.</p><blockquote>Smart charging refers to a charging system where electric vehicles, charging stations and charging operators share data connections. Through smart charging, the charging stations may monitor, manage, and restrict the use of charging devices to optimize energy consumption.<em> </em><a href="https://en.wikipedia.org/wiki/Smart_charging"><em>wikipedia.com</em></a></blockquote><p>Don’t worry if this seems a bit unclear at first. I’ll break it down for you, step by step. However, I do need to make a little disclaimer before proceeding. An information website from the company Virta is referenced on Wikipedia as the source for the definition. While this is a good starting point for the purposes of this article, you should not take it as a universally applicable definition.</p><h4>Ingredients</h4><p>Let’s start with dissecting the first sentence of the definition.</p><blockquote>Smart charging refers to a charging system where <strong>electric vehicles</strong>, <strong>charging stations</strong> and <strong>charging operators</strong> share <strong>data connections</strong>.</blockquote><p>Essentially, this sentence lists the primary ingredients needed for a smart charging system. The most apparent ones are the<strong> electric vehicles</strong> themselves and the <strong>charging stations</strong>. A charging process can only occur once an electric vehicle is connected to a charging station, and it’s only at this point that smart charging strategies can be applied.</p><p>The term <strong>charging operators</strong> is quite ambiguous. I will understand it as all the companies involved in installing, managing and maintaining a charging station, but also providing payment and billing services. Typically, a <em>Charging Point Operator (CPO)</em> takes responsibility for the hardware installation and maintenance. Additionally, an <em>E-Mobility Service Provider (EMSP)</em> handles billing and integration into a larger network of charging stations. For this article, we don’t need to distinguish and can stick to the generic term <em>charging operator</em>.</p><p>The final pieces of the puzzle are the <strong>shared data connections</strong>. To implement an advanced smart charging system, information, and commands require to be exchanged between the electric vehicle, the charging station, and the charging operator. This includes retrieving and sharing information about the battery, the energy grid, planned routes, and other relevant factors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47dHZJ37WkCJoDvI35R-0g.png" /><figcaption>Ingredients of smart charging</figcaption></figure><h4>Capabilities</h4><p>Let’s turn our attention to the next part of the definition</p><blockquote>Through smart charging, the charging stations may <strong>monitor</strong>, <strong>manage</strong>, and <strong>restrict</strong> the use of charging devices (…)</blockquote><p>This statement outlines the essential capabilities that a charging system must possess to enable smart charging. <strong>Monitoring</strong> all relevant parameters is crucial for developing a smart charging plan and adapting it over time. These parameters could include the battery’s state of charge, the current electricity price, or the current energy grid load.</p><p>Furthermore, some means of <strong>managing and restricting</strong> the charging process need to be in place. The most fundamental one would be the capability to automatically start and stop the charging process while the charging plug is connected. This can happen based on a static time schedule, or in more advanced scenarios, dynamically controlled. Another one would be the capability to control the charging power and thus the charging speed.</p><p>According to the definition, the charging station is responsible for monitoring, managing, and restricting the charging process. However, I cannot entirely agree with this statement. Electric vehicles also have these capabilities. For example, an electric vehicle can use its battery management system to start and stop the charging process or reduce the charging speed. Reducing the charging speed is typically done when the battery is nearly full, allowing the remaining few percent to be gently charged while being easy on the battery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*grqb_SeKuEJyxs9luLwX3A.png" /><figcaption>Naive depiction of smart charging</figcaption></figure><h4>Objective</h4><p>The above definition concludes with a statement about the objective of smart charging.</p><blockquote>to optimize energy consumption.</blockquote><p>While this is an accurate description, it lacks specificity and begs the question: What are the specific goals of energy consumption optimization that smart charging seeks to achieve?</p><p>To answer this question, we must first explore the reasons why smart charging systems are necessary.</p><h3>Why smart charging?</h3><p>Smart charging technology is becoming increasingly important due to a variety of factors. In the following discussion, I will outline the most significant factors and provide visual examples of how smart charging can be beneficial. Before we delve into these factors, however, it’s necessary to establish a basic scenario that will serve as a foundation for our discussion.</p><p>When discussing smart charging, people often do have the following idealized scenario in their mind: a commuter drives to work in the morning, spends most of the day there, drives home in the late afternoon, charges the car overnight at home, and drives to work the next day. While this is a narrow viewpoint that doesn’t accurately represent most drivers, it is a useful model I will use for explaining the major optimization goals of smart charging systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*6LQu7IjHZRx5tuhvbDE1Sw.gif" /><figcaption>Basic scenario.</figcaption></figure><h4>Time-of-use electricity pricing</h4><p>Time-of-use electricity pricing is a pricing strategy used by electricity providers, where the price of electricity varies based on the time of day. Typically, during periods of low demand, such as at night or on weekends, electricity is priced lower than during peak demand periods, such as during the day or on weekdays. This pricing strategy is used to encourage consumers to shift their electricity usage to off-peak periods, thereby reducing the strain on the electricity grid during peak periods. By using electricity during off-peak periods, consumers can potentially save money on their electricity bills, while also helping to balance the electricity grid and reduce the need for additional power plants.</p><p>Let’s assume, for our basic scenario, that there is a simple daytime / nighttime tariff. You can see in the following visualization, without smart charging, that the charging process finishes right before the cheaper nighttime tariff starts. This is especially unfortunate, since the car will stay plugged in during the whole night, having more than enough time to fully charge at the cheaper nighttime price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*oBiL9Nj5PmXhRoIFBckNXg.gif" /><figcaption>Charging right away, not waiting for the lower nighttime tariff.</figcaption></figure><p>With a smart charging system in place, optimizing for cost savings, the charging process could be delayed a little bit. Although the vehicle is being immediately plugged in when the driver comes home, the charging process should not start right away. Instead, a smart charging system would know about the soon approaching nighttime tariff and starts charging as soon as the nighttime tariff becomes active. Watch the following visualization to see how it would affect the previous model scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*aqmbgUYYSOFfZXjJkv2IjA.gif" /><figcaption>Waiting for the lower nighttime tariff before start charging.</figcaption></figure><h4>Real-time electricity pricing</h4><p>Real-time electricity pricing refers to a pricing model where the cost of electricity is adjusted in real-time based on the current supply and demand of electricity. This allows for more accurate pricing that reflects the current market conditions. Real-time pricing is made possible through the use of smart grid technology, which enables real-time monitoring and management of the electricity grid.</p><p>The time-of-use electricity pricing strategy can be leveraged by a basic, manually configured charging time-schedule. Real-time electricity pricing, on the other hand, with its unpredictable nature, can only be leveraged by an advanced smart charging system. The system needs to continuously monitor the ever-changing electricity prices and manage the charging process. Most simply, the driver could define a price threshold, where charging is only allowed when the price is below that threshold. The following visualization helps you to understand how this would work in our model scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*HumWRwei18aPol8jlOyo5w.gif" /><figcaption>Electricity plan with real-time pricing. Charge only when price is low.</figcaption></figure><h4>Green energy</h4><p>When drivers opt for an e-vehicle, they are essentially turning their back on fossil fuels. However, the electricity used to power the vehicle can still be sourced from non-sustainable energy sources. Even though a driver would prefer green energy, it might not be always available. Solar and wind energy, which are the most promising green energy sources, are notoriously unreliable by nature.</p><p>To counter this, energy providers offer an energy mix of brown and green energy, which can even change throughout the day. This mix also determines the carbon footprint of the available electricity. Smart charging technology can be used to maximize the usage of green energy sources and minimize the carbon footprint associated with charging a battery. Similar to the price optimization, this can happen based on a time-schedule or in real-time, depending on the drivers’ electricity plan.</p><p>Let’s see what happens to the model scenario, when we now optimize for green energy yield, instead of the lowest price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*wHpKdszMpWFyZZbOuOY4rA.gif" /><figcaption>Only charging when wind energy is available.</figcaption></figure><h4>Grid load reduction</h4><p>Our current electricity grid has been built over the course of several decades, organically growing alongside city populations. Its primary purpose is to provide energy for households and a few industrial “power users” <em>(pun intended)</em>. However, with the sudden rise of e-mobility, the grid is facing a challenge. Charging an electric vehicle can require more than twice the power of a typical household during peak times, which usually occurs around 6 PM, when everyone is back from work or school and using appliances. If everyone on the street or in a high-rise building starts charging their electric vehicles at the same time, the grid would be overwhelmed, requiring a delivery of a multiple of its initial power capacity. Electricity companies incentivize consumers to use electricity during off-peak times to balance the load, but this pricing mechanism is unlikely to solve all grid load issues. What if, for example, all car owners in a street aren&#39;t concerned with higher electricity prices. Another example could be a fleet of cab drivers, right before a big event, wanting to have a full charge, no matter what.</p><p>Therefore, a smart charging mechanism is necessary to manage the charging process based on the actual grid load. For instance, it could decrease the charging speed when the grid is stressed, or postpone the charging process until the load falls below a specified threshold. However, this mechanism does not directly benefit car owners (except for avoiding an electricity outage) and thus cannot be expected to be used by them voluntarily. Therefore, it needs to be implemented on the charging station and charging operator side in cooperation with the electricity provider.</p><p>The following visualization applies such a mechanism to our model scenario. You can see how the charging process starts after the peak load has passed. In addition, the charging speed gets reduced.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*yn70jrfmk45ZEcGXQg-Grg.gif" /><figcaption>Start charging with reduced speed when peak load is over.</figcaption></figure><h4>Active grid support</h4><p>Avoiding charging during peak times, as described above, is a passive way to help stabilize the grid. However, there is also an active way to support the grid, by using electric vehicles as temporary energy storage for the electricity grid when the car is not being used. This requires the car and the charging station to be capable of bidirectional charging. The basic idea is that electricity can not only flow from the grid into the battery, but also from the battery back into the grid. This enables many interesting use-cases for electricity companies and opportunities for car owners to benefit financially.</p><p>One use case is the storage of green energy when there is an excess of supply compared to demand. For instance, when there is plenty of wind energy available but no demand for it, wind turbines must be temporarily shut down. With smart charging, electric cars could store this surplus wind energy and feed it back to the grid during times of high demand for green energy. The car owner would, of course, be compensated for this service.</p><p>Another use case is to store electricity during low demand periods, preferably from renewable sources, and subsequently release it back into the grid during periods of high demand when the grid is under pressure. This is particularly significant in a future where bidirectional charging is widely adopted, and electric vehicles are prevalent. Such a decentralized grid buffering mechanism would be very effective in stabilizing the grid, and could help to mitigate peaks at the location where load stress is most severe. To illustrate, imagine a scenario where a car park is experiencing a high load peak due to fast charging. Other electric cars that are already fully charged could contribute a small portion of their battery storage to smooth out the peak, easing the local grid pressure, and then gradually recharge their batteries once the fast charging has completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*HYDLqwuNgBmIchYaNCAJtA.gif" /><figcaption>Fully charged cars, actively supporting the grid.</figcaption></figure><h4>Readiness and reach</h4><p>In the previous sections, we discussed the most urgent reasons for implementing smart charging systems. Based on these reasons, we can identify the major optimization goals for smart charging systems. These goals are reducing the cost of charging, maximizing the use of renewable energy, and reducing the strain on the electricity grid.</p><p>However, there is one optimization goal that has not yet been mentioned. As you know, there is no such thing as a free lunch. In pursuit of the above optimization goals, both electricity companies and car owners will have to make certain sacrifices. For electricity companies, the solution is quite apparent. They can offer drivers some kind of financial benefit, either in the form of reduced electricity prices or payment for feeding electricity back into the grid.</p><p>The car owners, on the other hand, will have to give up some degree of mobility in exchange. Specifically, this means reducing the likelihood of the car being ready and having enough range for an unexpected trip. This is especially true for unplanned trips. Consider a nearly empty electric vehicle waiting 5 hours to begin charging, to take advantage of the cheaper nighttime energy rate. During those five hours, the car would essentially be unusable, as it would have virtually no range. While this trade-off may be acceptable to some, others may not find it worth it. Each driver will have to make individual decisions about what trade-offs they are willing to accept, depending on the date, time, and other factors. In the above example, a car owner might decide to compromise by charging the car to 40% state of charge immediately at any cost, and then waiting until nighttime to charge the remaining 60%.</p><p>This implies that readiness and range must be another key optimization goal, acting as a counterbalance to the other optimization goals.</p><h4>Optimization goals</h4><p>We can now answer the question from earlier:</p><blockquote>What are the specific goals of energy consumption optimization that smart charging seeks to achieve?</blockquote><p>The major energy consumption optimization goals are a) reducing the cost of charging, b) maximizing the use of green energy and c) reducing the load on the electricity grid. Additionally, a smart charging system needs to optimize for mobility in the form of d) readiness and reach for expected and unexpected trips.</p><h3>Summary</h3><p>You should now have a basic understanding of what smart charging is and why it is needed. We also covered the main motivations for electricity companies and car owners to use a smart charging system. From those motivations, we derived the major optimization goals, a smart charging system needs to strive for. We have further implied that smart charging systems will basically introduce a market-place-like mechanism where e-mobility car owners can exchange potential mobility for something else like a financial benefit or an ecological conscience.</p><p>Be aware that we discussed smart charging on a quite abstract level, with the aim of understanding the basics. We discussed a basic model scenario. We also discussed each optimization goal isolated from the others, without any interactions or side effects. Furthermore, we didn’t look at any technological, infrastructural, economic, or socio-economical challenges that need to be addressed when planning and implementing advanced smart charging solutions.</p><h3>Feedback and contact</h3><p>Please let me know if you would like me to write an article about more advanced smart charging topics. Positive or constructive feedback in the comments section is always welcome, and leave a few claps if you liked it.</p><p>Want to work with me and my colleagues on smart charging solutions? Just contact me or visit <a href="https://www.smartgrid-comsystoreply.de/">smartgrid-comsystoreply.de</a>!</p><h3>TL;DR</h3><ul><li>Smart charging is about monitoring, managing, and restricting the charging process of e-vehicles to optimize energy consumption.</li><li>Goals for smart charging are<br>— reducing the cost of charging<br>— maximizing the use of green energy <br>— reducing the load on the electricity grid <br>— ensuring readiness and reach for expected and unexpected trips</li><li>Goals will be conflicting and compromises need to be made.</li><li>With smart charging, potential mobility becomes a commodity.</li></ul><p>Passion, friendship, honesty, curiosity. If this appeals to you, Comsysto may well be your future. <a href="https://www.comsystoreply.de/career">Apply now to join us!</a></p><p>This blog post is published by <a href="https://legal.comsysto.com/comsystoreply.de/en/impressum/">Comsysto Reply GmbH</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4241b4524ec1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/comsystoreply/smart-charging-in-e-mobility-explained-4241b4524ec1">Smart charging in E-Mobility … explained</a> was originally published in <a href="https://medium.com/comsystoreply">comsystoreply</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tricking Fitbit into Counting 700 Floors in One Day]]></title>
            <link>https://forgemo.medium.com/tricking-fitbit-to-count-700-floors-in-one-day-d954b314504d?source=rss-e61312835e59------2</link>
            <guid isPermaLink="false">https://medium.com/p/d954b314504d</guid>
            <category><![CDATA[weather]]></category>
            <category><![CDATA[fitbit]]></category>
            <category><![CDATA[fitness-trackers]]></category>
            <category><![CDATA[wearables]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Mohammed El Batya]]></dc:creator>
            <pubDate>Tue, 17 Jul 2018 12:59:56 GMT</pubDate>
            <atom:updated>2018-07-17T14:02:37.156Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4u9uVrTMLAK2IN11" /><figcaption>Photo by <a href="https://unsplash.com/@david__r?utm_source=medium&amp;utm_medium=referral">David Rodrigo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>This story happened to me in 2015 while wearing a <em>Fitbit Charge HR</em> fitness tracker. In the meantime, I switched to the newer <em>Fitbit Charge HR 2. </em>Although I haven’t tested this trick with the new version, it is probably still working. I would even say, this works with most if not all ‘floor counting’ fitness devices.</p><h4>What is this all about?!</h4><p>Those fitness tracker devices try to measure your daily activity and overall fitness level.</p><p>Since it’s not really possible to look into somebodies actual fitness level, those devices measure health related indicators. Common examples are how many steps a person has walked or how the heart rate behaves while performing different activities.</p><p>In our case, however, we’ll focus solely on the <em>count of floors</em> a person has climbed upwards.</p><p>To further motivate the users, companies like Fitbit tend to build a community system around their products. Part of Fitbit’s community system are badges you can achieve by hitting some milestones.</p><p>This is the story of how I managed to climb 700 Floors without actually climbing 700 Floors, earning the following precious batch. (It is in German, due to my default language settings).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUGjHnQ5iOz7vJGWrmT4SA.jpeg" /></figure><p>Just for reference how insane this is. At least for somebody like me, whose fitness level could be described as ‘average’.</p><p>The tallest building in the world is right now <em>The Burj Khalifa </em>with 163<em> floors</em> above the ground<em>. </em>Therefore, my 700 floors batch tells the community that I climbed an equivalent of 4–5 times the tallest building in the world in one single day!</p><p>Quite impressive, isn’t it? Especially to people that know me in real life.</p><h4>How does Fitbit track floors?</h4><p>As you probably know, all fitness trackers contain at least a movement sensor. This sensor detects specific movement patterns and the software decides “Yes, this was a step … let’s increase the overall step count.”</p><p>But how to distinguish a step on a normal street from stepping upwards on stairs or a hill?</p><p>By only using a movement sensor, this is quite impossible to do reliably. The movement differences are just to subtle. Thus, Fitbit has also integrated a second sensor to help out with this task. This is no secret and they are fairly open on it. Their FAQs state:</p><blockquote>Fitbit devices that count floors have an altimeter sensor that can detect when you’re going up or down in elevation. Your device registers one floor when you climb about 10 feet at one time. It does not register floors when you go down.</blockquote><p>They further state:</p><blockquote>Fitbit devices do not count the elevation gains simulated from a StairMaster, inclined treadmill, or other stationary exercise equipment. Your device uses changes in barometric pressure to detect elevation change, and therefore requires that you physically change elevation in order to properly record floors.</blockquote><h4>The facts</h4><p>Let’s collect interesting facts we just accuired.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UC7rOvZamXXb7LzV" /><figcaption>“A person reading a book with a magnifying glass and a pen in hand” by <a href="https://unsplash.com/@joaosilas?utm_source=medium&amp;utm_medium=referral">João Silas</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><ol><li>An altimeter sensor is used to detect changes in barometric pressure</li><li>Only upwards movement is tracked</li></ol><p>We can further deduce that a combination of barometric pressure change and actual physical movement is required to increase the floor count. Why? Think about using an elevator in a tall building. If only the pressure change is counted, every ride in an elevator would heavily distort the floor count.</p><p>Somebody might suggest now: ‘Let’s walk in circles while using an elevator!’ You can try it, but I couldn’t make it work. I guess that the barometric pressure is changing in an elevator way to quick for Fitbit to fall for it.</p><p>Since Fitbit only counts upward movement and barometric pressure decreases with rising altitude, we are only interested in falling barometric pressures.</p><p>Let’s update our list:</p><ol><li>A decreasing barometric pressure, combined with physical movement is required</li><li>The pressure must decrease in a ‘humanly possible&#39; speed</li></ol><h4>The Trick</h4><p>We don’t want to climb any hills or stairs for that precious 700 floors badge. A long walk, however, is fine.</p><p>Therefore, we need to find a way for manipulating our surrounding air pressure while talking a loooong walk. That way, we coud trick Fitbit into counting these steps as upward movement instead of simple forward movement.</p><p>But how to manipulate air pressure on the streets while talking a walk?!</p><p>This is a nearly impossible task! At least for us mere humans! Mother nature got you covered, though.</p><p>When weather changes from ‘good’ to ‘stormy’ the air pressure tends to fall. Or it will at least dynamically rise and fall over a given period. This phenomenon is what we want! Just take a long walk while a storm is arriving.</p><p>On one day, after work, I saw on the weather map a summer storm making its way to my location! I went out and walked for about 2 hours straight from work to home and it worked.</p><p>That’s it! That was the trick!</p><p>When I arrived at home, I had reached 700 floors and earned a shiny new rainbow batch! ☺</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JV5OVm2muvVnkHeW" /><figcaption>Photo by <a href="https://unsplash.com/@akovacsa?utm_source=medium&amp;utm_medium=referral">Andras Kovacs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4>Disclaimer</h4><p>Please take care and use your brain when taking a walk during a storm. Don’t risk your health for a silly batch!</p><p>I think that cheating is in general a bad thing and the badges should be earned in an honest way.</p><p>I, however, also like to understand things … and that is what this article is about. Understanding!</p><h4>TL;DR</h4><p>Take a long walk when a storm is going to arrive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d954b314504d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>