Problems modeling a battery behaviour to generate C Code.

조회 수: 4 (최근 30일)
Iker Fernandez Requejo
Iker Fernandez Requejo 2023년 10월 9일
댓글: Iker Fernandez Requejo 2023년 10월 20일
I have a functional Simscape model of a battery which response I wanna replicate using Simulink blocks in order to generate C Code. The main problem is that I have a "Infinite Loop" problem so I can't generate C Code. The infinite loop can easily be solved using a unit delay, but when you incorporate it to the model, the current (and the battery voltage) signal starts to oscillate in the moment the change between charge/discharge state occurs. To achieve that change from discharge to charge states I use a switch block (I've already tried to change the switch block using logic and that solution does not work).

답변 (1개)

Sabin
Sabin 2023년 10월 11일
편집: Sabin 2023년 10월 12일
It is possible to generate C code from the Simscape model directly:
  댓글 수: 1
Iker Fernandez Requejo
Iker Fernandez Requejo 2023년 10월 20일
For the especific purpouse of the application it is mandatory to use only Simulink blocks.
Thank you!

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by