group types

Summary

MembersDescriptions
enum lion_rint_modelInternal resistance models.
enum lion_soh_modelDegradation models.
enum lion_regimeRegime in which the simulation operates.
enum lion_stepperStepper algorithm for the ode solver.
enum lion_minimizerMinimizer algorithm for the optimization problem.
enum lion_jacobian_methodJacobian calculation method.
enum lion_statusStatus of each lion call.
struct lion_params_initInitialization parameters.
struct lion_params_ehcEntropic heat coefficient model parameters.
struct lion_params_vftVogel-Fulcher-Tammann model for temperature-dependence of capacity.
struct lion_params_tempTemperature model parameters.
struct lion_params_ocvOpen-circuit voltage model parameters.
struct lion_params_rint_fixedFixed internal resistance model.
struct lion_params_rint_polarizationCurrent and state of charge dependent internal resistance model.
struct lion_params_rintContainer for the internal resistance model.
struct lion_params_soh_vendorSimple vendor model.
struct lion_params_soh_masseranoTemperature and subcycle aware model.
struct lion_params_soh
struct lion_paramsParameters of the system.
struct lion_sim_configSimulation metaparameters and hyperparameters.
struct lion_sim_stateSimulation state variables.
struct lion_slv_inputsInputs for the solver.
struct lion_simSimulation runtime, used for setup and simulation.
struct lion_versionVersion of the simulator.
struct lion_vectorVariable length vector of data.

Members

enum lion_rint_model

ValuesDescriptions
LION_RINT_MODEL_FIXEDFixed internal resistance model.
LION_RINT_MODEL_POLARIZATIONCurrent and state of charge dependent internal resistance model.

Internal resistance models.

enum lion_soh_model

ValuesDescriptions
LION_SOH_MODEL_VENDORSimple model that uses vendor-provided data.
LION_SOH_MODEL_MASSERANOTemperature- and subcycle-aware model.

Degradation models.

enum lion_regime

ValuesDescriptions
LION_ONLYSFSurface temperature.
LION_ONLYAIRAir temperature.
LION_BOTHSurface 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

ValuesDescriptions
LION_STEPPER_RK2Explicit Runge-Kutta (2, 3).
LION_STEPPER_RK4Explicit Runge-Kutta 4.
LION_STEPPER_RKF45Explicit Runge-Kutta-Fehlberg (4, 5).
LION_STEPPER_RKCKExplicit Runge-Kutta Cash-Karp (4, 5).
LION_STEPPER_RK8PDExplicit Runge-Kutta Prince-Dormand (8, 9).
LION_STEPPER_RK1IMPImplicit Euler.
LION_STEPPER_RK2IMPImplicit Runge-Kutta 2.
LION_STEPPER_RK4IMPImplicit Runge-Kutta 4.
LION_STEPPER_BSIMPImplicit Bulirsch-Stoer.
LION_STEPPER_MSADAMSMultistep Adams.
LION_STEPPER_MSBDFMultistep 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

ValuesDescriptions
LION_MINIMIZER_GOLDENSECTIONGolden section.
LION_MINIMIZER_BRENTBrent.
LION_MINIMIZER_QUADGOLDENBrent with safeguarded step-length.

Minimizer algorithm for the optimization problem.

The types of minimizers allowed are those allowed by GSL.

enum lion_jacobian_method

ValuesDescriptions
LION_JACOBIAN_ANALYTICALAnalytical method.
LION_JACOBIAN_2POINTCentral 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

ValuesDescriptions
LION_STATUS_SUCCESSSuccess.
LION_STATUS_FAILUREFailure.
LION_STATUS_EXITTrigger exit.

Status of each lion call.

struct lion_params_init

Initialization parameters.

Summary

MembersDescriptions
public double socInitial state of charge.
public double temp_inInitial internal temperature.
public double sohInitial state of health.
public double capacityInitial nominal capacity.
public double current_guessInitial 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

MembersDescriptions
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

MembersDescriptions
public double k1
public double k2
public double trefReference temperature.

Members

public double k1

public double k2

public double tref

Reference temperature.

struct lion_params_temp

Temperature model parameters.

Summary

MembersDescriptions
public double cpHeat capacity of the cell.
public double rinInterior-surface thermal resistivity of the cell.
public double routSurface-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

MembersDescriptions
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

MembersDescriptions
public double internal_resistanceInternal resistance.

Members

public double internal_resistance

Internal resistance.

struct lion_params_rint_polarization

Current and state of charge dependent internal resistance model.

Summary

MembersDescriptions
public lion_mf_sigmoid_params_t c4040A charge fuzzy parameters.
public lion_mf_gaussian_params_t c2020A charge fuzzy parameters.
public lion_mf_gaussian_params_t c1010A charge fuzzy parameters.
public lion_mf_gaussian_params_t c44A charge fuzzy parameters.
public lion_mf_gaussian_params_t d55A discharge fuzzy parameters.
public lion_mf_gaussian_params_t d1010A discharge fuzzy parameters.
public lion_mf_gaussian_params_t d1515A discharge fuzzy parameters.
public lion_mf_sigmoid_params_t d3030A discharge fuzzy parameters.
public double polyPolynomial 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

