Skip to content
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

How to catch the abnormal situation during battery operation by Petlion #103

Open
lico0001 opened this issue Apr 7, 2023 · 3 comments
Open

Comments

@lico0001
Copy link

lico0001 commented Apr 7, 2023

Hi MarcBerliner. I want to catch the outlier during battery operation, that is, if the temperature is set too high, the current and voltage will change abnormally during battery operation. BBut in my previous attempts, if I set it this way, the program would report an error. May I ask if this data can be obtained through Petlion? If so, is there a suitable example? Looking forward to your reply, thank you.

@MarcBerliner
Copy link
Owner

To clarify, is your simulation failing at high temperatures but you still want to receive the output?

@lico0001
Copy link
Author

Yes, but what I want to know more is how to get the outlier through the status of the Petlion battery crash.

@MarcBerliner
Copy link
Owner

This isn't explicitly accounted for, but there is a workaround. Say you want to run a CC-CV simulation

p = petlion(LCO)

sol = simulate(p, I=5, SOC=0)
simulate!(sol, p, V=:hold)

which crashes with the message

julia> ERROR: Model failed to converge at t = 101.5279999999999

To save the output, first initialize the solution object sol and enclose your simulation loop in a try/catch block. The solve still fails, but you can access the final states before failure.

sol = solution()

try
    simulate!(sol, p, I=5, SOC=0)
    simulate!(sol, p, V=:hold)
catch
    # input catch here
end
julia> PETLION simulation
 --------
 Run:     I
 Time:    485.27 s
 Current: 3.5487C
 Voltage: 4.3 V
 Power:   446.03 W/m²
 SOC:     0.6485
 Exit:    Above max. voltage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants