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

LFPO cell expansion #44

Open
DarioSlaifsteinSk opened this issue Mar 6, 2024 · 1 comment
Open

LFPO cell expansion #44

DarioSlaifsteinSk opened this issue Mar 6, 2024 · 1 comment

Comments

@DarioSlaifsteinSk
Copy link

Hi,
I'm trying to simulate LFPO cells with LiiBRA but I'm getting an error on the output.
I've made a custom parameter set based on the Prada (2013) paper and PyBaMM and saved it on my local repo.
Here's my MWE:

Sₑ = 4 # Spatial points in electrolyte
Sₛ = 2 # Spatial point in solid
Cell = Construct("A123")
Spatial!(Cell, Sₑ, Sₛ)
Cell.RA.Fs = 4.0 # Modify transfer function sampling frequency
Cell.RA.SamplingT = 0.25 # Modify final system sampling period
# Cell.Neg.Ds = 2.0e-14 # Modify negative electrode diffusion constant
Cell.Const.T = 298.15 # Modify cell temperature= collect(1.0:-0.2:0) # List of SOC points for model generation

#---------- Generate & Simulate Model -----------------#
A, B, C, D = Realise(Cell, Ŝ)
Results, tₑ = HPPC(Cell, Ŝ, SoC0, 5.0, -3.0, A, B, C, D);

Fortunately, this works perfectly.
but, here's the catch:

julia> Results.Cell_V:
401×1 Matrix{Float64}:
 NaN
 NaN
 NaN
 NaN
   
 NaN
 NaN
 NaN
 NaN

which stems from:

julia> Results.ϕ_ẽ1
401×3 Matrix{Float64}:
 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN
   
 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN
 NaN  NaN  NaN

julia> Results.y
401×21 Matrix{Float64}:
 0.0       0.0       0.0       0.0      NaN  NaN     0.0          0.0          0.0         0.0
 0.0       0.0       0.0       0.0      NaN  NaN      0.0          0.0          0.0         0.0
 0.0       0.0       0.0       0.0      NaN  NaN      2.39533e-5   2.50955e-5   0.0493683   0.0517224        
 3.92683  -1.17373  -2.03563  -2.51096  NaN  NaN      2.39533e-5   2.50955e-5   0.0493687   0.0517229        
                                                                                         
 1.67322  -3.23011  -6.47773  -7.00319  NaN  NaN     -2.55205e-11  5.12697e-11  1.74443e-6  1.74842e-6       
 1.70846  -3.23473  -6.4838   -7.0128   NaN  NaN     -2.54606e-11  5.11494e-11  1.75177e-6  1.75575e-6       
 1.74285  -3.23918  -6.4896   -7.02204  NaN  NaN     -2.54007e-11  5.10292e-11  1.7589e-6   1.76288e-6       
 1.77642  -3.24347  -6.49513  -7.03094  NaN  NaN    -2.5341e-11   5.09091e-11  1.76583e-6  1.76981e-6  

I've tried to check the SS matrices but I haven't found anything meaningful. Here's a screenshot of the eigen values of A
image
Needless to say that the same piece of code works with the "LG M50" cell.
Any ideas?

@DarioSlaifsteinSk
Copy link
Author

well the problem is in Simulate.jl and how it recalculated D.
I forked the repo and changed the lines

# Relinearise dependent on ν, σ, κ
D = D_Linear(Cell, ν_neg, ν_pos, σ_eff_Neg, κ_eff_Neg, σ_eff_Pos, κ_eff_Pos, κ_eff_Sep)

to

D = interp(D₀,SList,Results.Cell_SOC[i+1])

Why do you think its crashing? I'm gonna open a pull request with the Prada (2013) dataset and we can go over it there.

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

1 participant