pybamm.
Simulation
(model, experiment=None, geometry=None, parameter_values=None, submesh_types=None, var_pts=None, spatial_methods=None, solver=None, quick_plot_vars=None, C_rate=None)[source]¶A Simulation class for easy building and running of PyBaMM simulations.
Parameters: |
|
---|
build
(check_model=True)[source]¶A method to build the model into a system of matrices and vectors suitable for performing numerical computations. If the model has already been built or solved then this function will have no effect. If you want to rebuild, first use “reset()”. This method will automatically set the parameters if they have not already been set.
Parameters: | check_model (bool, optional) – If True, model checks are performed after discretisation (see
pybamm.Discretisation.process_model() ). Default is True. |
---|
get_variable_array
(*variables)[source]¶A helper function to easily obtain a dictionary of arrays of values for a list of variables at the latest timestep.
Parameters: | variable (str) – The name of the variable/variables you wish to obtain the arrays for. |
---|---|
Returns: | variable_arrays – A dictionary of the variable names and their corresponding arrays. |
Return type: | dict |
plot
(quick_plot_vars=None, testing=False)[source]¶A method to quickly plot the outputs of the simulation.
Parameters: |
|
---|
set_defaults
()[source]¶A method to set all the simulation specs to default values for the supplied model.
set_parameters
()[source]¶A method to set the parameters in the model and the associated geometry. If the model has already been built or solved then this will first reset to the unprocessed state and then set the parameter values.
set_up_experiment
(model, experiment)[source]¶Set up a simulation to run with an experiment. This creates a dictionary of inputs (current/voltage/power, running time, stopping condition) for each operating condition in the experiment. The model will then be solved by integrating the model successively with each group of inputs, one group at a time.
solve
(t_eval=None, solver=None, external_variables=None, inputs=None, check_model=True)[source]¶A method to solve the model. This method will automatically build and set the model parameters if not already done so.
Parameters: |
|
---|
specs
(model_options=None, geometry=None, parameter_values=None, submesh_types=None, var_pts=None, spatial_methods=None, solver=None, quick_plot_vars=None, C_rate=None)[source]¶A method to set the various specs of the simulation. This method automatically resets the model after the new specs have been set.
Parameters: |
|
---|
step
(dt, solver=None, npts=2, external_variables=None, inputs=None, save=True)[source]¶A method to step the model forward one timestep. This method will automatically build and set the model parameters if not already done so.
Parameters: |
|
---|