Skip to content

Commit

Permalink
added comments in EquilibriumCalibrationSetup
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierr committed Jul 19, 2024
1 parent 2fc576a commit 8d9f397
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions Utilities/Calibration/EquilibriumCalibrationSetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,26 @@
%% The goal of this class is to solve the following calibration problem:
% Given a discharge curve, find the set of parameters that give the better match.
% By default (calibrationCase = 1), the calibration parameters are the guest stoichiometry at discharge start and the volume fraction, for both electrodes.

%
% Usage description :
% 1. Instantiate object using model and expdata
% expdata is a structure with fields
% - I : Current used (scalar)
% - U : vector with voltage values
% - time : vector with time values (same dimension as U)
%
% 2. Run one of the optimiser, that is either
% [Xopt, hist] = runUnitBoxBFGS(ecs, X0);
% or
% [Xopt, info] = runIpOpt(ecs, ipopt_options);
% (see documentation for those)
%
% 3. The optimal parameter values are given by the vector Xopt.
% They can be converted to a more readable structure using
% vals = assignFromX(ecs, X)
% (see documentation for this method)
%
% See installation instruction for ipopt optimiser in README.org in this directory
properties

model % Battery model
Expand All @@ -18,20 +37,23 @@

packingMass % mass of packing

bounds % Vector of variable bounds on the variables, with field
% - lower
% - upper

calibrationCase = 1
% different calibration case depending on the parameters that are chosen. See method printVariableChoice
% different calibration case depending on the parameters that are chosen. See method printVariableChoice below
% At the moment, the following is implemented
% case 1 (default) : The calibration parameters are theta100 and volume fraction for both electrodes
% Theta0 for the positive electrode is computed from the end point of the discharge curve
% Theta0 for the negative electrode is computed to match a given NP ration (default value 1.1)
% When using ipopt, we add a constraint that enforces that the theta value at the end (t = totalTime) is between 0 and 1.
% case 2 : The calibration parameters are theta100 for the negative electrode, the volume fractions for both electrodes
% case 3 : The calibration parameters are theta100, theta0 and volume fraction for both electrodes and we add a constraint on the np-ratio (thus we use IpOpt solver)


%% Helper structures, assigned during setup

bounds % Vector of variable bounds on the variables, with field
% - lower
% - upper

calibrationParameters

end
Expand Down Expand Up @@ -422,7 +444,7 @@ function printVariableChoice(ecs)


function [fexp, fcomp] = setupfunction(ecs)

% Setup the function to compute the discharge curves, either for the experimental data or for the given set of parameter, using the model.
fcomp = @(t, X) ecs.computeF(t, X);
fexp = @(t) ecs.experimentalF(t);

Expand Down

0 comments on commit 8d9f397

Please sign in to comment.