Simulation¶
- class pbeis.EISSimulation(model, parameter_values=None, geometry=None, submesh_types=None, var_pts=None, spatial_methods=None)¶
A Simulation class for easy building and running of PyBaMM EIS simulations using a frequency domain approach.
Parameters¶
- model
pybamm.BaseModel The model to be simulated
- parameter_values:
pybamm.ParameterValues(optional) Parameters and their corresponding numerical values.
- geometry:
pybamm.Geometry(optional) The geometry upon which to solve the model
- submesh_types: dict (optional)
A dictionary of the types of submesh to use on each subdomain
- var_pts: dict (optional)
A dictionary of the number of points used by each spatial variable
- spatial_methods: dict (optional)
A dictionary of the types of spatial method to use on each domain (e.g. pybamm.FiniteVolume)
- iterative_method(frequencies, method='prebicgstab')¶
Compute the impedance at the given frequencies by solving problem
\[i \omega au M x = J x + b\]using an iterative method, where i is the imagianary unit, omega is the frequency, au is the model timescale, M is the mass matrix, J is the Jacobian, x is the state vector, and b gives a periodic forcing in the current.
Parameters¶
- frequenciesarray-like
The frequencies at which to compute the impedance.
- methodstr, optional
The method used to calculate the impedance. Can be: ‘bicgstab’ - use bicgstab with no preconditioner ‘prebicgstab’ - use bicgstab with a preconditioner, this is the default.
Returns¶
- zsarray-like
The impedances at the given frequencies.
- nyquist_plot(**kwargs)¶
A method to quickly creates a nyquist plot using the results of the simulation. Calls
pbeis.nyquist_plot().Parameters¶
- kwargs
Keyword arguments, passed to pbeis.nyquist_plot.
- set_up_model_for_eis(model)¶
Set up model so that current and voltage are states. This formulation is suitable for EIS calculations in the frequency domain.
Parameters¶
- model
pybamm.BaseModel Model to set up for EIS.
- model
- solve(frequencies, method='direct', inputs=None)¶
Compute the impedance at the given frequencies by solving problem
\[i \omega au M x = J x + b\]where i is the imagianary unit, omega is the frequency, au is the model timescale, M is the mass matrix, J is the Jacobian, x is the state vector, and b gives a periodic forcing in the current.
Parameters¶
- frequenciesarray-like
The frequencies at which to compute the impedance.
- methodstr, optional
The method used to calculate the impedance. Can be ‘direct’, ‘prebicgstab’, or ‘bicgstab’. Default is ‘direct’.
- inputsdict, optional
Any input parameters to pass to the model when solving
Returns¶
- solutionarray-like
The impedances at the given frequencies.
- model