Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

data type error

data type error

Hello,
I have the following error

Index number 1 of the array expression Vout_gt[count4] is not an integer expression.

Index number 1 of the array expression Pout_gt[count4] is not an integer expression.

even thought count4 has been declared as Integer. Can someone help?



The code is below!

model pv_version1_17june

input Real T_Real_in_dyncur;
  input Real V_capacitor_in_dyncur, Reference_V_in_dyncur;
  input Real time_step_in_dyncur, Time_Instance_in_dyncur;
  output Real I_out_dyncur, V_capacitor_out_dyncur;
  output Integer Status_out_dyncur;
  input Integer P_coef_in_dyncur, G_Real_in_dyncur, Status_in_dyncur,
    V_control_in_dyncur, V_net_in_dyncur;

Real Gstc=1000;
  Real Rsh_gt, Isc_gt, Ir, Il_gt, Voc_gt, maxlim_gt=1000, iVoc_gt, I0_gt, Vr,
    modified_Vr, iIr, Vmpp_gt, Impp_gt, Pout_max;
  Real Vout_gt[:]=zeros(100);
  Real Iout_gt[:]=zeros(100);
  Real Pout_gt[:]=zeros(100);
  Real matrixsize=100;
  Real maxlim2=1000, step_size, count3;
  Integer count4;

algorithm
if G_Real_in_dyncur <0.0001 then //issues with small values of irradiance
            Vmpp_gt:=0;
            Impp_gt:=0;
        else  for count4 in 1:Vr loop
                  Pout_gt[count4]:=Vout_gt[count4]*Iout_gt[count4];
                    if Pout_gt[count4]>Pout_max then
                    Vmpp_gt:=Vout_gt[count4];
                    Impp_gt:=Iout_gt[count4];
                    end if;
             end for;
         end if;

end pv_version1_17june;

There are 0 guests and 0 other users also viewing this topic
You are here: