-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question regarding run time (and memory usage) improvements for high-resolution time simulation. #108
Comments
To improve the performance, you can pass a function with the time-varying current instead of starting and stopping the simulation. First, create an interpolation object of your time-series data using the t = collect(0:1:3600)
I = ones(length(t))
using Interpolations
itp = linear_interpolation(t, I; extrapolation_bc=Throw())
I_func(t) = itp(t)
@time sol = simulate(p, 3600; I=I_func, tdiscon=t, SOC=0, maxiters = 100_000) julia> @time sol = simulate(p, 3600; I=I_func, tdiscon=t, SOC=0, maxiters = 100_000)
0.132629 seconds (58.84 k allocations: 2.241 MiB) I would not recommend using a piecewise constant input for For more information on variable inputs, see https://github.com/MarcBerliner/PETLION.jl/blob/master/examples/variable_input_functions.ipynb |
Thank you very much for your answer and please excuse my late response. I had read the examples before and passing a time-varying function was considered. However my problem has a slightly different nature. I am trying to develop charging strategies by analysing closed loop systems, where I provide a current for a short timescale and derive voltage and aging related measurements (SOH, c_e, j_s, film, etc.) which influence the current for the next timesteps. So passing time-varying functions would help me validate the results, but I was wondering if PETLION could also be used as the system model. |
Good evening all, I have a similar question as @androlos and I would love to know if there is a solution. I am working on a battery pack model where the degradation is calculated for cells and cell zones within the pack. Because I want to include the cell interactions and the thermal management, I want to step the battery simulation myself. I really love the speed and simplicity of the PETLION package but when I step the simulation through time manually (like suggested by @androlos ) the simulation gets slow. What would be your suggestion on how to approach this? Would love to use your package and get involved. |
As there is no Discussion Tab, I post my question as an Issue (I hope this is ok, as it has been done before).
I am currently trying to simulate every second of a charging procedure separately. This comes with an about 360x longer runtime and a lot more memory usage.
Is there currently a way to do this faster and a way to deal with the excessive memory use?
The text was updated successfully, but these errors were encountered: