Skip to content

Commit

Permalink
Merge pull request #171 from pybamm-team/dtype
Browse files Browse the repository at this point in the history
Use float32 for NumPy arrays
  • Loading branch information
TomTranter authored Jul 29, 2022
2 parents 306ef75 + 6bbcc88 commit 398e5b5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions liionpack/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,16 +336,16 @@ def solve(
self.Nvar = len(self.variable_names)

# Storage variables for simulation data
self.shm_i_app = np.zeros([self.Nsteps, self.Nspm], dtype=float)
self.shm_Ri = np.zeros([self.Nsteps, self.Nspm], dtype=float)
self.output = np.zeros([self.Nvar, self.Nsteps, self.Nspm], dtype=float)
self.shm_i_app = np.zeros([self.Nsteps, self.Nspm], dtype=np.float32)
self.shm_Ri = np.zeros([self.Nsteps, self.Nspm], dtype=np.float32)
self.output = np.zeros([self.Nvar, self.Nsteps, self.Nspm], dtype=np.float32)

# Initialize currents in battery models
self.shm_i_app[0, :] = I_batt * -1

# Step forward in time
self.V_terminal = np.zeros(self.Nsteps)
self.record_times = np.zeros(self.Nsteps)
self.V_terminal = np.zeros(self.Nsteps, dtype=np.float32)
self.record_times = np.zeros(self.Nsteps, dtype=np.float32)

self.v_cut_lower = parameter_values["Lower voltage cut-off [V]"]
self.v_cut_higher = parameter_values["Upper voltage cut-off [V]"]
Expand Down

0 comments on commit 398e5b5

Please sign in to comment.