close all;
clear;
clc;

Vdc_nominal = 800;

f = 60;
Vgrid = 480; %ll rms

T_MPPT = 1e-1;
Tsample = 1e-4;

Lfilt = 100e-6;
Rfilt = 1e-3;

Kp_current = 0.3;
Ki_current = 0.5;

Kp_voltage = 0.3; 
Ki_voltage = 50;

Pinv_max = 1e6;
Cbus = 500e-6;
Vcap_init = Vdc_nominal;

% MPPT
deltaV_new = 0.15;

% PV panel
Rs = 0.0576;
Rp = 58.0459;
a = 1;
Ns = 60;
G_n = 1000;
T_n = 25;
Voc_n = 40.9;
V_mp = 33.7;
Isc_n = 10.23;
Kv = -0.27/100*38.4; %Kv_volts_per_degreeC
Ki = 0.03/100*8.23; %Ki_amps_per_degreeC

numArrays = ceil(Vdc_nominal/V_mp); % Number of PV arrays in series to get desired nominal dc bus voltage