필터 지우기
필터 지우기

Interpolating the Interval Where the Signal Goes to Infinity

조회 수: 2 (최근 30일)
Can
Can 2021년 10월 22일
편집: Can 2021년 11월 7일
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
Mathieu NOE
Mathieu NOE 2021년 10월 25일
hello
you simply cannot do a division with zero at the denominator (when Tcell is constant)
Can
Can 2021년 10월 25일
편집: Can 2021년 10월 25일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Can
Can 2021년 10월 25일
편집: Can 2021년 10월 25일
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
Mathieu NOE
Mathieu NOE 2021년 10월 26일
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 2021년 11월 7일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modulation에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by