Best way to find the number of times a battery can be used before it must be charged?

8 views (last 30 days)
I have modeled a hydraulic pump which charges a gas-filled accumulator from 1400 psi up to 3200 psi. The pump is ran by a DC motor connected to a battery. I have a voltage vs state of charge (SOC) table from the battery manufacturer and have attempted to use the "Battery (Table-Based)" block in order to more accurately model the battery, as the voltage vs SOC curve in the standard "Battery" block has a very different shape than the manufacturer's data. The battery is 48V LiFePO4. The battery "basic characterstics" Voltage vs SOC plot for the "Battery (Table-Based)" block is as shown below. This closely follows the plot that I received from the manufacturer.
I would like to calculate the number of times that the accumulator can be charged from 1400 psi up to 3200 psi before the battery falls below 44V. I attempted to do this by using a "Stop Simulation" block which stops the simulation right before 3200 psi is reached. A "while" loop in a Matlab script to repeatedly run simulations with the final voltage of the previous simulation as the initial voltage of the new simulation, until the initial voltage is below 44V. To do this, I set the "Initial Target" for the "Terminal Voltage" field in the "Battery (Table-Based)" block to be the voltage at the final time step of the previous simulation.
Unfortunately, this doesn't seem to work reliably. On the first iteration, I receive the message "Warning: First solve for initial conditions failed to converge. Trying again with all high priorities relaxed to low." On the next two iterations, I receive the message that the battery internal voltage drop, motor current and battery terminal voltage targets all cannot be honored.
When I plot the battery voltage vs time, there are severe discontinuities in the data. (See attached plot.)
When I monitor the battery SOC and plot it vs the battery voltage, the result is a very strange plot.
In addition to the strange discontinuities, notice that the SOC never falls below 99.5% even though the voltage does reach 44V. Looking at the Voltage vs SOC charge from the battery manufacturer at the top of this post, the SOC should be at roughly 10% when the voltage drops to 44V.
What is the best way to accomplish what I'm trying to do here?
  5 Comments
Michael P
Michael P on 3 Jan 2025
Can this procedure be used to store a single state from a block as an operating point for the next run, or does this only work with saving the entire block state? For example, I only want to use the battery SOC and voltage for the subsequent simulation, but it seems that the operating point also saves the final current of the battery as a parameter to begin the subsequent simulation, which I do not want to do. (I want to start from 0 current at every simulation, but with the state of charge and voltage of the previous simulation.)
Is there some other way to do this?

Sign in to comment.

Answers (0)

Categories

Find more on Propulsion and Power Systems in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!