group types
Summary
Members | Descriptions |
---|---|
enum lion_rint_model | Internal resistance models. |
enum lion_soh_model | Degradation models. |
enum lion_regime | Regime in which the simulation operates. |
enum lion_stepper | Stepper algorithm for the ode solver. |
enum lion_minimizer | Minimizer algorithm for the optimization problem. |
enum lion_jacobian_method | Jacobian calculation method. |
enum lion_status | Status of each lion call. |
struct lion_params_init | Initialization parameters. |
struct lion_params_ehc | Entropic heat coefficient model parameters. |
struct lion_params_vft | Vogel-Fulcher-Tammann model for temperature-dependence of capacity. |
struct lion_params_temp | Temperature model parameters. |
struct lion_params_ocv | Open-circuit voltage model parameters. |
struct lion_params_rint_fixed | Fixed internal resistance model. |
struct lion_params_rint_polarization | Current and state of charge dependent internal resistance model. |
struct lion_params_rint | Container for the internal resistance model. |
struct lion_params_soh_vendor | Simple vendor model. |
struct lion_params_soh_masserano | Temperature and subcycle aware model. |
struct lion_params_soh | |
struct lion_params | Parameters of the system. |
struct lion_sim_config | Simulation metaparameters and hyperparameters. |
struct lion_sim_state | Simulation state variables. |
struct lion_slv_inputs | Inputs for the solver. |
struct lion_sim | Simulation runtime, used for setup and simulation. |
struct lion_version | Version of the simulator. |
struct lion_vector | Variable length vector of data. |
Members
enum
lion_rint_model
Values | Descriptions |
---|---|
LION_RINT_MODEL_FIXED | Fixed internal resistance model. |
LION_RINT_MODEL_POLARIZATION | Current and state of charge dependent internal resistance model. |
Internal resistance models.
enum
lion_soh_model
Values | Descriptions |
---|---|
LION_SOH_MODEL_VENDOR | Simple model that uses vendor-provided data. |
LION_SOH_MODEL_MASSERANO | Temperature- and subcycle-aware model. |
Degradation models.
enum
lion_regime
Values | Descriptions |
---|---|
LION_ONLYSF | Surface temperature. |
LION_ONLYAIR | Air temperature. |
LION_BOTH | Surface and air temperature. |
Regime in which the simulation operates.
This enum indicates which domains the temperature model considers. Currently only surface simulation is allowed, but air considerations are planned.
enum
lion_stepper
Values | Descriptions |
---|---|
LION_STEPPER_RK2 | Explicit Runge-Kutta (2, 3). |
LION_STEPPER_RK4 | Explicit Runge-Kutta 4. |
LION_STEPPER_RKF45 | Explicit Runge-Kutta-Fehlberg (4, 5). |
LION_STEPPER_RKCK | Explicit Runge-Kutta Cash-Karp (4, 5). |
LION_STEPPER_RK8PD | Explicit Runge-Kutta Prince-Dormand (8, 9). |
LION_STEPPER_RK1IMP | Implicit Euler. |
LION_STEPPER_RK2IMP | Implicit Runge-Kutta 2. |
LION_STEPPER_RK4IMP | Implicit Runge-Kutta 4. |
LION_STEPPER_BSIMP | Implicit Bulirsch-Stoer. |
LION_STEPPER_MSADAMS | Multistep Adams. |
LION_STEPPER_MSBDF | Multistep backwards differentiation. |
Stepper algorithm for the ode solver.
The types of steppers allowed are those allowed by GSL, and considers both explicit and implicit solvers.
enum
lion_minimizer
Values | Descriptions |
---|---|
LION_MINIMIZER_GOLDENSECTION | Golden section. |
LION_MINIMIZER_BRENT | Brent. |
LION_MINIMIZER_QUADGOLDEN | Brent with safeguarded step-length. |
Minimizer algorithm for the optimization problem.
The types of minimizers allowed are those allowed by GSL.
enum
lion_jacobian_method
Values | Descriptions |
---|---|
LION_JACOBIAN_ANALYTICAL | Analytical method. |
LION_JACOBIAN_2POINT | Central differences method. |
Jacobian calculation method.
The following methods for jacobian calculation are currently supported:
-
LION_JACOBIAN_ANALYTICAL : uses the analytical equations to calculate the jacobian.
-
LION_JACOBIAN_2POINT : uses central differences to numerically calculate the jacobian.
enum
lion_status
Values | Descriptions |
---|---|
LION_STATUS_SUCCESS | Success. |
LION_STATUS_FAILURE | Failure. |
LION_STATUS_EXIT | Trigger exit. |
Status of each lion
call.
struct lion_params_init
Initialization parameters.
Summary
Members | Descriptions |
---|---|
public double soc | Initial state of charge. |
public double temp_in | Initial internal temperature. |
public double soh | Initial state of health. |
public double capacity | Initial nominal capacity. |
public double current_guess | Initial guess for the current, default is 0. |
Members
public double
soc
Initial state of charge.
public double
temp_in
Initial internal temperature.
public double
soh
Initial state of health.
public double
capacity
Initial nominal capacity.
public double
current_guess
Initial guess for the current, default is 0.
struct lion_params_ehc
Entropic heat coefficient model parameters.
Summary
Members | Descriptions |
---|---|
public double a | |
public double b | |
public double mu | |
public double kappa | |
public double sigma | |
public double l |
Members
public double
a
public double
b
public double
mu
public double
kappa
public double
sigma
public double
l
struct lion_params_vft
Vogel-Fulcher-Tammann model for temperature-dependence of capacity.
Summary
Members
public double
k1
public double
k2
public double
tref
Reference temperature.
struct lion_params_temp
Temperature model parameters.
Summary
Members | Descriptions |
---|---|
public double cp | Heat capacity of the cell. |
public double rin | Interior-surface thermal resistivity of the cell. |
public double rout | Surface-ambient thermal resistivity of the cell. |
Members
public double
cp
Heat capacity of the cell.
public double
rin
Interior-surface thermal resistivity of the cell.
public double
rout
Surface-ambient thermal resistivity of the cell.
struct lion_params_ocv
Open-circuit voltage model parameters.
Summary
Members | Descriptions |
---|---|
public double alpha | |
public double beta | |
public double gamma | |
public double v0 | |
public double vl |
Members
public double
alpha
public double
beta
public double
gamma
public double
v0
public double
vl
struct lion_params_rint_fixed
Fixed internal resistance model.
Summary
Members | Descriptions |
---|---|
public double internal_resistance | Internal resistance. |
Members
public double
internal_resistance
Internal resistance.
struct lion_params_rint_polarization
Current and state of charge dependent internal resistance model.
Summary
Members | Descriptions |
---|---|
public lion_mf_sigmoid_params_t c40 | 40A charge fuzzy parameters. |
public lion_mf_gaussian_params_t c20 | 20A charge fuzzy parameters. |
public lion_mf_gaussian_params_t c10 | 10A charge fuzzy parameters. |
public lion_mf_gaussian_params_t c4 | 4A charge fuzzy parameters. |
public lion_mf_gaussian_params_t d5 | 5A discharge fuzzy parameters. |
public lion_mf_gaussian_params_t d10 | 10A discharge fuzzy parameters. |
public lion_mf_gaussian_params_t d15 | 15A discharge fuzzy parameters. |
public lion_mf_sigmoid_params_t d30 | 30A discharge fuzzy parameters. |
public double poly | Polynomial coefficients. |
Members
public
lion_mf_sigmoid_params_t
c40
40A charge fuzzy parameters.
public
lion_mf_gaussian_params_t
c20
20A charge fuzzy parameters.
public
lion_mf_gaussian_params_t
c10
10A charge fuzzy parameters.
public
lion_mf_gaussian_params_t
c4
4A charge fuzzy parameters.
public
lion_mf_gaussian_params_t
d5
5A discharge fuzzy parameters.
public
lion_mf_gaussian_params_t
d10
10A discharge fuzzy parameters.
public
lion_mf_gaussian_params_t
d15
15A discharge fuzzy parameters.
public
lion_mf_sigmoid_params_t
d30
30A discharge fuzzy parameters.
public double
poly
Polynomial coefficients.
struct lion_params_rint
Container for the internal resistance model.
Summary
Members | Descriptions |
---|---|
public lion_rint_model_t model | Model to use. |
public lion_params_rint_fixed_t fixed | |
public lion_params_rint_polarization_t polarization | |
public union lion_params_rint params | Model parameters. |
Members
public
lion_rint_model_t
model
Model to use.
public
lion_params_rint_fixed_t
fixed
public
lion_params_rint_polarization_t
polarization
public union
lion_params_rint
params
Model parameters.
struct lion_params_soh_vendor
Simple vendor model.
Summary
Members | Descriptions |
---|---|
public uint64_t total_cycles | Nominal number of cycles the cell has. |
public double final_soh | Nominal state of health after total_cycles (end of life) |
Members
public uint64_t
total_cycles
Nominal number of cycles the cell has.
public double
final_soh
Nominal state of health after total_cycles
(end of life)
struct lion_params_soh_masserano
Temperature and subcycle aware model.
Summary
Members | Descriptions |
---|---|
public uint64_t nominal_cycles | Nominal number of cycles the cell has. |
public double nominal_sr | |
public double nominal_final_soh | Nominal state of health after total_cycles (end of life). |
public double eq_cycles | |
public double eq_final_soh | |
public double eq_sr | |
public double x_table | X values for the kNN regressor. |
public double y_table | y values for the kNN regressor. |
public lion_vector_t eta_values | Values for the KDE. |
public lion_gaussian_kde_bwmethod_t bw_method | Method for bandwidth calculation. |
public struct lion_params_soh_masserano kde_params | Parameters for the KDE. |
public lion_vector_t X | X values for the kNN. |
public lion_vector_t y | y values for the kNN. |
public struct lion_params_soh_masserano knn_params | Parameters for the kNN. |
public lion_gaussian_kde_t kde | KDE instance. |
public lion_knn_regressor_t knn | kNN instance. |
Members
public uint64_t
nominal_cycles
Nominal number of cycles the cell has.
public double
nominal_sr
public double
nominal_final_soh
Nominal state of health after total_cycles
(end of life).
public double
eq_cycles
public double
eq_final_soh
public double
eq_sr
public double
x_table
X values for the kNN regressor.
public double
y_table
y values for the kNN regressor.
public
lion_vector_t
eta_values
Values for the KDE.
public lion_gaussian_kde_bwmethod_t
bw_method
Method for bandwidth calculation.
public struct
lion_params_soh_masserano
kde_params
Parameters for the KDE.
public
lion_vector_t
X
X values for the kNN.
public
lion_vector_t
y
y values for the kNN.
public struct
lion_params_soh_masserano
knn_params
Parameters for the kNN.
public
lion_gaussian_kde_t
kde
KDE instance.
public lion_knn_regressor_t
knn
kNN instance.
struct lion_params_soh
Summary
Members | Descriptions |
---|---|
public lion_soh_model_t model | Model to use. |
public lion_params_soh_vendor_t vendor | |
public lion_params_soh_masserano_t masserano | |
public union lion_params_soh params | Model parameters. |
Members
public
lion_soh_model_t
model
Model to use.
public
lion_params_soh_vendor_t
vendor
public
lion_params_soh_masserano_t
masserano
public union
lion_params_soh
params
Model parameters.
struct lion_params
Parameters of the system.
Summary
Members | Descriptions |
---|---|
public lion_params_init_t init | Initial conditions. |
public lion_params_ehc_t ehc | Entropic heat coefficient. |
public lion_params_ocv_t ocv | Open-circuit voltage. |
public lion_params_vft_t vft | Temperature-dependence of capacity. |
public lion_params_temp_t temp | Temperature model. |
public lion_params_rint_t rint | Internal resistance model. |
public lion_params_soh_t soh | Degradation model. |
Members
public
lion_params_init_t
init
Initial conditions.
public
lion_params_ehc_t
ehc
Entropic heat coefficient.
public
lion_params_ocv_t
ocv
Open-circuit voltage.
public
lion_params_vft_t
vft
Temperature-dependence of capacity.
public
lion_params_temp_t
temp
Temperature model.
public
lion_params_rint_t
rint
Internal resistance model.
public
lion_params_soh_t
soh
Degradation model.
struct lion_sim_config
Simulation metaparameters and hyperparameters.
These parameters are not associated to the runtime of the sim itself, but rather with its configurations, choice of algorithms, parameters of those algorithms, etc.
Summary
Members | Descriptions |
---|---|
public const char * sim_name | Name of the simulation. |
public lion_regime_t sim_regime | Regime to simulate. |
public lion_stepper_t sim_stepper | Stepper algorithm. |
public lion_minimizer_t sim_minimizer | Minimizer algorithm. |
public lion_jacobian_method_t sim_jacobian | Jacobian method. |
public double sim_time_seconds | Total simulation time in seconds. |
public double sim_step_seconds | Time of each simulation step in seconds. |
public double sim_epsabs | Absolute epsilon for update. |
public double sim_epsrel | Relative epsilon for update. |
public uint64_t sim_min_maxiter | Maximum iterations of each minimization problem. |
public const char * log_dir | Directory for the logs. |
public int log_stdlvl | Level of the stderr logger. |
public int log_filelvl | Level of the file logger. |
Members
public const char *
sim_name
Name of the simulation.
public
lion_regime_t
sim_regime
Regime to simulate.
public
lion_stepper_t
sim_stepper
Stepper algorithm.
public
lion_minimizer_t
sim_minimizer
Minimizer algorithm.
public
lion_jacobian_method_t
sim_jacobian
Jacobian method.
public double
sim_time_seconds
Total simulation time in seconds.
public double
sim_step_seconds
Time of each simulation step in seconds.
public double
sim_epsabs
Absolute epsilon for update.
public double
sim_epsrel
Relative epsilon for update.
public uint64_t
sim_min_maxiter
Maximum iterations of each minimization problem.
public const char *
log_dir
Directory for the logs.
public int
log_stdlvl
Level of the stderr logger.
public int
log_filelvl
Level of the file logger.
struct lion_sim_state
Simulation state variables.
This includes all relevant variables of the simulation, including electrical and thermal variables, degradation variables, etc.
Summary
Members | Descriptions |
---|---|
public double time | Simulation time. |
public uint64_t step | Simulation step index (starts at 1). |
public double power | Power being drawn from the cell. |
public double ambient_temperature | Ambient temperature around the cell. |
public double voltage | Voltage in the terminals of the cell. |
public double current | Current drawn from the cell. |
public double ref_open_circuit_voltage | Reference open circuit voltage of the cell. |
public double open_circuit_voltage | Temperature aware open circuit voltage of the cell. |
public double internal_resistance | Internal resistance of the cell. |
public uint64_t cycle | Number of cycles the battery has been through. |
public double soh | State of health of the cell. |
public uint64_t _cycle_step | Step within the cycle. |
public double _soc_mean | Average state of charge of the cycle. |
public double _soc_max | Maximum state of charge of the cycle. |
public double _soc_min | Minimum state of charge of the cycle. |
public double _acc_discharge | Accumulated discharge. |
public double ehc | Entropic heat coefficient according to an empirical model. |
public double generated_heat | Heat generated by the cell due to ohmic and entropic heating. |
public double internal_temperature | Internal temperature of the cell. |
public double surface_temperature | Surface temperature of the cell. |
public double kappa | Dimensionless variable which quantifies the changes in electrolite conductivity. |
public double soc_nominal | Nominal state of charge. |
public double capacity_nominal | Nominal capacity. |
public double soc_use | Usable state of charge considering temperature. |
public double capacity_use | Usable capacity considering temperature. |
public double _next_soc_nominal | Placeholder for the next nominal state of charge. |
public double _next_internal_temperature | Placeholder for the next internal temperature. |
Members
public double
time
Simulation time.
public uint64_t
step
Simulation step index (starts at 1).
public double
power
Power being drawn from the cell.
public double
ambient_temperature
Ambient temperature around the cell.
public double
voltage
Voltage in the terminals of the cell.
public double
current
Current drawn from the cell.
public double
ref_open_circuit_voltage
Reference open circuit voltage of the cell.
public double
open_circuit_voltage
Temperature aware open circuit voltage of the cell.
public double
internal_resistance
Internal resistance of the cell.
public uint64_t
cycle
Number of cycles the battery has been through.
public double
soh
State of health of the cell.
public uint64_t
_cycle_step
Step within the cycle.
public double
_soc_mean
Average state of charge of the cycle.
public double
_soc_max
Maximum state of charge of the cycle.
public double
_soc_min
Minimum state of charge of the cycle.
public double
_acc_discharge
Accumulated discharge.
public double
ehc
Entropic heat coefficient according to an empirical model.
public double
generated_heat
Heat generated by the cell due to ohmic and entropic heating.
public double
internal_temperature
Internal temperature of the cell.
public double
surface_temperature
Surface temperature of the cell.
public double
kappa
Dimensionless variable which quantifies the changes in electrolite conductivity.
public double
soc_nominal
Nominal state of charge.
public double
capacity_nominal
Nominal capacity.
public double
soc_use
Usable state of charge considering temperature.
public double
capacity_use
Usable capacity considering temperature.
public double
_next_soc_nominal
Placeholder for the next nominal state of charge.
public double
_next_internal_temperature
Placeholder for the next internal temperature.
struct lion_slv_inputs
Inputs for the solver.
Both the current state and the parameters of the system are passed at each iteration of the solver, to be used for the update function as well as the Jacobian calculation.
Summary
Members | Descriptions |
---|---|
public lion_sim_state_t * sys_inputs | System state. |
public lion_params_t * sys_params | System parameters. |
Members
public
lion_sim_state_t
*
sys_inputs
System state.
public
lion_params_t
*
sys_params
System parameters.
struct lion_sim
Simulation runtime, used for setup and simulation.
This contains all the variables which will be used by the simulation, both during the setup and during the runtime on a step-by-step basis.
Summary
Members | Descriptions |
---|---|
public lion_sim_config_t * conf | Hyperparameters and sim metadata. |
public lion_params_t * params | System parameters. |
public lion_sim_state_t state | System state. |
public lion_slv_inputs_t inputs | Inputs to the solver. |
public lion_status_t (* init_hook | Hook called upon initialization. |
public lion_status_t (* update_hook | Hook called on each update of the simulation. |
public lion_status_t (* finished_hook | Hook called when the simulation is finished. |
public gsl_odeiv2_system sys | Handle to the ode system. |
public gsl_odeiv2_driver * driver | Driver for the ode system. |
public gsl_min_fminimizer * sys_min | Handle to the minimizer. |
public const gsl_odeiv2_step_type * step_type | Stepper used by the ode system. |
public const gsl_min_fminimizer_type * minimizer | Minimizer used by the optimizer. |
public char log_filename | Name of the log file. |
public FILE * log_file | Handle to the log file. |
public int64_t _idebug_malloced_total | |
public size_t _idebug_malloced_size | |
public _idebug_heap_info_t * _idebug_heap_head |
Members
public
lion_sim_config_t
*
conf
Hyperparameters and sim metadata.
public
lion_params_t
*
params
System parameters.
public
lion_sim_state_t
state
System state.
public
lion_slv_inputs_t
inputs
Inputs to the solver.
public
lion_status_t
(*
init_hook
Hook called upon initialization.
public
lion_status_t
(*
update_hook
Hook called on each update of the simulation.
public
lion_status_t
(*
finished_hook
Hook called when the simulation is finished.
public gsl_odeiv2_system
sys
Handle to the ode system.
public gsl_odeiv2_driver *
driver
Driver for the ode system.
public gsl_min_fminimizer *
sys_min
Handle to the minimizer.
public const gsl_odeiv2_step_type *
step_type
Stepper used by the ode system.
public const gsl_min_fminimizer_type *
minimizer
Minimizer used by the optimizer.
public char
log_filename
Name of the log file.
public FILE *
log_file
Handle to the log file.
public int64_t
_idebug_malloced_total
public size_t
_idebug_malloced_size
public
_idebug_heap_info_t
*
_idebug_heap_head
struct lion_version
Version of the simulator.
Summary
Members | Descriptions |
---|---|
public const char * major | Major version. |
public const char * minor | Minor version. |
public const char * patch | Patch number. |
Members
public const char *
major
Major version.
public const char *
minor
Minor version.
public const char *
patch
Patch number.
struct lion_vector
Variable length vector of data.
Summary
Members | Descriptions |
---|---|
public void * data | Data container in heap. |
public size_t data_size | Size of each element. |
public size_t len | Length of the vector. |
public size_t capacity | Capacity of the vector. |
Members
public void *
data
Data container in heap.
public size_t
data_size
Size of each element.
public size_t
len
Length of the vector.
public size_t
capacity
Capacity of the vector.