-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.m
1405 lines (1074 loc) · 47.9 KB
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
clc
clear all
close all
%% Goal of the script
% This scripts reproduces the Figures from the article [1]:
% If you use this code, please cite this article:
% [1] Ildar Daminov, Anton Prokhorov, Raphael Caire, Marie-Cécile Alvarez-Herault,
% “Assessment of dynamic transformer rating, considering current and
% temperature limitations” in International Journal of Electrical Power &
% Energy Systems, 2021, https://doi.org/10.1016/j.ijepes.2021.106886
% Other articles on this topic are available:
% https://www.researchgate.net/profile/Ildar-Daminov-2
% Note that the figures generated in this script and those given in the article
% may differ a little bit as latter had been additionally redrawn for a publication.
% Each section (Plotting the Figure X) is independent from each other. So
% you may launch the entire script (using the button "Run") to get all
% figures at one moment or you may launch a special section (using the button
% "Run Section" at the top)to get a specific figure
% Execution time of entire script ≈ 6-7 min
tic
%% Plotting the Figure 1
% Figure name: Transformer loadings equal to HST and TOT limits as a
% function of ambient temperatrure.
% Set the range for ambient temperature from -50 °C up to +50°C
Temperature_range=-50:50;%°C
% Set the range of hot spot temperature limits 120°C and 140°C
HST_range=[120;140];%°C
% Set the range of top-oil temperature limits 120°C and 140°C
TOT_range=[95;105];%°C
% Caclulating the data for each HST limit (120°C and 140°C)
for j=1:2
for i=1:length(Temperature_range)
% Select the ambient temperature from the range
AMB=Temperature_range(i);
% Find per unit loading(PUL)corresponding to given AMB and HST
PUL_HST(i,j)=feasible_region_HST(AMB,HST_range(j));
% Find per unit loading(PUL)corresponding to given AMB and TOT
PUL_TOT(i,j)=feasible_region_TOT(AMB,TOT_range(j));
end % end of "for i=1:length(Temperature_range)"
end % end of "for j=1:2"
% Caclulating the data for design HST(98°C)
for i=1:length(Temperature_range)
% Select the ambient temperature from the range
AMB=Temperature_range(i);
% Find per unit loading(PUL)corresponding to given AMB and HST=98°C
PUL_designHST(i)=feasible_region_HST(AMB,98);
end % end of "for i=1:length(Temperature_range)"
% Preparing the vector of current limit 1.5 pu
current_limit=linspace(1.5,1.5,length(Temperature_range));
% Ploting the results
% Create figure
figure1 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Position',...
[0.13 0.120332091169164 0.831282516636419 0.848917601327761]);
hold(axes1,'on');
% Ploting
plot(Temperature_range,PUL_designHST,'LineWidth',2)
hold on
plot(Temperature_range,PUL_HST(:,1),'LineWidth',2)
plot(Temperature_range,PUL_HST(:,2),'LineWidth',2)
plot(Temperature_range,PUL_TOT(:,1),'LineWidth',2)
plot(Temperature_range,PUL_TOT(:,2),'LineWidth',2)
plot(Temperature_range,current_limit,'LineWidth',2)
ylabel('Transformer loading, pu')
xlabel('Ambient temperature,°C')
% Set the remaining axes properties
set(axes1,'FontSize',16,'XGrid','on','YGrid','on');
%% Plotting the Figure 2
% Figure name: Limiting factors in the range of ambient temperature.
% Figure 2 in the article [1] was ploted without using MATLAB
%% Plotting the Figure 3 and Figure 4
% Figure 3 name: Feasible region (yellow area).
% Figure 4 name: Same feasible region, but showing the loadings with normal
% ageing (green area)
clear all % clear workspace
% Load the ambient temperature
load('Fig3_ambient_temperature.mat')
% current and temperature limitations
current_limit=linspace(1.5,1.5,length(AMB))'; % limit of current, per unit
HST_normal=98; % a design temperature of windings, °C
HST_limit=120; % limit of hot spot temperature (of windings), °C
TOT_limit=105; % limit of top-oil temperature,°C
% Finding a power limit for ToT limit
[Power_limit_TOT]=feasible_region_TOT(AMB,TOT_limit);
% Finding a power limit for design HST
[Power_limit_HSTnormal]=feasible_region_HST(AMB,HST_normal);
% Finding a power limit for a HST limit
[Power_limit_HSTlimit]=feasible_region_HST(AMB,HST_limit);
% Selecting the lowest line between three areas (defined above)
top_line=min(min(Power_limit_TOT,Power_limit_HSTlimit),current_limit);
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(2019,1,1,0,0,0,'Format','HH:SS');
t2 = datetime(2019,1,1,23,59,0,'Format','HH:SS');
time = t1:minutes(1):t2;
% Plot the power limits at the left side
yyaxis left
plot(time,Power_limit_TOT,'b','LineWidth',2)
hold on
plot(time,Power_limit_HSTlimit,'y','LineWidth',2)
plot(time,Power_limit_HSTnormal,'g','LineWidth',2)
plot(time,current_limit,'c','LineWidth',2)
plot(time,top_line,'--k','LineWidth',2)
ylabel('Transformer loading,pu')
xlabel('Time')
ylim([0,1.8]) % as in article
% Plot the ambient temperature at the right side
yyaxis right
plot(time,AMB,':r','LineWidth',1)
ylabel('Ambient temperature,°C')
%% Plotting the Figure 5
% Figure 5 name: Interrelations between transformer loading and
% temperatures, calculated by IEC thermal model
clear all % clear workspace
load('Fig5_PUL_data.mat') % 3 load profiles
AMB=linspace(20,20,1440)'; % rated ambient temperature during 1 day
% Caclualting HST and TOT
[HST_step,TOT_step,~]=ONAF_transformer(PUL_data{3, 1},AMB); % step load
[HST_constant,TOT_constant,~]=ONAF_transformer(PUL_data{2, 1},AMB); % constant load
[HST_specif,TOT_specif,~]=ONAF_transformer(PUL_data{1, 1},AMB); % specific load
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(2019,1,1,0,0,0,'Format','HH:SS');
t2 = datetime(2019,1,1,23,59,0,'Format','HH:SS');
time = t1:minutes(1):t2;
hold on
% plot HST and TOT
plot(time,HST_step,'LineStyle','--','LineWidth',2,'Color',[0 0 1]);
plot(time,HST_constant,'LineStyle','--','LineWidth',2, 'Color',[0.749019622802734 0 0.749019622802734]);
plot(time,HST_specif,'LineStyle','--','LineWidth',2,'Color',[0.635294139385223 0.0784313753247261 0.184313729405403]);
plot(time,TOT_step,'LineStyle',':','LineWidth',2,'Color',[0 0 1]);
plot(time,TOT_constant,'LineStyle',':','LineWidth',2, 'Color',[0.749019622802734 0 0.749019622802734]);
plot(time,TOT_specif,'LineStyle',':','LineWidth',2,'Color',[0.635294139385223 0.0784313753247261 0.184313729405403]);
% Create ylabel
ylabel('Transformer temperature, ℃');
% Uncomment the following line to preserve the Y-limits of the axes
% ylim(axes1,[40 180]);
% Activate the right side of the axes
yyaxis right
% Plot load profiles
plot(time,PUL_data{3, 1},'LineWidth',5,...
'Color',[0 0.447058826684952 0.74117648601532]);
plot(time,PUL_data{2, 1},'LineWidth',3,...
'Color',[0.749019622802734 0 0.749019622802734]);
plot(time,PUL_data{1, 1},'LineWidth',2,...
'Color',[0.635294139385223 0.0784313753247261 0.184313729405403]);
% Create ylabel
ylabel('Transformer loading','FontSize',17.6);
%% Plotting the Figure 6
% Figure 6 name: Feasible region limited by the current only.
clear all % clear workspace
% Load ambient temperature
load('Fig6_ambient_temperature.mat')
% current and temperature limitations
current_limit=linspace(1.5,1.5,length(AMB))'; % limit of current, per unit
HST_normal=98; % a design temperature of windings, °C
HST_limit=120; % limit of hot spot temperature (of windings), °C
TOT_limit=105; % limit of top-oil temperature,°C
% Finding a power limit for ToT limit
[Power_limit_TOT]=feasible_region_TOT(AMB,TOT_limit);
% Finding a power limit for design HST
[Power_limit_HSTnormal]=feasible_region_HST(AMB,HST_normal);
% Finding a power limit for a HST limit
[Power_limit_HSTlimit]=feasible_region_HST(AMB,HST_limit);
% Selecting the lowest line between three areas (defined above)
top_line=min(min(Power_limit_TOT,Power_limit_HSTlimit),current_limit);
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(2019,1,11,0,0,0,'Format','HH:SS');
t2 = datetime(2019,1,11,23,59,0,'Format','HH:SS');
time = t1:minutes(1):t2;
% Plot the power limits at the left side
yyaxis left
plot(time,Power_limit_TOT,'b','LineWidth',2)
hold on
plot(time,Power_limit_HSTlimit,'y','LineWidth',2)
plot(time,Power_limit_HSTnormal,'g','LineWidth',2)
plot(time,current_limit,'c','LineWidth',2)
plot(time,top_line,'--k','LineWidth',2)
ylabel('Transformer loading,pu')
xlabel('Time')
ylim([0,2]) % as in article
% Plot the ambient temperature at the right side
yyaxis right
plot(time,AMB,':r','LineWidth',1)
ylabel('Ambient temperature,°C')
%% Plotting the Figure 7
% Figure 7 name: Feasible region limited by the TOT only.
clear all % clear workspace
% Load ambient temperature
load('Fig7_ambient_temperature.mat')
% current and temperature limitations
current_limit=linspace(1.5,1.5,length(AMB))'; % limit of current, per unit
HST_normal=98; % a design temperature of windings, °C
HST_limit=140; % limit of hot spot temperature (of windings), °C
TOT_limit=95; % limit of top-oil temperature,°C
% Finding a power limit for ToT limit
[Power_limit_TOT]=feasible_region_TOT(AMB,TOT_limit);
% Finding a power limit for design HST
[Power_limit_HSTnormal]=feasible_region_HST(AMB,HST_normal);
% Finding a power limit for a HST limit
[Power_limit_HSTlimit]=feasible_region_HST(AMB,HST_limit);
% Selecting the lowest line between three areas (defined above)
top_line=min(min(Power_limit_TOT,Power_limit_HSTlimit),current_limit);
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(2018,7,7,0,0,0,'Format','HH:SS');
t2 = datetime(2018,7,7,23,59,0,'Format','HH:SS');
time = t1:minutes(1):t2;
% Plot the power limits at the left side
yyaxis left
plot(time,Power_limit_TOT,'b','LineWidth',2)
hold on
plot(time,Power_limit_HSTlimit,'y','LineWidth',2)
plot(time,Power_limit_HSTnormal,'g','LineWidth',2)
plot(time,current_limit,'c','LineWidth',2)
plot(time,top_line,'--k','LineWidth',2)
ylabel('Transformer loading,pu')
xlabel('Time')
ylim([0,2]) % as in article
% Plot the ambient temperature at the right side
yyaxis right
plot(time,AMB,':r','LineWidth',1)
ylabel('Ambient temperature,°C')
%% Plotting the Figure 8
% Figure 8 name: Feasible region limited by current and HST.
clear all % clear workspace
% Load an ambient temperature
load('Fig8_ambient_temperature.mat')
% current and temperature limitations
current_limit=linspace(1.5,1.5,length(AMB))'; % limit of current, per unit
HST_normal=98; % a design temperature of windings, °C
HST_limit=120; % limit of hot spot temperature (of windings), °C
TOT_limit=105; % limit of top-oil temperature,°C
% Finding a power limit for ToT limit
[Power_limit_TOT]=feasible_region_TOT(AMB,TOT_limit);
% Finding a power limit for design HST
[Power_limit_HSTnormal]=feasible_region_HST(AMB,HST_normal);
% Finding a power limit for a HST limit
[Power_limit_HSTlimit]=feasible_region_HST(AMB,HST_limit);
% Selecting the lowest line between three areas (defined above)
top_line=min(min(Power_limit_TOT,Power_limit_HSTlimit),current_limit);
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(2019,1,15,0,0,0,'Format','HH:SS');
t2 = datetime(2019,1,15,23,59,0,'Format','HH:SS');
time = t1:minutes(1):t2;
% Plot the power limits at the left side
yyaxis left
plot(time,Power_limit_TOT,'b','LineWidth',2)
hold on
plot(time,Power_limit_HSTlimit,'y','LineWidth',2)
plot(time,Power_limit_HSTnormal,'g','LineWidth',2)
plot(time,current_limit,'c','LineWidth',2)
plot(time,top_line,'--k','LineWidth',2)
ylabel('Transformer loading,pu')
xlabel('Time')
ylim([0,2]) % as in article
% Plot the ambient temperature at the right side
yyaxis right
plot(time,AMB,':r','LineWidth',1)
ylabel('Ambient temperature,°C')
%% Plotting the Figure 9
% Figure 9 name: Hourly ambient temperature from 1985 to 2019 in Tomsk
% and Grenoble.
clc;clear all % clear a command window and a workspace
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Tomsk.mat') % in Tomsk, Russia
% Extracting the ambient temperature
AMB_Tomsk=T(:,6);
% Round ambient temperature
AMB_Tomsk=round(AMB_Tomsk);
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Grenoble.mat') % in Grenoble, France
% Extracting the ambient temperature
AMB_Grenoble=T(:,6);
% Round ambient temperature
AMB_Grenoble=round(AMB_Grenoble);
% Create figure
figure('InvertHardcopy','off','Color',[1 1 1]);
% Prepare a time vector
t1 = datetime(1985,1,1,0,0,0,'Format','HH:SS');
t2 = datetime(2019,3,29,23,59,0,'Format','HH:SS');
time = t1:hours(1):t2;
% plotting the ambient temperature in Tomsk and Grenoble
plot(time,[AMB_Tomsk,AMB_Grenoble],'LineWidth',2)
ylabel('Ambient temperature,°C')
legend('Tomsk','Grenoble')
%% Plotting the Figure 10
% Figure 10 name: Estimation of feasible regions during 34 years.
clc;clear all % clear a command window and a workspace
% Prepare a time vector
t1 = datetime(1985,1,1,0,0,0,'Format','HH:SS');
t2 = datetime(2019,3,29,23,0,0,'Format','HH:SS');
time = t1:hours(1):t2;
for city=1:2 % for Tomsk and Grenoble
if city==1 % Tomsk
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Tomsk.mat') % in Tomsk, Russia
else % city==2 %Grenoble
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Grenoble.mat') % in Grenoble, France
end % end of if city==1 % Tomsk
% Extracting the ambient temperature
AMB=round(T(:,6)); % rounded for acceleration of script execution
% Setting HST and TOT limits
HST_limit=120; % °C
TOT_limit=105; % °C
% Calculate a feasible region
[Power_limit_HSTnormal,Power_limit_HSTlimit,Power_limit_TOT,...
current_limit,top_line]=feasible_region(AMB,HST_limit,TOT_limit);
% Use a special function to plot a figure
createfigure_34years(time, [Power_limit_TOT Power_limit_HSTlimit...
Power_limit_HSTnormal current_limit top_line]);
% Setting HST and TOT limits
HST_limit=120; % °C
TOT_limit=95; % °C
% Calculate a feasible region
[Power_limit_HSTnormal,Power_limit_HSTlimit,Power_limit_TOT,...
current_limit,top_line]=feasible_region(AMB,HST_limit,TOT_limit);
% Use a special function to plot a figure
createfigure_34years(time, [Power_limit_TOT Power_limit_HSTlimit...
Power_limit_HSTnormal current_limit top_line]);
% Setting HST and TOT limits
HST_limit=140; % °C
TOT_limit=105; % °C
% Calculate a feasible region
[Power_limit_HSTnormal,Power_limit_HSTlimit,Power_limit_TOT,...
current_limit,top_line]=feasible_region(AMB,HST_limit,TOT_limit);
% Use a special function to plot a figure
createfigure_34years(time, [Power_limit_TOT Power_limit_HSTlimit...
Power_limit_HSTnormal current_limit top_line]);
% Setting HST and TOT limits
HST_limit=140; % °C
TOT_limit=95; % °C
% Calculate a feasible region
[Power_limit_HSTnormal,Power_limit_HSTlimit,Power_limit_TOT,...
current_limit,top_line]=feasible_region(AMB,HST_limit,TOT_limit);
% Use a special function to plot a figure
createfigure_34years(time, [Power_limit_TOT Power_limit_HSTlimit...
Power_limit_HSTnormal current_limit top_line]);
end % end of for city=1:2
%% Plotting the Figure 11
% Figure 11 name: Mean DTR with maximum and minimum deviations during 34 years.
clc;clear all % clear a command window and a workspace
% create figure
figure1 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure1);
hold(axes1,'on');
hold on
for city=1:2 % for Tomsk and Grenoble
if city==1 % Tomsk
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Tomsk.mat') % in Tomsk, Russia
load('data_Tomsk.mat') % precalculated data [high;mean;min]
else % city==2 %Grenoble
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Grenoble.mat') % in Grenoble, France
load('data_Grenoble.mat')% precalculated data [high;mean;min]
end % end of if city==1
% Preparing the data for figure
mean_data=Data(:,2);
error_max=Data(:,1)-mean_data;
error_min=mean_data-Data(:,3);
%Ploting the bar chart with errors
ngroups = 5; % total number of formulations
nbars = 10; % needed for groupwidth
% Calculating the width for each bar group
groupwidth = min(0.4,nbars/(nbars + 1.5));
for i = 1:5 % for each formulation
if i==1 % HST<98°C TOT<105°C
if city==1 % Tomsk
% Setting the x coordinates at x axis
x = (1:ngroups) - groupwidth/2 + (2*i-1) * groupwidth / (2*nbars);
else % city==2 Grenoble
x=x+groupwidth;
end
% Plot the bar chart
bar2=bar(x(1),mean_data(1,1),'grouped','BarWidth',groupwidth,'BaseValue',0.8,'Parent',axes1);
set(bar2,'FaceColor',[0 0.498039215803146 0]);
% Create a errors of green area
err_green = [error_min(1,1),error_max(1,1)];
% Plot the errors of green area
er=errorbar(x(1), mean_data(1,1),err_green(1,1),err_green(1,2),'LineStyle','none',...
'LineWidth',1,'Color',[0 0 0]);
else % for other formulations
% Plot the bar chart
bar1=bar(x(i),mean_data(i,1),'grouped','BarWidth',groupwidth,'BaseValue',0.8,'Parent',axes1);
% Create a errors
err_top = [error_min(i,1),error_max(i,1)];
% Plot the errors
er=errorbar(x(i), mean_data(i,1), err_top(:,1),err_top(:,2),'LineStyle','none',...
'LineWidth',1,'Color',[0 0 0]);
end % end of "if i==1 % HST<98°C TOT<105°C
end % end of "for i = 1:5 for each formulation"
end % end of for city=1:2
% Setting the properties of x axis
set(axes1,'FontSize',16,'XTick',[1 2 3 4 5 ],'XTickLabel',...
{'HST≤98°C and TOT≤95°C','HST≤120°C and TOT≤105°C','HST≤120°C and TOT≤95°C','HST≤140°C and TOT≤95°C','HST≤140°C and TOT≤105°C'},...
'YGrid','on')
% Defining the y label
ylabel('Transformer loading,pu','FontSize',17.6);
% Get a x limits
xlim=get(gca,'xlim');
% Plot the horizontal line
plot(xlim,[1 1],'LineWidth',1,'Color',[0 0 0]);
%% Plotting the Figure 12
% Figure 12 name: Mean DTR with maximum and minimum deviations in each month.
clc;clear all % clear a command window and a workspace
% Calculating the high, ean and min loads per each month
for city=1:2 % for Tomsk and Grenoble
if city==1 % Tomsk
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Tomsk.mat') % in Tomsk, Russia
AMB=round(T(:,6));
else % city==2 %Grenoble
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Grenoble.mat') % in Grenoble, France
AMB=round(T(:,6));
end % end of if city==1
for ii=1:4 % for each formulation ii
if ii==1
HST_limit=120;%°C
TOT_limit=105;%°C
elseif ii==2
HST_limit=120;%°C
TOT_limit=95; %°C
elseif ii==3
HST_limit=140;%°C
TOT_limit=95;%°C
elseif ii==4
HST_limit=140;%°C
TOT_limit=105; %°C
end
% Finding a feasible region
[Power_limit_HSTnormal,~,~,~,top_line]=feasible_region...
(AMB,HST_limit,TOT_limit);
% Correcting the green area (DTR based on 98 degC)
index=find(Power_limit_HSTnormal>=1.5); % find indexes when DTR is higher 1.5pu
if length(index)>1 % if exists
Power_limit_HSTnormal(index)=1.5; % apply current limit (1.5) for those DTR higher 1.5 pu
end
% Calculating max,mean and min for each month
for i=1:12 % for each month
%find index of monthes
ind=find((T(:,2)==i));
% Find the mean values of top line and green area
mean_month_top(i,ii)=mean(top_line(ind));
mean_month_green(i,1)=mean(Power_limit_HSTnormal(ind));
% Find the max values of top line and green area
max_month_top(i,ii)=max(top_line(ind));
max_month_green(i,1)=max(Power_limit_HSTnormal(ind));
% Find the min values of top line and green area
min_month_top(i,ii)=min(top_line(ind));
min_month_green(i,1)=min(Power_limit_HSTnormal(ind));
end % for i=1:12 % for each month
end % for ii=1:5
% plotting the figure for Tomsk
if city==1 % Tomsk
% create a figure
figure1 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure1);
else % Grenoble
figure2 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure2);
end
hold(axes1,'on');
hold on
ngroups = 12; % number of months
nbars = 5; % needed for groupwidth
% Calculating the width for each bar group
groupwidth = min(0.2, nbars/(nbars + 1.5));
for ii = 1:4 % for each current and temperature formulations
if ii==1 % if formulation == HST<98°C et HST<120°C TOT<95°C
% Prepare x coordinates at x-axis
x = linspace(1,14,12); x=x-0.45;
% Plot bar chart for green area
bar2=bar(x',mean_month_green,'grouped','BarWidth',groupwidth,'BaseValue',0.8,'Parent',axes1);
set(bar2,'FaceColor',[0 0.498039215803146 0]);
% Prepare data for errors
err_tophigh_green(:,1)=max_month_green(:,1)-mean_month_green(:,1);
err_toplow_green(:,1)=mean_month_green(:,1)-min_month_green(:,1);
err_green = [err_toplow_green(:,1),err_tophigh_green(:,1)];
% plot errors for green area bars
er=errorbar(x, mean_month_green(:,1),err_green(:,1),err_green(:,2),'LineStyle','none',...
'LineWidth',1,'Color',[0 0 0]);
% Shift x cordinates by 0.2
x = x+0.2;
% Plot bar chart for top line
bar1=bar(x,mean_month_top(:,ii),'grouped','BarWidth',groupwidth,'BaseValue',0.8,'Parent',axes1);
set(bar1,'FaceColor',[1 0.843137264251709 0]);
% Prepare data for errors
err_tophigh_top(:,1)=max_month_top(:,ii)-mean_month_top(:,ii);
err_toplow_top(:,1)=mean_month_top(:,ii)-min_month_top(:,ii);
err_top = [err_toplow_top(:,1),err_tophigh_top(:,1)];
% plot errors for top line
er=errorbar(x', mean_month_top(:,ii), err_top(:,1),err_top(:,2),'LineStyle','none',...
'LineWidth',1,'Color',[0 0 0]);
else % otherwise if i=2:4
% Shift x cordinates by 0.2
x = x+0.22;
% Plot bar chart
bar1=bar(x,mean_month_top(:,ii),'grouped','BarWidth',groupwidth,'BaseValue',0.8,'Parent',axes1);
% Create low/high errors for top lines
err_tophigh_top(:,1)=max_month_top(:,ii)-mean_month_top(:,ii);
err_toplow_top(:,1)=mean_month_top(:,ii)-min_month_top(:,ii);
err_top = [err_toplow_top(:,1),err_tophigh_top(:,1)];
% Plot errors for top line
er=errorbar(x', mean_month_top(:,ii), err_top(:,1),err_top(:,2),'LineStyle','none',...
'LineWidth',1,'Color',[0 0 0]);
end % end of if ii==1 %
end % end of for ii = 1:4
% Setting the y label
ylabel('Transformer loading,pu','FontSize',17.6);
% get x limits
xlim=get(gca,'xlim');
% Plot the horizontal line (nominal rating)
plot(xlim,[1 1],'LineWidth',1,'Color',[0 0 0]);
% Set the y limits
ylim([0.8 1.6])
% Create a vector of x coordinates
x = linspace(1,14,12)-0.08;
set(axes1,'FontSize',16,'XTick',x,'XTickLabel',...
{'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'},...
'YGrid','on');
% Title plotting
if city==1 % Tomsk
title('Tomsk')
else % if city==2
title('Grenoble')
end
end % for city=1:2
%% Plotting the Figure 13
% Figure 13 name: DTR duration curves
clc;clear all % clear a command window and a workspace
% Constructing the figure
for city=1:2 % for Tomsk and Grenoble
if city==1 % Tomsk
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Tomsk.mat') % in Tomsk, Russia
AMB=round(T(:,6));
else % city==2 %Grenoble
% Load T - historical ambient temperature (among others)
% from Jan 1, 1985 to 29 March 2019 (MeteoBlue data):
load('T_history_Grenoble.mat') % in Grenoble, France
AMB=round(T(:,6));
end % end of if city==1
% plotting the figure for Tomsk
if city==1 % Tomsk
% create a figure
figure1 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure1);
else % city==2 Grenoble
% create a figure
figure2 = figure('InvertHardcopy','off','WindowState','maximized',...
'Color',[1 1 1]);
% Create axes
axes1 = axes('Parent',figure2);
end
% Preparing the x axis (duration in %)
Duration_x_axis=[1:length(AMB)]*100/length(AMB);
Duration_x_axis=Duration_x_axis';
% Create ylabel
ylabel('Transformer loading, pu');
% Create xlabel
xlabel('DTR duration, %');
hold on
% Caclulating the duration curves
for ii=1:4 % for each formulation ii (different HST and TOT limits)
if ii==1
HST_limit=120;%°C
TOT_limit=105;%°C
elseif ii==2
HST_limit=120;%°C
TOT_limit=95; %°C
elseif ii==3
HST_limit=140;%°C
TOT_limit=95; %°C
elseif ii==4
HST_limit=140; %°C
TOT_limit=105; %°C
end
% Finding a feasible region of transformer loadings
[Power_limit_HSTnormal,~,~,~,top_line]=feasible_region...
(AMB,HST_limit,TOT_limit);
% Correcting the green area (DTR based on 98 degC) per current
% limit
index=find(Power_limit_HSTnormal>=1.5); % find indexes when DTR is higher 1.5pu
if length(index)>1 % if exists
Power_limit_HSTnormal(index)=1.5; % apply current limit (1.5) for those DTR higher 1.5 pu
end
% Finding the duration curve of top line
Duration_top_line=sort(top_line,'descend');
% Finding the duration curve of green area (DTR based on 98 degC)
Duration_green_area=sort(Power_limit_HSTnormal,'descend');
% Ploting the Figure
plot(Duration_x_axis,[Duration_green_area,Duration_top_line],'LineWidth',2)
end % for ii=1:4 % for each formulation ii
% Title plotting
if city==1 % Tomsk
title('Tomsk')
else % if city==2
title('Grenoble')
end
end % for city=1:2
%% Plotting the Figure 14
% Figure 14 name: Share of limiting factors. based on 34 years analysis
% (% are rounded).
clc;clear all % clear a command window and a workspace
% Pie charts for Current ≤1.5pu HST ≤98°C TOT ≤95°C
% Load "T" - a history of ambient temperature in Tomsk, Russia
load('T_history_Tomsk.mat')
% Find indexes when current is limiting factor
index_current=find(round(T(:,6))<-39);
% 39°C is a ambient temperature at the intersection of lines corresponding
% to HST and current (see Fig 1 in the article)
% Find indexes when hot spot temperature is limiting factor
index_hst=find(round(T(:,6))>-39);
% Find indexes when hot spot temperature AND current are limiting factors
% at the same time
index_current_hst=find(round(T(:,6))==-39);
% Checking if the length of temperature array is equal to sum of indexes
checking=length(T(:,6))-length(index_current)-length(index_hst)-length(index_current_hst);
if ~(checking==0)
error('Checking failed')
end
% Ploting the pie chart for Tomsk, Russia
t = tiledlayout(1,2);
ax1 = nexttile;
labels = {'Current only','HST only','Current+HST'};
pie(ax1,[length(index_current) length(index_hst) length(index_current_hst)],'%.1f%%')
colormap(ax1,[0 255 255; 0 127 0; 0 0 1]./256);
legend(labels)
title('Tomsk')
%--------------------------------------------------------------------------
% Repeating the same calculations but for Grenoble, France
load('T_history_Grenoble.mat')
% Find indexes when current is a limiting factor
index_current=find(round(T(:,6))<-39);
% Find indexes when hot spot temeprature is a limiting factor
index_hst=find(round(T(:,6))>-39);
% Find indexes when hot spot temeprature and current are equally a
% limiting factor
index_current_hst=find(round(T(:,6))==-39);
% Checking if the length of temperature array is equal to sum of indexes
checking=length(T(:,6))-length(index_current)-length(index_hst)-length(index_current_hst);
if ~(checking==0)
error('Checking failed')
end
% Ploting the pie chart for Grenoble, France
ax2 = nexttile;
pie(ax2,[length(index_current) length(index_hst) length(index_current_hst)],'%.1f%%')
colormap(ax2,[0 255 255; 0 127 0; 0 0 256]./256);
legend(labels)
title('Grenoble')
%--------------------------------------------------------------------------
% Pie charts for Current ≤1.5pu HST ≤120°C TOT ≤105°C
% create a figure
figure('DefaultAxesFontSize',14)
% Load "T" - a history of ambient temperature in Tomsk, Russia
load('T_history_Tomsk.mat')
% Finding the intersections (from Fig1)
index_current=find(round(T(:,6))<-17);
index_hst=find(round(T(:,6))>-17);
index_current_hst=find(round(T(:,6))==-17);
% -17°C is a ambient temperature at the intersection of lines corresponding
% to HST and current (see Fig 1 in the article)
% Checking if the length of temperature array is equal to sum of indexes
checking=length(T(:,6))-length(index_current)-length(index_hst)-length(index_current_hst);
if ~(checking==0)
error('Checking failed')
end
t = tiledlayout(1,2);
ax1 = nexttile;
labels = {'Current only','HST only','Current+HST'};
pie(ax1,[length(index_current) length(index_hst) length(index_current_hst)],'%.1f%%')
colormap(ax1,[0 255 255; 0 127 0; 0 0 256]./256);
legend(labels)
title('Tomsk')
%--------------------------------------------------------------------------
% Load "T" - a history of ambient temperature in Grenoble, France
load('T_history_Grenoble.mat')
index_current=find(round(T(:,6))<-17);
index_hst=find(round(T(:,6))>-17);
index_current_hst=find(round(T(:,6))==-17);
% Checking if the length of temperature array is equal to sum of indexes
checking=length(T(:,6))-length(index_current)-length(index_hst)-length(index_current_hst);
if ~(checking==0)
error('Checking failed')
end
% Ploting the pie chart for Grenoble, France
ax2 = nexttile;
pie(ax2,[length(index_current) length(index_hst) length(index_current_hst)],'%.1f%%')
colormap(ax2,[0 255 255; 0 127 0; 0 0 256]./256);
legend(labels)
title('Grenoble')
%--------------------------------------------------------------------------
% Pie charts for Current ≤1.5pu HST ≤120°C TOT ≤95°C
% create a figure
figure('DefaultAxesFontSize',14)
% Load "T" - a history of ambient temperature in Tomsk, Russia
load('T_history_Tomsk.mat')
% Finding the intersection (from Fig1)
index_current=find(round(T(:,6))<-17);
index_hst=find(round(T(:,6))>-17 & round(T(:,6))<45);
index_tot=find(round(T(:,6))>45);
index_current_hst=find(round(T(:,6))==-17);
index_hst_tot=find(round(T(:,6))==45);
% -17°C is ambient temperature corresponding to the intersection (in Fig1)
% between HST and current lines
% +45°C is ambient temperature corresponding to the intersection (in Fig1)
% between HST and ToT lines
% Checking if the length of temperature array is equal to sum of indexes
checking=length(T(:,6))-length(index_current)-length(index_hst)-length(index_tot)-length(index_current_hst)-length(index_hst_tot);
if ~(checking==0)
error('Checking failed')
end
t = tiledlayout(1,2);
ax1 = nexttile;
labels = {'Current only','HST only','TOT only','Current+HST','HST+TOT'};
pie(ax1,[length(index_current) length(index_hst) length(index_tot) length(index_current_hst) length(index_hst_tot)],'%.1f%%')
colormap(ax1,[0 255 255; 0 127 0; 0 114 189;0 0 256;0 0 256]./256);
legend(labels)
title('Tomsk')
%--------------------------------------------------------------------------
% Load "T" - a history of ambient temperature in Grenoble, France
load('T_history_Grenoble.mat')
% Finding the intersection (from Fig1)
index_current=find(round(T(:,6))<-17);
index_hst=find(round(T(:,6))>-17 & round(T(:,6))<45);
index_tot=find(round(T(:,6))>45);
index_current_hst=find(round(T(:,6))==-17);
index_hst_tot=find(round(T(:,6))==45);
% -17°C is ambient temperature corresponding to the intersection (in Fig1)
% between HST and current lines
% +45°C is ambient temperature corresponding to the intersection (in Fig1)
% between HST and ToT lines