Interpolating the Interval Where the Signal Goes to Infinity

7 Ansichten (letzte 30 Tage)
Can
Can am 22 Okt. 2021
Bearbeitet: Can am 7 Nov. 2021
I'm modelling a battery cell and while modelling the equation below:
Using the chain rule:
I, T_cell and OCV are known.
I modelled the equation like this:
While the cell temperature is a constant, the signal output is interrupted. I aim to interpolate those intervals. I tried to use Switch and Delay method, but it didn't work. Is this possible? If so, how can I do that?
  2 Kommentare
Mathieu NOE
Mathieu NOE am 25 Okt. 2021
hello
you simply cannot do a division with zero at the denominator (when Tcell is constant)
Can
Can am 25 Okt. 2021
Bearbeitet: Can am 25 Okt. 2021
Hello Mathieu,
You're right, I disabled zero-crossing detection for that, and I'm trying to make the signal interpolate when T_cell is constant. Whatever can be done in this case is my question.
Maybe if I save the output to the workspace and use a lookup table.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Can
Can am 25 Okt. 2021
Bearbeitet: Can am 25 Okt. 2021
Now, I realized that it naturally goes to infinity, not zero. I can't change the title to "Interpolating an Interval Where the Signal goes to Infinity", but I did it. In a very stupid way, but it works. Let me explain.
1. First I ran the code and the model.
2. Then I wrote a code using isinf (to find infinite values) and delsample(to remove them).
Sim_time = 300;
sim('model');
%% INTERPOLATION
% isfinite is to determine which array elements are infinite(true if infinite)
% To compare, I defined dOCV_dT_inf, a timespace with infinite values.
dOCV_dT_inf = dOCV_dT;
% I defined infarray, a logical array that contains 1 (true) whenever the
% elements of the array dOCV_dT.Data is infinite.
infarray = isinf(dOCV_dT.Data);
% Why does isinf take 97 of the data? How to change it?
% I ran the code below, number of infinite data went down everytime I ran
% it, after three times number of infinite values was zero.
x = 0;
while x < 3
for ii= 1:97
if infarray(ii) == 1
dOCV_dT= delsample(dOCV_dT,'Index',ii);
end
end
x = x + 1;
end
dOCV_dT_noinf = dOCV_dT;
sim('model');
3. I ran this section and created a look-up table in the model, using this timeseries.
4. The input of this lookup table is time, so I put a clock as the input.
5. I ran the code and from the scope, I found that it works.
I'm sure there's a much easier way to do this. If anyone wants to explain it, I'm willing to learn.
  2 Kommentare
Mathieu NOE
Mathieu NOE am 26 Okt. 2021
hello again
I'm not familiar with battery models , but I wonder if we can simply switch between models based on when Tcell is constant or not
My 2 cents
Can
Can am 7 Nov. 2021
Hello again Mathieu,
Thanks for the feedback. Code deletes inf values, if T_cell is not constant second model does nothing, thus there's no need to not run the second model.
Regards,
Can

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Test Model Components finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by