f



??? Error using ==> feval Output argument "x" (and maybe others) not assigned during call to

my function

function [GCPV] = GCPV(Parray_stc,Htilt,fdirt,fmm,npv_inv,n_inv,ftemp)
  
for i = 1:40

    mod_code =i
    
    for j = 1:40
        
    inv_code =j
    
    end
    
end

mod_database = xlsread('LIST_OF_MODULES.xls')
inv_database = xlsread('LIST_OF_INVERTERS.xls')


Pmodule_stc = mod_database(mod_code,3)
Voc_stc = mod_database(mod_code,4)
Vmp_stc = mod_database(mod_code,5)
Isc_stc = mod_database(mod_code,6)
Impp = mod_database(mod_code,7)
fmm = mod_database(mod_code,8)
Yvoc = mod_database(mod_code,9)
Yvmp = mod_database(mod_code,10)

Pnom_inv = inv_database(mod_code,3)
Vmax_inv = inv_database(mod_code,4)
Vmax_window_inv = inv_database(mod_code,5) 
Vmin_window_inv = inv_database(mod_code,6)
Idc_inv =  inv_database(mod_code,7)
n_inv = inv_database(mod_code,8)



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                   SIZING INVERTER WITH PV ARRAY
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        
% STEP 1 : calculate total module

Ntotal_module1 = ceil ((Pnom_inv) ./ (0.8*Pmodule_stc)) %ceil is for round up
Ntotal_module2 = floor ((Pnom_inv) ./ (0.75*Pmodule_stc)) %floor is for round down
%Ntotal_module = [ Ntotal_module1, Ntotal_module2 ]



% STEP 2 : calculate Vmax_oc, Vmax_mp and Vmin_mp

Vmax_oc = Voc_stc.*(1-((Yvoc./100)*(20-25)))
Vmax_mp = Vmp_stc.*(1-((Yvmp./100)*(20-25)))
Vmin_mp = Vmp_stc.*(1-((Yvmp./100)*(75-25)))

% STEP 3 : calculate Nsbased_on_Vmax_oc and Nsbased_on_Vmax_mp

Nsbased_on_Vmax_oc = floor ((Vmax_inv*0.95)./(Vmax_oc))
Nsbased_on_Vmax_mp = floor ((Vmax_window_inv*0.95)./(Vmax_mp))


if Nsbased_on_Vmax_oc<Nsbased_on_Vmax_mp
    Ns_max = Nsbased_on_Vmax_oc;
    return
else 
    Ns_max = Nsbased_on_Vmax_mp;
    return
   
end



% STEP 4 : calculate Ns_min

Ns_min = ceil ((Vmin_window_inv*1.1)./(Vmin_mp*0.95))

% STEP 5 : calculate Np_max

Np_max = floor ((Idc_inv./(Isc_stc*1.25)))

% STEP 6 : finding the optimum configuration

%if Ntotal_module1 <= Np_max*Ns_max;
    
%    Optimum_configuration = [Np_max Ns_max];
%elseif Ntotal_module2 <= Np_max*Ns_max;
    
%    Optimum_configuration = [Np_max Ns_max];
    
%end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                   SYSTEM EVALUATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%assume tilt angle = 20 degree

Htilt = 1511.3;
fdirt = 0.97; %assume
fmm = 0.97; % from datasheet
npv_inv = 0.98; %assume cable loss 2%

Tambient_avg = 33;

Tcell_avg = Tambient_avg + 25

ftemp = 1 - ((Yvmp/100)*(Tcell_avg - 25))



Parray_stc = Pmodule_stc.*Np_max.*Ns_max

% calculate energy generated from GCPV

        
GCPV = Parray_stc.*Htilt.*fdirt.*fmm.*npv_inv.*n_inv.*ftemp
 



end

during call, it display

Error in ==> GCPV at 4
for i = 1:40

??? Error using ==> feval
Output argument "GCPV" (and maybe others) not assigned during call to "C:\Documents and
Settings\me\My Documents\FINAL YEAR PROJECT\GCPV.m>GCPV".
 
0
2/8/2014 10:08:16 PM
comp.programming 11491 articles. 2 followers. Post Follow

0 Replies
1163 Views

Similar Articles

[PageSpeed] 31

Reply: