How to use torque and speed data for a certain time period from an excel sheet in a PMSG in Simulink?
2 次查看(过去 30 天)
显示 更早的评论
In the following simulink model, PMSG is taking constant speed value, and this model is converting mechanical power into AC power, then DC voltage and current. However, I have some real torque and speed data for a certain time in an excel file collected from a hydrokinetic test site. Instant of the constant block, which one can I use to import data from excel and then apply to the PMSG to see how the electrical power (DC voltage and current) vary over a certain time? Or is there any other procedure to do this? Thanks in advance.
0 个评论
回答(1 个)
Divyanshu
2023-8-22
Hi Kawsar,
One possible workaround to make use of excel sheet values for simulation is by updating the ‘Constant’ block value iteratively using ‘set_param’ function of MATLAB.
Here is a sample script for this workaround:
sampleTable = readtable("Book2.xlsx");
tableSize = size(sampleTable);
for i=1:tableSize(1)
block = find_system('demoModel/Constant');
set_param(block{1},'Value',string(sampleTable.Speed(i)))
pause(1);
end
In the above script excel sheet has just one column ‘Speed’ which you can modify, and update based on the scenario.
For further details about different functions used in the script refer the following documentations:
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!