Full model for conservation of charge in the electrolyte employing the Stefan-Maxwell constitutive equations. (Full refers to unreduced by asymptotic methods)
param (parameter class) – The parameters to use for this submodel
options (dict, optional) – A dictionary of options to be passed to the model.
**Extends (** pybamm.electrolyte_conductivity.BaseElectrolyteConductivity
) –
Check that the algebraic equations are well-posed. After discretisation, there must be at least one StateVector in each algebraic equation.
Discretise model if it isn’t already discretised This only works with purely 0D models, as otherwise the mesh and spatial method should be specified by the user
Check that the initial and boundary conditions are well-posed.
Check that no equation keys are repeated.
Check that the model is not under- or over-determined.
Check that the model is well-posed by executing the following tests: - Model is not over- or underdetermined, by comparing keys and equations in rhs and algebraic. Overdetermined if more equations than variables, underdetermined if more variables than equations. - There is an initial condition in self.initial_conditions for each variable/equation pair in self.rhs - There are appropriate boundary conditions in self.boundary_conditions for each variable/equation pair in self.rhs and self.algebraic
post_discretisation (boolean) – A flag indicating tests to be skipped after discretisation
Return default solver based on whether model is ODE/DAE or algebraic
Export the constituent parts of the model (rhs, algebraic, initial conditions, etc) as casadi objects.
casadi_dict – Dictionary of {str: casadi object} pairs representing the model in casadi format
Generate the model in C, using CasADi.
filename (str) – Name of the file to which to save the code
variable_names (list) – Variables to be exported alongside the model structure
input_parameter_order (list, optional) – Order in which the input parameters should be stacked. If None, the order
returned by BaseModel.input_parameters()
is used
cg_options (dict) – Options to pass to the code generator. See https://web.casadi.org/docs/#generating-c-code
A public method that creates and returns the variables in a submodel which require variables in other submodels to be set first. For example, the exchange current density requires the concentration in the electrolyte to be created before it can be created. If a variable can be created independent of other submodels then it should be created in ‘get_fundamental_variables’ instead of this method.
A public method that returns the variables in a submodel which are supplied by an external source.
A list of the external variables in the model.
A public method that creates and returns the variables in a submodel which can be created independent of other submodels. For example, the electrolyte concentration variables can be created independent of whether any other variables have been defined in the model. As a rule, if a variable can be created without variables from other submodels, then it should be placed in this method.
The variables created by the submodel which are independent of variables in other submodels.
Provides helpful summary information for a symbol.
parameter_name (str) –
Returns all the input parameters in the model
Converts all model equations in latex.
filename (str (optional)) – Accepted file formats - any image format, pdf and tex Default is None, When None returns all model equations in latex If not None, returns all model equations in given file format.
newline (bool (optional)) – Default is True, If True, returns every equation in a new line. If False, returns the list of all the equations.
model (Load) –
pybamm.lithium_ion.SPM() (>>> model =) –
png (This will returns all model equations in) –
model.latexify("equations.png") (>>>) –
latex (This will return all the model equations in) –
model.latexify() (>>>) –
equations (This will return first five model) –
model.latexify(newline=False) (>>>) –
equations –
model.latexify(newline=False)[1 (>>>) –
Length scales of model
Creates a copy of the model, explicitly copying all the mutable attributes to avoid issues with shared objects.
Returns all the parameters in the model
Process parameters and discretise a symbol using supplied parameter values and discretisation. Note: care should be taken if using spatial operators on dimensional symbols. Operators in pybamm are written in non-dimensional form, so may need to be scaled by the appropriate length scale. It is recommended to use this method on non-dimensional symbols.
symbol (pybamm.Symbol
) – Symbol to be processed
parameter_values (pybamm.ParameterValues
) – The parameter values to use during processing
disc (pybamm.Discretisation
) – The discrisation to use
Processed symbol
A method to set the differential equations which do not contain a time
derivative. Note: this method modifies the state of self.algebraic. Unless
overwritten by a submodel, the default behaviour of ‘pass’ is used as
implemented in pybamm.BaseSubModel
.
variables (dict) – The variables in the whole model.
A method to set the boundary conditions for the submodel. Note: this method
modifies the state of self.boundary_conditions. Unless overwritten by a
submodel, the default behaviour of ‘pass’ is used a implemented in
pybamm.BaseSubModel
.
variables (dict) – The variables in the whole model.
A method to set events related to the state of submodel variable. Note: this
method modifies the state of self.events. Unless overwritten by a submodel, the
default behaviour of ‘pass’ is used a implemented in
pybamm.BaseSubModel
.
variables (dict) – The variables in the whole model.
A method to set the initial conditions for the submodel. Note: this method
modifies the state of self.initial_conditions. Unless overwritten by a
submodel, the default behaviour of ‘pass’ is used a implemented in
pybamm.BaseSubModel
.
variables (dict) – The variables in the whole model.
Update initial conditions with the final states from a Solution object or from a dictionary. This assumes that, for each variable in self.initial_conditions, there is a corresponding variable in the solution with the same name and size.
solution (pybamm.Solution
, or dict) – The solution to use to initialize the model
inplace (bool, optional) – Whether to modify the model inplace or create a new model (default True)
return_type (str, optional) – Whether to return the model (default) or initial conditions (“ics”)
A method to set the right hand side of the differential equations which contain
a time derivative. Note: this method modifies the state of self.rhs. Unless
overwritten by a submodel, the default behaviour of ‘pass’ is used as
implemented in pybamm.BaseSubModel
.
variables (dict) – The variables in the whole model.
Timescale of model, to be used for non-dimensionalising time when solving
Update model to add new physics from submodels
submodel (iterable of pybamm.BaseModel
) – The submodels from which to create new model
Returns variables and events in a single dictionary