How to change PV array block and modify it`s code

4 views (last 30 days)
Dear matlab members;
I am about using the pre built PV array block in simulink to fit my work so i copy the blocks and the code and use it without mask
So i have to look under mask , taking the blocks that i need and omits the one i do not need (IV curve display & model parameters calculator Rs,Rsh, , Iph , I0)
The issue is when using the code of the mask ``initialization`` that i could not tranfert and use (even if i copy it to mat script it will not run0)
It show an error and the function can not run and thus the outputs of the function which are block pameters are not recognized
i may miss something please give me a help or orientation
The code is uploaded
Thank you
% To get started click initialization widget. The variables created in initialization
% code can be used by the child blocks or in the icon drawing code.
% Initialization code section
function initialization()
Block = gcb;
[k,k1,q,Tref_C,Tref_K,EgRef,dEgdT,Rsh_array5pc,VT_ref,Tsf,Tf,VIdiodePV,WantBlockChoice] = PVArrayInit(Block, Nser, Npar, Ncell, Rsh, nI, Tfilter, Voc, I0);
powericon('SetInternalModels','set',Block,WantBlockChoice);
sps_rtmsupport('parametereditingmodes',Block, [3 6 7 23]);
end
% Callback for PlotType
function PlotType_callback()
PVArrayCback(gcb)
end
% Callback for PlotButton
function PlotButton_callback()
PVArrayPlot(gcb,'detailed')
end
% Callback for ModuleName
function ModuleName_callback()
PVArrayCback(gcb)
end
% Callback for RobustModel
function RobustModel_callback()
PVArrayCback(gcb)
end
% Callback for BAL
function BAL_callback()
PVArrayCback(gcb)
end

Answers (0)

Categories

Find more on Simulink Environment Customization in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!