Can't set the modeling options parameter of the simscape battery block using set_param function
5 次查看(过去 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!