MembersDescriptions
public lion_rint_model_t modelModel to use.
public lion_params_rint_fixed_t fixed
public lion_params_rint_polarization_t polarization
public union lion_params_rint paramsModel 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

MembersDescriptions
public uint64_t total_cyclesNominal number of cycles the cell has.
public double final_sohNominal 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

MembersDescriptions
public uint64_t nominal_cyclesNominal number of cycles the cell has.
public double nominal_sr
public double nominal_final_sohNominal 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_tableX values for the kNN regressor.
public double y_tabley values for the kNN regressor.
public lion_vector_t eta_valuesValues for the KDE.
public lion_gaussian_kde_bwmethod_t bw_methodMethod for bandwidth calculation.
public struct lion_params_soh_masserano kde_paramsParameters for the KDE.
public lion_vector_t XX values for the kNN.
public lion_vector_t yy values for the kNN.
public struct lion_params_soh_masserano knn_paramsParameters for the kNN.
public lion_gaussian_kde_t kdeKDE instance.
public lion_knn_regressor_t knnkNN 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

MembersDescriptions
public lion_soh_model_t modelModel to use.
public lion_params_soh_vendor_t vendor
public lion_params_soh_masserano_t masserano
public union lion_params_soh paramsModel 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

MembersDescriptions
public lion_params_init_t initInitial conditions.
public lion_params_ehc_t ehcEntropic heat coefficient.
public lion_params_ocv_t ocvOpen-circuit voltage.
public lion_params_vft_t vftTemperature-dependence of capacity.
public lion_params_temp_t tempTemperature model.
public lion_params_rint_t rintInternal resistance model.
public lion_params_soh_t sohDegradation 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

MembersDescriptions
public const char * sim_nameName of the simulation.
public lion_regime_t sim_regimeRegime to simulate.
public lion_stepper_t sim_stepperStepper algorithm.
public lion_minimizer_t sim_minimizerMinimizer algorithm.
public lion_jacobian_method_t sim_jacobianJacobian method.
public double sim_time_secondsTotal simulation time in seconds.
public double sim_step_secondsTime of each simulation step in seconds.
public double sim_epsabsAbsolute epsilon for update.
public double sim_epsrelRelative epsilon for update.
public uint64_t sim_min_maxiterMaximum iterations of each minimization problem.
public const char * log_dirDirectory for the logs.
public int log_stdlvlLevel of the stderr logger.
public int log_filelvlLevel 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

MembersDescriptions
public double timeSimulation time.
public uint64_t stepSimulation step index (starts at 1).
public double powerPower being drawn from the cell.
public double ambient_temperatureAmbient temperature around the cell.
public double voltageVoltage in the terminals of the cell.
public double currentCurrent drawn from the cell.
public double ref_open_circuit_voltageReference open circuit voltage of the cell.
public double open_circuit_voltageTemperature aware open circuit voltage of the cell.
public double internal_resistanceInternal resistance of the cell.
public uint64_t cycleNumber of cycles the battery has been through.
public double sohState of health of the cell.
public uint64_t _cycle_stepStep within the cycle.
public double _soc_meanAverage state of charge of the cycle.
public double _soc_maxMaximum state of charge of the cycle.
public double _soc_minMinimum state of charge of the cycle.
public double _acc_dischargeAccumulated discharge.
public double ehcEntropic heat coefficient according to an empirical model.
public double generated_heatHeat generated by the cell due to ohmic and entropic heating.
public double internal_temperatureInternal temperature of the cell.
public double surface_temperatureSurface temperature of the cell.
public double kappaDimensionless variable which quantifies the changes in electrolite conductivity.
public double soc_nominalNominal state of charge.
public double capacity_nominalNominal capacity.
public double soc_useUsable state of charge considering temperature.
public double capacity_useUsable capacity considering temperature.
public double _next_soc_nominalPlaceholder for the next nominal state of charge.
public double _next_internal_temperaturePlaceholder 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

MembersDescriptions
public lion_sim_state_t*sys_inputsSystem state.
public lion_params_t*sys_paramsSystem 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

MembersDescriptions
public lion_sim_config_t*confHyperparameters and sim metadata.
public lion_params_t*paramsSystem parameters.
public lion_sim_state_t stateSystem state.
public lion_slv_inputs_t inputsInputs to the solver.
public lion_status_t(* init_hookHook called upon initialization.
public lion_status_t(* update_hookHook called on each update of the simulation.
public lion_status_t(* finished_hookHook called when the simulation is finished.
public gsl_odeiv2_system sysHandle to the ode system.
public gsl_odeiv2_driver * driverDriver for the ode system.
public gsl_min_fminimizer * sys_minHandle to the minimizer.
public const gsl_odeiv2_step_type * step_typeStepper used by the ode system.
public const gsl_min_fminimizer_type * minimizerMinimizer used by the optimizer.
public char log_filenameName of the log file.
public FILE * log_fileHandle 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

MembersDescriptions
public const char * majorMajor version.
public const char * minorMinor version.
public const char * patchPatch 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

MembersDescriptions
public void * dataData container in heap.
public size_t data_sizeSize of each element.
public size_t lenLength of the vector.
public size_t capacityCapacity 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.