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
2024년 9월 12일
편집: Sameer
2024년 9월 12일
Hi @Mohamed
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');
답변 (1개)
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!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Battery Pack Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!