Commit 95fccc8e authored by Angioni's avatar Angioni

minor updates

parent af24ca04
......@@ -20,7 +20,7 @@
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [GridData] = generate_GridData(type_of_model)
function [GridData] = generate_GridData(type_of_model,name_of_model)
GridData = struct; %this struct contains all the static data of the grid
......@@ -29,8 +29,9 @@ if strcmp(type_of_model,'single_phase')==1 %single phase model
%*******************************************************************
% sample grid : subsitute with your grid data
%run sample_singlephase1
run sample_singlephase2
%run sample_singlephase2
%run CIGRE_MV
eval(name_of_model);
%*******************************************************************
R1 = R1/base_Z;
......@@ -44,7 +45,8 @@ elseif strcmp(type_of_model,'three_phase_sequence')==1 % the system is modeled a
%*******************************************************************
% sample grid : subsitute with your grid data
run sample_threephase1
%run sample_threephase1
eval(name_of_model);
%*******************************************************************
parameters_R_pos = R1/base_Z;
......
......@@ -20,15 +20,16 @@
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [PowerData]=generate_PowerData(GridData)
function [PowerData]=generate_PowerData(GridData,name_of_model)
if strcmp(GridData.type_of_model,'single_phase') == 1
%*******************************************************************
% sample grid power : subsitute with your grid power data
%run sample_singlephase1
run sample_singlephase2
%run sample_singlephase2
%run CIGRE_MV
eval(name_of_model);
%*******************************************************************
P_tot = (P_load-P_gen)/(GridData.base_power);
......@@ -153,7 +154,8 @@ elseif strcmp(GridData.type_of_model,'three_phase_sequence') == 1
%*******************************************************************
% sample grid power : subsitute with your grid power data
run threephase1
%run sample_threephase1
eval(name_of_model);
%*******************************************************************
P_tot = (P_load-P_gen)/(GridData.base_power);
......
......@@ -29,8 +29,9 @@ results_DSSE_WLS2=struct;results_DSSE_WLS2.err_Vmagnitude=[];results_DSSE_WLS2.e
results_DSSE_WLS=struct;results_DSSE_WLS.err_Vmagnitude=[];results_DSSE_WLS.err_Vphase=[];results_DSSE_WLS.Vmagn_status=[];results_DSSE_WLS.Vph_status=[];results_DSSE_WLS.Imagn_status=[];results_DSSE_WLS.Iph_status=[];results_DSSE_WLS.Vreal_status=[];results_DSSE_WLS.Vimag_status=[];results_DSSE_WLS.Ireal_status=[];results_DSSE_WLS.Iimag_status=[];results_DSSE_WLS.Vmagn_true=[];results_DSSE_WLS.Vph_true=[];results_DSSE_WLS.Imagn_true=[];results_DSSE_WLS.Iph_true=[];results_DSSE_WLS.Vreal_true=[];results_DSSE_WLS.Vimag_true=[];results_DSSE_WLS.Ireal_true=[];results_DSSE_WLS.Iimag_true=[];results_DSSE_WLS.err_Imagnitude=[];results_DSSE_WLS.err_Iphase=[];results_DSSE_WLS.err_Ireal=[];results_DSSE_WLS.err_Iimag=[];results_DSSE_WLS.err_Vreal=[];results_DSSE_WLS.err_Vimag=[];results_DSSE_WLS.err_Vmagnitude_in =[];results_DSSE_WLS.err_Vphase_in=[];results_DSSE_WLS.err_Imagnitude_in =[];results_DSSE_WLS.err_Iphase_in =[];results_DSSE_WLS.err_Ireal_in =[];results_DSSE_WLS.err_Iimag_in =[];results_DSSE_WLS.Vmagn_measured =[];results_DSSE_WLS.Vph_measured =[];
%select type of model among 'single_phase' 'three_phase_sequence' 'three_phase_unbalance'
type_of_model = 'single_phase';
[GridData] = generate_GridData(type_of_model);%in this function the static model is generated
[PowerData] = generate_PowerData(GridData); %in this function the power flow is run in order to obtain the reference values to test the state estimator
name_of_model = 'CIGRE_MV';
[GridData] = generate_GridData(type_of_model,name_of_model);%in this function the static model is generated
[PowerData] = generate_PowerData(GridData,name_of_model); %in this function the power flow is run in order to obtain the reference values to test the state estimator
[Test_SetUp,Combination_devices,Accuracy] = generate_DSSEConfData(GridData);%here the test configuration data are set: measurement devices location and accuracy
GridData.rm_column = 0;%in this case the phase angle at 1st bus is also considered as state
[W,GridData,R] = Weight_m(GridData,PowerData,Combination_devices,Accuracy); %weight and covariance matrix of the state estimator
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment