forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardise BaseSolver.solve() multiprocessing context to
fork
(pyb…
…amm-team#3975) * Enforce multiprocessing context fork, add example & updt integration test * updt changelog * Add OS conditional context --------- Co-authored-by: Eric G. Kratz <[email protected]>
- Loading branch information
1 parent
f050d58
commit b068ba6
Showing
4 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pybamm | ||
import numpy as np | ||
|
||
# create the model | ||
model = pybamm.lithium_ion.DFN() | ||
|
||
# set the default model parameters | ||
param = model.default_parameter_values | ||
|
||
# change the current function to be an input parameter | ||
param["Current function [A]"] = "[input]" | ||
|
||
simulation = pybamm.Simulation(model, parameter_values=param) | ||
|
||
# solve the model at the given time points, passing multiple current values as inputs | ||
t_eval = np.linspace(0, 600, 300) | ||
inputs = [{"Current function [A]": x} for x in range(1, 3)] | ||
sol = simulation.solve(t_eval, inputs=inputs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters