Can't set the modeling options parameter of the simscape battery block using set_param function

조회 수: 4 (최근 30일)
How can I programmatically set the modeling option parameter for a Simscape Battery block in MATLAB to "Instrumented | Show thermal port" to display both the SOC and thermal ports?
I tried using get_param to retrieve the parameters of the battery block, but I couldn’t find any related to the modeling options (SOC or thermal ports). Is there a way to programmatically enable these ports or set these parameters through a MATLAB script?
  댓글 수: 2
Sameer
Sameer 2024년 9월 12일
편집: Sameer 2024년 9월 12일
Have you tried exploring the available parameters using "get_param" to see if the "SOC" and "Thermal" port options are directly accessible?
Here's a line of code for that:
params = get_param(blockPath, 'ObjectParameters');
Additionally, have you checked for any mask parameters that might control these options?
You can use the following code:
maskParams = get_param(blockPath, 'MaskNames');
Mohamed
Mohamed 2024년 9월 16일
편집: Mohamed 2024년 9월 16일
Yes, I have displayed the mask parameters and the object parameters using the 2 lines of code you provided but i didn't find any parameter related to the thermal and the soc ports.

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

답변 (1개)

Ayush
Ayush 2024년 9월 16일
I understand that you want to modify parameters of the SimScape "Battery" block via a MATLAB script or the command window.
The thermal port configuration is available under “Modelling options” in the block parameters of "Battery" block component. I tried to change it using command window by using “ports” parameter and “set_param” function but was unable to do so, as it was read-only parameter. You can read more about “set_param” function here:https://in.mathworks.com/help/releases/R2022b/simulink/slref/set_param.html
It appears that, as of MATLAB R2022b, this parameter can only be modified through the graphical user interface (GUI), and not through scripting or command-line instructions.
Here, matrix [0 0 0 0 0 2 2 0 0 0] denotes the “Instrumented | Show thermal port” configuration. You can view it using “get_param” function. You can read more about it here: https://in.mathworks.com/help/releases/R2022b/simulink/slref/get_param.html
However, I was able to change the configuration using command window in MATLAB R2024b.In this version, the parameter name is modified to “thermal_port”. You can try upgrading to MATLAB R2024b.
You can read more about “Battery” SimScape block and its configuration parameters here: https://in.mathworks.com/help/releases/R2022b/simscape-battery/ref/battery.html
Hope this helps!

카테고리

Help CenterFile Exchange에서 Battery Pack Modeling에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by