Error in Battery.Pu​lsesequenc​e/Createpu​lses

조회 수: 3 (최근 30일)
Simha Sreekar
Simha Sreekar 2024년 8월 1일
댓글: Umar 2024년 8월 27일
Hello everyone,
I am trying to implement the Battery Pulse sequence object for the dataset I have currently.
The example dataset consists of 26 pulses and my dataset has 11.
When I am trying to implement the Pulse sequence object to my dataset, I am ending up with the following error message:
"Index in position 1 exceeds array bounds. Index must not exceed 11.
Error in Battery.PulseSequence/createPulses
Error in Trial_script_test_data (line 30)
psObj.createPulses('CurrentOnThreshold',3) %minimum current magnitude to identify pulse events"
How and where do I define the pulses as 11 in 'createpulses'
psObj.createPulses(...
'CurrentOnThreshold',3,... %minimum current magnitude to identify pulse events
'NumRCBranches',2,... %how many RC pairs in the model
'RCBranchesUse2TimeConstants',false,... %do RC pairs have different time constant for discharge and rest?
'PreBufferSamples',2,... %how many samples to include before the current pulse starts
'PostBufferSamples',4); %how many samples to include after the next pulse starts
This is my version of the script.
  댓글 수: 3
Umar
Umar 2024년 8월 5일

Hi @Simha Sreekar,

Will this help you out, Simulink.SubSystem.convertToModelReference

Hoping to see @Manikanta Aditya expertise resolving this problem.

Umar
Umar 2024년 8월 5일
편집: Umar 2024년 8월 5일
Hi @ Manikanta Aditya,
Please see attached.

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

채택된 답변

Umar
Umar 2024년 8월 5일
편집: Umar 2024년 8월 5일

Hi @ Simha Sreekar,

No problem. Hope, this is what you are looking for, Battery.PulseSequence

Forgot to add this link, Generate Parameter Data for Equivalent Circuit Battery Block

추가 답변 (1개)

Divyam
Divyam 2024년 8월 6일
It appears that you have loaded the data from the example file and are trying to add pulses to the same 'Pulse Sequence' object.
Try creating another 'Pulse Sequence' object and then load the data from your personal files. Here is the code for your reference:
psObj = Battery.PulseSequence;
FileName = '<Insert personal MAT file name here to add your pulse data>';
[time,voltage,current] = Battery.loadDataFromMatFile(FileName);
addData(psObj,time,voltage,current);
psObj.createPulses(...
'CurrentOnThreshold',3,...
'NumRCBranches',2,...
'RCBranchesUse2TimeConstants',false,...
'PreBufferSamples',2,...
'PostBufferSamples',4);
To change the number of RC branches you can use the 'createPulses' function and edit the 'NumRCBranches' parameter.
For more information here is the documentation for generating appropriate parameter data for your circuit: https://www.mathworks.com/help/autoblks/ug/generate-parameter-data-for-estimations-circuit-battery-block.html
  댓글 수: 6
Simha Sreekar
Simha Sreekar 2024년 8월 27일
Hello @Umar
Thanks for your assistance. I am able to generate the data, working on the accuracy.
Umar
Umar 2024년 8월 27일
Hi @ Simha Sreekar,
Glad to know that your problem has been resolved and thank you for your update regarding the data generation process. I appreciate your efforts in ensuring the accuracy of the information, as it is crucial for our ongoing projects.

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

카테고리

Help CenterFile Exchange에서 Power and Energy Systems에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by