Skip to content

Commit

Permalink
Merge pull request #1 from cbm755/comment_parameters
Browse files Browse the repository at this point in the history
Start commenting what each parameter is
  • Loading branch information
hanrach committed Aug 13, 2021
2 parents cfc650c + 58dea4f commit 00f817e
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@

from utils.unpack import unpack_fast
from utils.derivatives import partials, compute_jac
from utils.precompute_c import precompute
from utils.precompute_c import precompute
16 changes: 11 additions & 5 deletions examples/main_decoupled.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,26 @@
from utils.unpack import unpack_fast
from decoupled.init import p2d_init_fast
from decoupled.p2d_main_fast_fn import p2d_fast_fn_short

# Number of points in each battery section
Np = 10
Nn = 10
Mp = 10
Ms = 10
Mn = 10
Nn = Np
Mp = Np
Ms = Np
Mn = Np
Ma = 12
Mz = 12

# Time-step size
delta_t = 10

# Applied current
Iapp = -30

fn, jac_fn = p2d_init_fast(Np, Nn, Mp, Mn, Ms, Ma,Mz,delta_t, Iapp)
U_fast, cmat_pe, cmat_ne, voltages, temps,time = p2d_fast_fn_short(Np, Nn, Mp, Mn, Ms, Ma, Mz, delta_t, fn, jac_fn, Iapp, 100)

uvec_pe, Tvec_pe, phie_pe, phis_pe, \
uvec_ne, Tvec_ne, phie_ne, phis_ne,\
uvec_sep, Tvec_sep, phie_sep, Tvec_acc, Tvec_zcc,\
j_pe, eta_pe, j_ne, eta_ne = unpack_fast(U_fast,Mp, Np, Mn, Nn, Ms, Ma, Mz)

16 changes: 12 additions & 4 deletions examples/main_naive.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@
from naive.init import p2d_init_slow
from naive.p2d_main_fn import p2d_fn_short

# Number of points in each battery section
Np = 10
Nn = 10
Mp = 10
Ms = 10
Mn = 10
Nn = Np
Mp = Np
Ms = Np
Mn = Np
Ma = 12
Mz = 12

# Time-step size
delta_t = 10

# Applied current
Iapp = -30

delta_t = 10
Iapp = -30
fn, jac_fn = p2d_init_slow(Np, Nn, Mp, Mn, Ms, Ma, Mz, delta_t, Iapp)
Expand Down
18 changes: 12 additions & 6 deletions examples/main_reorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@
from scikits.umfpack import splu
from reordered.p2d_reorder_fn import p2d_reorder_fn

# Number of points in each battery section
Np = 30
Nn = 30
Mp = 30
Ms = 30
Mn = 30
Ma = 30
Mz = 30
Nn = Np
Mp = Np
Ms = Np
Mn = Np
Ma = Np
Mz = Np

# Time-step size
delta_t = 10

# Applied current
Iapp = -30

peq, neq, sepq, accq, zccq = get_battery_sections(Np, Nn, Mp, Mn, Ms, Ma, Mz, delta_t, Iapp)
fn, _ = p2d_init_fast(Np, Nn, Mp, Mn, Ms, Ma, Mz, delta_t, Iapp)

Expand Down

0 comments on commit 00f817e

Please sign in to comment.