Application of Electric Vehicles and Solar Panels To Support The Public Grid Through Reactive Power Injection

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 219

Application of electric vehicles and solar panels to support the public grid through reactive power injection

Carles Bertran Pujol

FINAL DEGREE PROJECT

TITLE: Application of electric vehicles and solar panels to support the public
grid through reactive power injection

AUTHORS: BERTRAN PUJOL, CARLES

TUTOR: MIGUEL CASTILLA

DATE OF PRESENTATION: October, 2022


Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

1
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Abstract

The objective of this project is to analyze the impact that solar panels and electric vehicles
would have on the power grid, specifically, the injection and/or absorption of reactive power
by the inverters of these.

Prior to the topic in question, the document contains a brief explanation of the climate
situation, energy and smart grids (all of which are core topics in the document).

The study will be carried out with simulations made by Simulink on 3 different cases. The
first and second case will consist of single-phase inverters, while the third case will be run
with three-phase inverters. Each case will vary the number of houses that will be connected
to the grid. Apart from the incidence of reactive power, in case 3, the behavior of the system
subjected to disturbances in the electrical grid will also be studied.

The work consists of all the necessary explanations to fully understand the operation of the
Matlab and Simulink simulation files. The Excel program will also be used for some graphics.

Keywords:

Inverter Reactive power Active Power Single-phase Three-phase

2
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Resumen

El objetivo de este proyecto es analizar el impacto que tendrían los paneles solares y los
vehículos eléctricos en la red eléctrica, concretamente, la inyección y/o absorción de
potencia reactiva por parte de los inversores de éstos.

Previo al tema en cuestión, el documento contiene una breve explicación de la situación


climática, la energía y las redes inteligentes (todos ellos temas centrales en el documento).

El estudio se llevará a cabo con simulaciones realizadas mediante Simulink sobre 3 casos
diferentes. El primer y el segundo caso consistirán en inversores monofásicos, mientras
que el tercer caso se ejecutará con inversores trifásicos. En cada caso se variará el número
de viviendas que se conectarán a la red. Además de la incidencia de la potencia reactiva,
en el caso 3 se estudiará también el comportamiento del sistema sometido a perturbaciones
en la red.

El trabajo consta de todas las explicaciones necesarias para comprender el funcionamiento


de los archivos de simulación Matlab y Simulink. También se utilizará el programa Excel
para algunos gráficos.

Palabras clave:

Inversor Potencia Potencia Activa Monofásico Trifásico


Reactiva

3
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Resum

L'objectiu d'aquest projecte és analitzar l'impacte que tindrien els panells solars i els
vehicles elèctrics a la xarxa elèctrica, concretament la injecció i/o absorció de potència
reactiva per part dels inversors.

Previ al tema en qüestió, el document conté una breu explicació de la situació climàtica,
l'energia i les xarxes intel·ligents (tots ells temes centrals al document).

L’estudi es durà a terme amb simulacions realitzades mitjançant Simulink sobre 3 casos
diferents. El primer i segon cas consistiran en inversors monofàsics, mentre que el tercer
cas s'executarà amb inversors trifàsics. En cada cas es variarà el nombre d’habitatges que
es connectaran a la xarxa. A més de la incidència de la potència reactiva, en el cas 3 també
s'estudiarà el comportament del sistema sotmès a pertorbacions de la xarxa.

El treball consta de totes les explicacions necessàries per comprendre el funcionament dels
fitxers de simulació empreats de Matlab i Simulink. També es farà servir el programa Excel
per a alguns gràfics.

Paraules clau:

Inversor Potència Potència Activa Monofàsic Trifàsic


Reactiva

4
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Index
Abstract 2
1. Introduction 15
1.1. Main objectives 15
1.2. Antecedents 16
1.3. Personal motivation 16
1.4. Work Structure 17
2. Context 19
2.1. Climate Change 20
2.1.1. CO2 Emissions 20
2.1.2. CO2 Emissions by sector 25
2.1.3. Energy Mix 27
2.1.4. Solar and Wind energy 36
2.1.5. Electric mobility 38
2.1.6. Conclusions 41
2.2. Smart Grid 42
2.2.1. The effect of electrical vehicles and solar panels in the electrical grid 46
2.3. How can reactive power help to stabilize the public electrical grid? 47
3. System Description 49
3.1. Introduction 49
3.2. Control and Inverters 50
3.2.1 Inverter Control (single-phase) 50
3.2.2 Inverter Control (three-phase) 55
4. Cases of studying 65
4.1. Introduction to the different cases 65
4.2. Case 1: Single-family house with solar panels and one electric vehicle 65
4.2.1. Simulink Description 65
4.2.2. Control 78
4.2.3. Simulation 82
4.2.4. Parasitic Grid Inductance 86
4.2.5. Conclusions from Case 1 87
4.3. Case 2: A neighborhood with several single-family houses like the case one 88
4.3.1. Case description 88
4.3.2. Control 89
4.3.3. Simulation 89

5
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

4.3.4. Parasitic Grid Inductance 93


4.3.5. Conclusions from Case 2 96
4.4. Case 3: A neighborhood with several single-family houses like the case one but in a
three-phase grid 96
4.4.1. Case description 97
4.4.2. Control 106
4.4.3. Simulation 108
4.4.3.1. What would happen if the number of houses were increased considerably?
114
4.4.4. Parasitic Grid Inductance 118
4.5. Conclusions of all cases in Chapter 4 125
5. Response of Case 3 subjected to voltage sags 127
5.1. Annotations From Range 1 (Figures 136, 137 and 138) 138
5.2. Annotations From Range 2 (Figures 139, 140 and 141) 138
5.3. Annotations From Range 3 (Figures 142, 143 and 144) 138
5.4. Conclusions 139
6. Final conclusions of the study 141
References 147
Annex 1: CO2 Emissions by sector 151
Annex 2: Emissions by sector 155
Annex 3: Is nuclear clean energy? 159
Annex 4: Food, the hidden key? 162
Annex 5: Case 1 Matlab code 167
Annex 6: Case 2 Matlab code 171
Annex 7: Case 2 figures 179
Annex 8: Case 3 Matlab code 189
Annex 9: Case 3 figures 201
Annex 10: Case 3 figures and data for 18, 71 and 144 homes 214

6
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Summary of figures
Figure 1: Global atmospheric CO2 concentration _________________________________________________ 21
Figure 2: Temperature Anomaly _______________________________________________________________ 21
Figure 3: Average Temperature anomaly ________________________________________________________ 22
Figure 4: Status of net-zero carbon emissions target ______________________________________________ 22
Figure 5: Countries with net-zero target set______________________________________________________ 23
Figure 6: Annual CO2 emissions from fossil fuels by world region ____________________________________ 24
Figure 7: Annual CO2 emissions, 2020 __________________________________________________________ 24
Figure 8: Greenhouse emissions per capita, 2018 _________________________________________________ 25
Figure 9: Global greenhouse gas emissions by sector ______________________________________________ 26
Figure 10: Global greenhouse gas emissions by sector _____________________________________________ 27
Figure 11: Primary energy consumption_________________________________________________________ 29
Figure 12: Electricity access in the World, 2019 ___________________________________________________ 29
Figure 13: Electricity consumption by source _____________________________________________________ 30
Figure 14: Global primary energy consumption by source __________________________________________ 31
Figure 15: Difference between electricity and energy ______________________________________________ 31
Figure 16: Primary energy consumption from fossil fuels and non-carbon technologies ___________________ 32
Figure 17: Number of deaths by risk factor, 2019 _________________________________________________ 33
Figure 18: Primary energy from low-carbon sources, 2020 __________________________________________ 33
Figure 19: Energy consumption per capita by source, 2020 _________________________________________ 34
Figure 20: Energy from low-carbon sources, 2020 _________________________________________________ 35
Figure 21: Energy production from wind, 2021 ___________________________________________________ 35
Figure 22: Solar power generation _____________________________________________________________ 36
Figure 23: Installed solar energy capacity, 2020 __________________________________________________ 37
Figure 24: Installed solar energy capacity, Spain, 2020 _____________________________________________ 38
Figure 25: Battery electric vehicles, Europe, 2019 _________________________________________________ 39
Figure 26: Battery electric and Plug-in Hybrid vehicles, Europe, 2019 _________________________________ 39
Figure 27: Lithium-ion batteries prices __________________________________________________________ 40
Figure 28: Smart grid scheme illustration _______________________________________________________ 44
Figure 29: Block diagram system Case 1 and Case 2 - Single phase ___________________________________ 51
Figure 30: Single-phase inverter: (a) General block diagram and (b) blocks forming the Solar/EV inverter. ___ 51
Figure 31: Block diagram of the single-phase Solar and EV Inverter control ____________________________ 53
Figure 32: IGBT bridge for Solar and EV inverter __________________________________________________ 53
Figure 33: PI Block diagram of the single-phase Inverter control _____________________________________ 54
Figure 34: Delay to get 100% of reactive power __________________________________________________ 54
Figure 35: Block diagram of Solar active and reactive control _______________________________________ 55
Figure 36: Block diagram of EV active and reactive control _________________________________________ 56
Figure 37: Three-Phase System Scheme _________________________________________________________ 56
Figure 38: Three-phase Inverter location ________________________________________________________ 57
Figure 39: Three-Phase Inverter Control, Essential variables ________________________________________ 58
Figure 40: Alpha-Beta Three-Phase Inverter Control _______________________________________________ 59
Figure 41: Power and Control Loop Block, Three-phase Inverter______________________________________ 60
Figure 42: Current Loop Controller, Three-phase Inverter ___________________________________________ 61
Figure 43: Alfa and Beta controller, Three-phase inverter ___________________________________________ 62
Figure 44: SVM Control Block, Three-phase Inverter _______________________________________________ 62
Figure 45: SVM adapter before pulses generation, Three-phase Inverter ______________________________ 63
Figure 46: 3 Half-Bridge switching triggered by Pulses Block, Three-phase Inverter ______________________ 63
Figure 47: Simulink system Case 1 and Case 2 - Single phase ________________________________________ 65
Figure 48: Simulink Solar and EV Inverter model - Single phase ______________________________________ 66

7
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 49: Block 1, measures Single-phase Inverter ________________________________________________ 67


Figure 50: Block diagram & Simulink Model of single-phase Solar and EV Inverter control ________________ 68
Figure 51: Half-Bridge IGBTs Switching, Single-phase Inverter _______________________________________ 68
Figure 52: Repeating Sequence configuration for IGBT trigger signals _________________________________ 69
Figure 53: P&Q references block - Solar inverter __________________________________________________ 70
Figure 54: P&Q references block - EV inverter ____________________________________________________ 70
Figure 55: P&Q references block - reactive absorption _____________________________________________ 71
Figure 56: P¬Q references block, sign modification ________________________________________________ 71
Figure 57: Solar Inverter constants from P and Q control boxes ______________________________________ 72
Figure 58: EV Inverter constants from P and Q control boxes ________________________________________ 73
Figure 59: Reactive delay introduction __________________________________________________________ 73
Figure 60: Active and reactive power generated, Block 5, single phase inverter _________________________ 75
Figure 61: Configuration of Grid(3), Single-Phase _________________________________________________ 75
Figure 62: Average consumption profile in a single house in Spain in the year 2019 ______________________ 76
Figure 63: Load Sequence Control _____________________________________________________________ 76
Figure 64: Resistance House Profile ____________________________________________________________ 78
Figure 65: Load Sequence introduction _________________________________________________________ 79
Figure 66: Energy production curve ____________________________________________________________ 80
Figure 67: Power References introduction to the repeating sequence, Solar and EV, Single-phase Inverter ___ 81
Figure 68: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 – Scenario 1 __________ 82
Figure 69: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 – Scenario 2 __________ 83
Figure 70: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 - Non self-generation ___ 83
Figure 71: Active and Reactive power generation of Grid (H1) – All Scenarios - Case 1 ___________________ 84
Figure 72: Apparent power generation of Grid (H1) - 3 All Scenarios - Case 1___________________________ 84
Figure 73: Active and Reactive Energy produced (H1) – All Scenarios - Case 1 __________________________ 85
Figure 74: Apparent Energy produced (H1) - 3 simulation scenarios - Case 1 ___________________________ 85
Figure 75: Spanish Law, variation of the supply voltage ____________________________________________ 86
Figure 76: Relation between load sequence and voltage variation through inductance___________________ 86
Figure 77: Voltage variation across grid inductance - 3 Scenarios - Case 1: _____________________________ 87
Figure 78: Simulink Case 2 ___________________________________________________________________ 88
Figure 79: P and Q from each phase in Scenario 1 (Reactive absorption) - Case 2 ________________________ 90
Figure 80: P and Q from each phase in Scenario 2 (Reactive injection) - Case 2__________________________ 90
Figure 81: P and Q from each phase in Scenario 3 (non-self-generation) - Case 2 ________________________ 91
Figure 82: Apparent power phase grid - Case 2 __________________________________________________ 91
Figure 83: Total P&Q power phase grid - Case 2 _________________________________________________ 91
Figure 84: Active, Reactive and Apparent energy each phase - Case 2 ________________________________ 92
Figure 85: Sum of Active, Reactive and Apparent energy grid - Case 2 ________________________________ 92
Figure 86: Voltage variation across grid inductance - Scenarios 1 (Reactive absorption) - Case 2 ___________ 93
Figure 87: Voltage variation across grid inductance - Scenarios 2 (Reactive injection) - Case 2 _____________ 94
Figure 88: Voltage variation across grid inductance - Scenarios 3 (non-self-generation) - Case 2 ___________ 94
Figure 89: Voltage through inductance variation, P&Q grid power from the phase A and Load sequence House 1
- Case 2 __________________________________________________________________________________ 95
Figure 90: Case 3 System Scheme ______________________________________________________________ 97
Figure 91: Complete Case 3 Simulink Model _____________________________________________________ 98
Figure 92: Essential blocks scheme and Simulink model, Case 3 ______________________________________ 99
Figure 93: Voltage and Current variables Simulink _______________________________________________ 100
Figure 94: Currents read, filter values and the structure of the model - Case 3 _________________________ 100
Figure 95: Control general block, Case 3 _______________________________________________________ 101
Figure 96: 3 main sub-blocks of the general control block, Case 3 ___________________________________ 101

8
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 97: Alpha-Beta control Three-phase Inverter, Case 3 ________________________________________ 102


Figure 98: Clarke transform Alpha-Beta Control with Equations 2 and 3, Case 3 ________________________ 102
Figure 99: Instantaneous power is calculated by alfa-beta values with Equation 4, Case 3 _______________ 102
Figure 100: LPF Matlab Simulation ____________________________________________________________ 103
Figure 101: Power and Current Loop Block, Case 3 _______________________________________________ 103
Figure 102: Repeating Sequence of active and reactive powerhouse, Case 3 __________________________ 104
Figure 103: Reference Current calculation with Equation 6 ________________________________________ 104
Figure 104: Current Loop block, dalfa and dbeta generation - Case 3 ________________________________ 105
Figure 105: PRES alfa and beta controller, Case 3 ________________________________________________ 105
Figure 106: Resonant Integrator Filter introduced by Code with equation 7 ___________________________ 105
Figure 107: P and Q from each phase in Scenario 1 (Reactive absorption) - Case 3 ______________________ 109
Figure 108: P and Q from each phase in Scenario 2 (Reactive injection) - Case 3________________________ 109
Figure 109: Comparison between the absolute reactive energy value generated from each phase of Scenario 1
(blue) and Scenario 2 (red) in kVArh ___________________________________________________________ 110
Figure 110: Difference between reactive power from scenario 1 and scenario 2 in absolute value _________ 111
Figure 111: P and Q from each phase in Scenario 3 (non-self-generation houses) - Case 3 ________________ 111
Figure 112: Active (P) and Reactive (Q) power generated in the 3 Scenarios - Case 3 ____________________ 112
Figure 113: Active & Reactive Energy produced in each scenario - Case 3 _____________________________ 113
Figure 114: Apparent Energy produced in each scenario - Case 3____________________________________ 113
Figure 115: Active and Reactive Energy Generated by Case 3 with 18 Homes _________________________ 115
Figure 116: Active and Reactive Energy Generated by Case 3 with 72 Homes (x4) ______________________ 115
Figure 117: Active and Reactive Energy Generated by Case 3 with 144 Homes (x8) _____________________ 115
Figure 118: Apparent Energy Generated by Case 3 with 18 Homes __________________________________ 116
Figure 119: Apparent Energy Generated by Case 3 with 72 Homes (x4) _______________________________ 116
Figure 120: Apparent Energy Generated by Case 3 with 144 Homes (x8) ______________________________ 116
Figure 121: Active Power Relation with the nº of homes __________________________________________ 117
Figure 122: Reactive Power Relation with the nº of homes _________________________________________ 117
Figure 123: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase A - Case 3 _______ 118
Figure 124: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase B - Case 3 _______ 119
Figure 125: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase C – Case 3 ______ 119
Figure 126: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase A – Case 3 ______ 120
Figure 127: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase B – Case 3 ______ 120
Figure 128: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase C – Case 3 ______ 121
Figure 129: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase A – Case 3 ______ 121
Figure 130: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase B – Case 3 ______ 122
Figure 131: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase C – Case 3 ______ 122
Figure 132: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase A – Case 3 ______________________________________________________ 123
Figure 133: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase B – Case 3_______________________________________________________ 124
Figure 134: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase C – Case 3 _______________________________________________________ 124
Figure 135: Three- Phase Voltage Grid Source, Block Parameters ___________________________________ 127
Figure 136: Case 4, Voltage sags Scenario 1 (reactive absorption) – Range Time 1 ______________________ 129
Figure 137: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 1 _______________________ 130
Figure 138: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 1 _____________________ 131
Figure 139: Case 4, Voltage sags Scenario 2 (reactive absorption) – Range Time 2 ______________________ 132
Figure 140: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 2 _______________________ 133
Figure 141: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 2 _____________________ 134

9
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 142: Case 4, Voltage sags Scenario 2 (reactive absorption) – Range Time 3 ______________________ 135
Figure 143: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 3 _______________________ 136
Figure 144: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 3 _____________________ 137

Summary of Annexes Figures


Figure A1: Global greenhouse gas emissions by sector, Annex 1 ____________________________________ 151
Figure A2: Greenhouse gas emissions by sector, Annex 2 __________________________________________ 155
Figure A3: CO2 emissions by sector Per capita from China in 2018, Annex 2 ___________________________ 155
Figure A4: CO2 emissions by sector Per capita from USA in 2018, Annex 2 ____________________________ 156
Figure A5: CO2 emissions by sector Per capita from EU in 2018, Annex 2 _____________________________ 157
Figure A6: CO2 emissions by sector Per capita from Spain in 2018, Annex 2 ___________________________ 157
Figure A7: Number of deaths by risk factor in 2019, Annex 3 _______________________________________ 159
Figure A8: Safest and cleanest sources of energy, Annex 3 _________________________________________ 160
Figure A9: Death rates from energy production per TWh, Annex 3 __________________________________ 160
Figure A10: Nuclear Power Generation, Annex 3 _________________________________________________ 161
Figure A11: Greenhouse gas emissions from food production, Annex 4 _______________________________ 162
Figure A12: Global greenhouse gas emissions by gas, Annex 4 _____________________________________ 164
Figure A13: Deforestation produced by food category, Annex 4 _____________________________________ 165
Figure A14: Greenhouse gas emissions across the supply chain, Annex 4 _____________________________ 166
Figure A15: Power from House 1, Scenario 1 - Case 2 _____________________________________________ 179
Figure A16: Power from House 2, Scenario 1 - Case ______________________________________________ 179
Figure A17: Power from House 3, Scenario 1 - Case 2 _____________________________________________ 180
Figure A18: Voltage variation House 1 phase A, Scenario 1 - Case 2 _________________________________ 180
Figure A19: Voltage variation House 2 phase B, Scenario 1 - Case 2 _________________________________ 181
Figure A20: Voltage variation House 3 phase C, Scenario 1 - Case 2 _________________________________ 181
Figure A21: Power from House 1, Scenario 2 - Case 2 _____________________________________________ 182
Figure A22: Power from House 2, Scenario 2 - Case 2 _____________________________________________ 182
Figure A23: Power from House 3, Scenario 2 - Case 2 _____________________________________________ 183
Figure A24: Voltage variation House 1 phase A, Scenario 2 - Case 2 _________________________________ 183
Figure A25: Voltage variation House 2 phase B, Scenario 2 - Case 2 _________________________________ 184
Figure A26: Voltage variation House 3 phase C, Scenario 2 - Case 2 _________________________________ 184
Figure A27: Power from House 1, Scenario 3 - Case 2 _____________________________________________ 185
Figure A28: Power from House 2, Scenario 3 - Case 2 _____________________________________________ 185
Figure A29: Power from House 3, Scenario 3 - Case 2 _____________________________________________ 186
Figure A30: Voltage variation House 1 phase C, Scenario 3 - Case 2 _________________________________ 186
Figure A31: Voltage variation House 2 phase C, Scenario 3 - Case 2 _________________________________ 187
Figure A32: Voltage variation House 3 phase C, Scenario 3 - Case 2 _________________________________ 187
Figure A33: Load profiles Houses 1, 2 and 3 - Case 2 ______________________________________________ 188
Figure A34: Total Apparent Power system, Scenarios 1, 2 and 3 - Case 2 _____________________________ 188
Figure A35: Active and Reactive power (left) and accumulated energy (right) of COMB 1 for the 3 scenarios -
Case 3___________________________________________________________________________________ 201
Figure A36: Apparent power and accumulated active energy of COMB 1 for the 3 scenarios - Case 3 _______ 202
Figure A37: Active and Reactive power (left) and accumulated energy (right) of COMB 2 for the 3 scenarios -
Case 3___________________________________________________________________________________ 203
Figure A38: Apparent power and accumulated active energy of COMB 2 for the 3 scenarios - Case 3 _______ 204
Figure A39: Active and Reactive power (left) and accumulated energy (right) of COMB 3 for the 3 scenarios -
Case 3___________________________________________________________________________________ 205
Figure A40: Apparent power and accumulated active energy of COMB 3 for the 3 scenarios - Case 3 _______ 206

10
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A41: Active and Reactive power (left) and accumulated energy (right) of COMB 4 for the 3 scenarios -
Case 3___________________________________________________________________________________ 207
Figure A42: Apparent power and accumulated active energy of COMB 4 for the 3 scenarios - Case 3 _______ 208
Figure A43: Active and Reactive power (left) and accumulated energy (right) of COMB 5 for the 3 scenarios -
Case 3___________________________________________________________________________________ 209
Figure A44: Apparent power and accumulated active energy of COMB 5 for the 3 scenarios - Case 3 _______ 210
Figure A45: Active and Reactive power (left) and accumulated energy (right) of COMB 6 for the 3 scenarios -
Case 3___________________________________________________________________________________ 211
Figure A46: Apparent power and accumulated active energy of COMB 6 for the 3 scenarios - Case 3 _______ 212
Figure A47: Active and reactive power per phase (18 houses), Scenario 1 - Case 3 ______________________ 214
Figure A48: Active and reactive power per phase (72 houses), Scenario 1 - Case 3 ______________________ 214
Figure A49: Active and reactive power per phase (144 houses), Scenario 1 - Case 3 _____________________ 215
Figure A50: Active and reactive power per phase (18 houses), Scenario 2 - Case 3 ______________________ 215
Figure A51: Active and reactive power per phase (72 houses), Scenario 2 - Case 3 ______________________ 216
Figure A52: Active and reactive power per phase (144 houses), Scenario 2 - Case 3 _____________________ 216
Figure A53: Active and reactive power per phase (18 houses), Scenario 3 - Case 3 ______________________ 217
Figure A54: Active and reactive power per phase (72 houses), Scenario 3 - Case 3 ______________________ 217
Figure A55: Active and reactive power per phase (144 houses), Scenario 3 - Case 3 _____________________ 218

11
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Summary of tables
Table 1: Constants and variables values for single-phase inverter control ______________________________ 74
Table 2: Standardized Electrical Power (kW) _____________________________________________________ 76
Table 3: Formula and profile sequence for the Load _______________________________________________ 77
Table 4: Main parameters Case 1 ______________________________________________________________ 78
Table 5: Solar and Electric vehicle production table - Case 1 ________________________________________ 80
Table 6: Solar and Electric vehicle production table - Case 2_________________________________________ 89
Table 7: Main Power House variables, Case 2 ____________________________________________________ 89
Table 8: Solar and Electric vehicle production table - Case 3________________________________________ 107
Table 9: Summary of the load, solar and reactive power of each house _______________________________ 108
Table 10: Total Active Energy comparison ______________________________________________________ 114
Table 11: Total Reactive Energy comparison ____________________________________________________ 114
Table 12: Summary table from Case 3 simulations _______________________________________________ 117

12
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Summary of Equations
Equation 1: Solar Power, Single-Phase Inverter ___________________________________________________ 52
Equation 2: Voltage Clarke Transform, Three-phase Inverter ________________________________________ 58
Equation 3: Current Clarke Transform, Three-phase Inverter ________________________________________ 59
Equation 4: Instantaneous Active and Reactive Power, Three-phase Inverter ___________________________ 59
Equation 5: Power reference calculation, Three-phase Inverter ______________________________________ 60
Equation 6: Reference Currents Calculation, Three-phase Inverter ____________________________________ 61
Equation 7: Alfa and Beta Tustin Controller Transformation, Three-phase Inverter ______________________ 62
Equation 8: Maximum reactive power provided by the Inverter equation, Single-phase___________________ 69
Equation 9: Single Home Load [ohm] equation ___________________________________________________ 77
Equation 10: Single Home Load equation as a function of "n" _______________________________________ 77
Equation 11: Apparent Power formula __________________________________________________________ 91

13
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

14
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

1. Introduction
With this work I would like to show, which would be the impact of using the inverters installed
in solar installations and electric vehicles from single-family houses, to support the grid. This
backing will be done with reactive injection and absorption.

The study consists of the simulation of several cases where each one will be simulated in 3
different situations: injecting reactive power, absorbing reactive power and without self-
generation. In all cases they will be single-family houses where they will have photovoltaic
generation and/or electric cars. Also, every situation is going to be evaluated in three different
parasitic grid inductances. At the same time, analyze the pros and cons of a distributed power
generation grid compared to a grid without self-generation.

To make this study the main programs used have been Matlab, Matlab-Simulink and Excel.
Matlab has been used for the simulations and calculation. Excel has been implemented to
show or graph the data obtained through Matlab.

1.1. Main objectives


The main objectives of this project are:
- Analyze and comprehend the impact of solar panels & electric vehicles in the public grid.
- See which reactions have the public grid due to active power.
- See which reactions have the public grid due to reactive power injection and absorption.
- See the results using different grid inductance values.
- Compare a complete model with and without distributed power generation through solar
panels and electric vehicles and, at the same time, differentiating reactive power injection
and absorption.
- Analyze if a distributed power generation grid could support the public grid through
reactive power with variations in the voltage fundamental components.
- Analyze and understand the advantages and disadvantages of a distributed generation
system.

15
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

1.2. Antecedents
For this work, the main reference studies have been those cited below. In the case of the
three-phase inverter, it had been used and improved the model seen in different subjects of
the university, which is why there are not many external references to it. In the case of the
single-phase inverter, it has been necessary. Without further ado, the contribution of each
report in this work will be explained below.
First of all, the document [1] on microgrids was read, which explains very well what their
structure, advantages and disadvantages should be. This document has been used to
organize the Simulink blocks and to have a basic idea of what a smart grid or micro grid is. To
make the single-phase inverter models, the documents [2], [3] and [4] have been used. In
them an explanation of how these inverters should be for solar panels is made. The bases of
the models proposed by these documents have been adapted for this work and reused for the
electric vehicle. It had been also considered the analysis of the effects of these inverters on
the grid. Finally for the three-phase inverter, although the base material has been the one
used in several subjects of the university degree, the documents [5] and [6] have served to
see interesting proposals on how to control the inverters from a simple and precise PQ control
strategy. The explanation of the control through block diagrams was of great help to improve
and better understand the PQ control. All of them are focused on control, but they have not
explored or quantified how much more or less energy a grid with single-family houses with
self-generation and electric vehicles would need, what would happen if the inverters absorbed
or injected the maximum reactive power. Another issue mentioned, but not addressed, would
be the usefulness of inverters using reactive power to stabilize the grid. All these points will be
addressed in this work.
1.3. Personal motivation
I decided to choose this topic because it is still an area of continuous research and presents
a great importance in modernizing our electrical grid. The smart grid sector is a field of study
that I would like to pursue professionally, as it will be of great importance in the future. If the
applications that the inverters used in solar panels and electric vehicles will have been studied,
society will be able to develop better systems for the electric grid and contribute to the
reduction of our carbon footprint on the planet. I was interested in doing a research work rather
than other themes. In my current job, I am developing reports and participating in research on
solar inverters and the injection or absorption of energy into the grid. So doing a project that
touched on this topic was very interesting on a personal level. Also, this last year I have read
quite a few books about sustainability concepts or renewable energies such as Bill Gates'
latest book "How to avoid a climate disaster" or Vaclav Smil's "Numbers don't lie". All these
readings apart from improving my knowledge, have made me want to investigate more about

16
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

renewables and electric vehicles .Finally, I would like to say that this work has helped me to
learn and to have an informed opinion about the advantages and disadvantages of solar
energy or electric vehicles.

1.4. Work Structure


The structure of this work is based on the following list of chapters where several topics will
be presented:
Chapter 2, Context: This chapter will explore in a general way the problems of climate
change, there will be an analysis of CO2 emissions and the main causes. It will also discuss
the current situation of energy generation, with emphasis on solar energy. The electric car will
be discussed together with the concept of "Smart Grids". Finally, an explanation on how
reactive power can help the grid will be developed. At the same time, there will be annexes in
this chapter for more in-depth information, data or graphs.
Chapter 3, System Description: first there will be a short introductory section on the
main objectives of the simulations and how they will be structured. Then, the different controls
used for the three-phase and single-phase inverters will be explained.
Chapter 4, Cases of studying: here the different case studies will be developed,
explaining how they work and justifying the results obtained. There will be a total of 3 cases
where in each of them screenshots, codes used and theoretical explanations will be used to
make the reader understand each of the cases to be studied. The first case corresponds to a
single-family house with solar self-generation and an electric vehicle connected to the grid
through a single-phase inverter. The second case will be the same as the first but with 3
houses. Finally, the third case will be 18 houses as in the first and second case, connected to
the grid through a three-phase inverter. Each case will be analyzed in 3 scenarios: scenarios
1 and 2 contain houses with solar panels and electric vehicles. Scenario 1 corresponds to
when the inverters absorb reactive power, scenario 2 when they inject it and scenario 3, when
the houses have neither self-generation and electric vehicles installed.
Chapter 5, Response of Case 3 subjected to voltage sags: In this chapter, case 3
explained in chapter 4 is re-analyzed, subjected to voltage sags at different times of the day
to see how the system behaves and what influence the reactive power has on the system's
performance.
Chapter 6, Final conclusions of the study: Finally, as indicated by its name, this
chapter contains the conclusions of the study. A comparison will also be made with the main
objectives set out above and possible ideas for a possible continuation of the study will be
proposed.
All the sources of information used for the study will be disclosed in the references section.
The annexes at the end of the document will also be available.

17
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

18
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

2. Context
Many historians and scientists agree that humans have evolved when energy has been
developed. First it was fire, then motion energy using rivers and wind, then fossil fuels, nuclear
energy and finally renewables. Experts agree that the key to taking the next step as a species
is once again energy. Up to now, humans have obtained almost everything basically by
burning fuels and polluting. At the beginning there was no problem, since there were not many
of us, but with the exponential growth of the population and an improvement in basic needs,
an increase in products and consumption, all this makes us need more energy. The perfect
solution would be to find nuclear fusion energy, but this seems to be a long way off. So, what
can society do with the knowledge and currently technologies that have and avoid a climate
collapse? Whatever it is, the key is energy [7].

The climate change emergency is accelerating the diversification of energy generation.


Technology in the last 10 years has reduced and lowered the prices of solar panels and electric
car batteries. Due to these price reductions, the latest editions of COP conferences
(Conference of the Parties) and the increased environmental awareness, humanity has to
reinvent itself using all the tools available, and one of the most important is energy generation.
Other factors outside the environment are also driving the modernization of the electricity
sector. As is the case with the current invasion of Ukraine by Russia, where one of the main
consequences has been the increase in the price of energy and all related processes and
products. This conflict has shown Europe's energy dependence on Russia, particularly on gas.
Europe has seen that being independent energetically is essential for the economy and for
the territory.

Thanks to the creation of the organization Our World in Data, it has been possible to have
data around the world from different sectors, including energy. Thanks to the organization, it
can be seen in the form of graphics and tables what is happening around the world. This is
why now, it is known that the energy sector generates around 75% of global CO2 emissions.
Although these emissions are more limited in the USA and the European Union, it should be
remembered that the burning of fossil fuels, such as coal or gas, continues to be the most
widely used resource for energy production. In addition, the use of fuels such as oil and gas,
their production and refining, is responsible for at least one third of global CO2 emissions.

Knowing the impact of power generation in our blue globe, by taking advantage of cheaper
generation model for one in which the energy is more distributed, more environmentally
friendly and smart.

19
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

2.1. Climate Change


Probably the biggest challenge for our society from now until the future will be the "fight"
against climate change. This challenge will demand changes in daily habits, political
agreements on a worldwide level and improvement in our technologies, especially power
generation. At the same time, trying to mitigate and adapt to climate change. To make it simple
and visual, the data presented below is a little summary of the most important aspects about
climate change using the graphics of the website Our World in Data. Which is the institution
with the most support and references in data on global issues, including the participation of
the 2 most prestigious universities in the world (Oxford and Harvard). Because of the Covid-
19 pandemic, most of the graphs do not cover the period from 2020 to 2022. For this reason,
the most cited and referenced graphs have been chosen, most of which correspond to 2018,
2019 and 2020.

2.1.1. CO2 Emissions


One of the most repeated arguments against climate change is that the CO₂ concentration is
something natural and normal. Throughout the earth's entire history, there have been cycles
where there was a lot of CO₂ in the atmosphere. It is true that the earth has experienced cycles
of vulcanization and other phenomena that have arisen and caused large amounts of CO₂ in
the atmosphere. However, they were natural phenomena, the problem currently is that
according to data supported by the following graph, nowadays, there is the highest
concentration of CO₂ in history and not by natural phenomena, but by human activity as
corroborated in the Figure 1.

These unusual concentrations of CO₂ in our global atmosphere cause major problems
worldwide, largely due to temperature changes (Figure 2 and Figure 3), and it is something
that all of us could see because every year the winter is more extreme and it rains less.

To reverse this situation, all countries have to be involved, but unfortunately this is not the
case so far, as it can be seen in the following map, only Europe together with other countries
are committing themselves with laws and objectives to solve this global problem and achieve
a zero emissions policy. There are many countries that say they will do it, but in reality, there
are very few that have these commitments in their laws, among which Spain can be found
(Figure 4).

20
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 1: Global atmospheric CO2 concentration

Figure 2: Temperature Anomaly

21
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 3: Average Temperature anomaly

Figure 4: Status of net-zero carbon emissions target

22
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 5: Countries with net-zero target set

There are only 7 countries that have already achieved that goal (Figure 4) even though these
are Third World countries, meaning that the energy consumes or industry is not as developed
as in Figure 5, the first world countries like the USA or Germany, Meanwhile, the highlighted
regions have the objective of 0 emissions on their to-do lists.

Figure 6 displays the annual CO2 emissions from fossil fuels around the world, where it could
reaffirm that the European Union in terms of population and rich countries is the least polluting
area. China generates the most, the problem is that it is increasing every year, that is
something that North America and Europe in general have not experienced in the last few
years. But if the data check is performed only with Figure 7, an error occurs because there
could be an incorrect idea of CO2 emissions due to not comparing the emissions with the
number of inhabitants of each region. For that reason, the best bay to compare date is by
using the last official data of annual emissions and Per capita gas emissions with Figure 8.

23
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 6: Annual CO2 emissions from fossil fuels by world region

Figure 7: Annual CO2 emissions, 2020

24
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 8: Greenhouse emissions per capita, 2018

It is seen in Figure 8 that even though in terms of annual emissions, China is the country that
generates more pollution, but in terms of per capita it has similar values like Spain or Europe.
Another interesting aspect is that France, due to their 70% energy mix generated by nuclear
power, pollutes less than Germany where lately, they implement a policy of closing their
nuclear reactors. All this data has to be taken as a general idea, not as the unique truth, but
still, it is important to know these numbers and have a global perspective.

2.1.2. CO2 Emissions by sector


Now that there has been a discussion around the global emissions, let’s detail where these
emissions come from. Knowing that a major part of the energy production is generated by
fossil fuels, the Figure 9 is going to be about the emissions by sector of greenhouse gasses.
To succeed in limiting global warming and global emissions, the world urgently needs to use
energy more cleanly and efficiently. The global climate is changing and it is an increasingly
severe risk for ecosystems, human health and also for the economy.

25
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 9: Global greenhouse gas emissions by sector

As shown in Figure 9, emissions come from many sectors, in the same way, many solutions
are required to decarbonize the economy. It is clear from Figure 9, that a range of sectors and
processes contribute to global emissions. This means there is no single or simple solution to
tackle climate change. Focusing on electricity, or transport, or food, or deforestation alone is
insufficient. Even within the energy sector – which accounts for almost three-quarters of
emissions. Even if the societies could fully decarbonize our electricity supply, it will also be
necessary to electrify all of our heating and road transport. With all this measures, countries
would still have to reduce the emissions from shipping and aviation, which unfortunately, there
is not yet a low-carbon technology. To reach net-zero emissions, many sectors would need
innovations across. Single solutions will not get the societies there. There is a phrase for
situations like this: for complex problems, complex solutions. Even though, Figure 9 let see
that Energy accounts for the largest share of the pie, with 73% of the global emissions.

26
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 10: Global greenhouse gas emissions by sector

Within this 73%, energy use in industry, transport and electricity usage for buildings are the
biggest contributors. Seeing the data, it is easy to say that at the core of these challenges is
the question of energy — more precisely, the overall energy consumption and the dependency
on fossil fuels.1
2.1.3. Energy Mix
Before going into more detail on the energy mix, it is important to know for what energy is
used, this information is easily displayed by Figure 10 of greenhouse gas emissions by sector,
where worldwide, the main category is heat and power, followed by transportation.
That is why it is so important to reduce emissions from electricity, because it is a major part of
the cake. That does not mean governments should leave the rest like they are actually, but
the main focus should be energy generation and transport.2
Now that energy is presented, let’s see how it is generated. Today the energy mixes are
composed of a diverse range of sources, mainly coal, oil, gas, nuclear, hydropower, solar,
wind, and biofuels. Nevertheless, a couple of centuries ago, the energy mixes were relatively
homogeneous. In the 19th century, the energy came from traditional biomass as the dominant
source of energy used across the world. Biomass in that century was the burning of solid fuels
such as wood, crop waste, or charcoal. But with the Industrial Revolution came the rise of

1
For further information, go to Annex 1 where there is more information and delve more deeply into
the greenhouse gas emissions by sector.
2
For further information, go to Annex 2 where there is a comparison between China, USA and EU

27
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

coal; followed by oil, gas; and by the turn of the 20th century, hydropower. Nuclear energy
was added to the mix in the 1960s. The newest renewable energies, like solar and wind, were
only added in the 1980s and in the last 20 years they have experienced a huge revolution.
According to scientist Vaclav Smil and other researchers studying long-term energy
transitions, the speed and scale of the energy transition needed today in switching from fossil
fuels to low-carbon energy is therefore a new challenge, very different from the past. Mainly
because the energy landscape expected to see in 2050 will be quite different from how it looks
today. Meeting future energy demand will be a key challenge.

According to World Energy Council two main energy scenarios have been described This
document considers two main scenarios in his document World Energy Scenarios Composing
energy futures to 2050:

- SYMPHONY: It has a focus on achieving environmental sustainability through


internationally coordinated policies and practices

- JAZZ: It has a focus on energy equity with priority given to achieving individual access
and affordability of energy through economic growth.

Averaging the values of both scenarios, the world’s population will increase approximately
from 7 billion in 2013 to approximately 9 billion in 2050, which is equal to a 36% increase. The
GDP per capita will also increase from slightly more than 9,000 US$ 2010 in to approximately
23,000 US$ in 2050. This represents an increase by 153% and 100%, respectively. Mobility
will also increase, with car ownership in terms of cars per 1000 people increasing from 124 in
2010 to 244 in 2050.

All these means more consume leading to more energy. Total global primary energy
consumption, averaged over both scenarios, will be approximately increase 45% [29]. Figure
11 shows that the 3 emerging regions of the planet (Africa, India and China) are increasing
year by year. Besides that, Europe and developed countries tend to reduce their consumption
or do not experience such a large increase.

28
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 11: Primary energy consumption

Figure 12: Electricity access in the World, 2019

Global primary energy consumption is expected to continue to increase, but at a much slower
rate than in previous decades. Also, the electricity access (Figure 12) will increase and
probably reach the minimum of 80% in the entire world.

29
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 13: Electricity consumption by source

With all these in mind and knowing that energy represents 73% of the global emissions, it is
clear that society has a lot to work on. The latest data about the global energy consumption
shows that the primary energy consumption is still too dependent on Gas, Oil and Coal (Figure
13). Also, other information that can be extracted from the Figure 13 is that the energy
consumption, before the pandemic, has been constantly increasing.

More than 80% of the energy still comes from fossil fuels. Since three-quarters of global
greenhouse gasses come from energy – the burning of coal, oil and gas – experts and
scientists are saying to governments the need to rapidly transition away from them to low-
carbon sources like renewable and nuclear. The majority of the world’s energy still comes from
fossil fuels. In 2019, 84% of global energy came from fossil fuels, only 1.8% less than in the
year 2000 [Figure 14]. In Figure 14, it highlights that low-carbon energy accounted for only
16% – around 11% from renewables and just over 4% from nuclear energy.

30
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 14: Global primary energy consumption by source

Figure 15: Difference between electricity and energy

One of the reasons that the energy mix is so dominated by fossil fuels is that transport and
heating are often harder to decarbonize than electricity. Transport relies heavily on oil; and
heating on gas. There are fewer energy options available to substitute in these sectors and
specially in poor countries. However, in Figure 15 shows electricity tends to have a higher
share of low-carbon sources.

One-third of global electricity came from nuclear or renewables, more than double the share
in the total energy mix, at 16%. This provides one important pathway for progress: if some
activities can shift towards electricity like transportation, a great progress on decarbonization
and reduction will be seen.

31
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 16: Primary energy consumption from fossil fuels and non-carbon technologies

Besides that, if society and governments are able to shift oil-dependent transport to
electrification, this will require massive increases in nuclear and renewable generation to make
up for rising demand for electricity and done it sustainable, something that it is not happening
right now as shown in Figure 16.

It could sound weird to say that nuclear energy is clean, but scientifically and statistically
speaking it is true. One of the main factors to reinvent energy mix is due to the deaths
attributed to air pollution, becoming the third risk factor of human deaths in the world as it
indicates in Figure 173. Even though the global energy mix is dominated by fossil fuels, some
countries get more than half of their energy from low-carbon sources, and it is very important
because it means that is possible. Unfortunately, only a handful of countries get around half
or more of their energy from nuclear and renewables. The main examples are Iceland which
is around 80%, Norway and Sweden it is close to 70% and France with 50%. All of these
countries get a significant share of their energy from nuclear power and renewables. The
following Figure 18 shows what has been said and the % of primary energy from low-carbon
sources in 2020.

3 For further information, go to Annex 3 where there is a major explanation and discussion of nuclear
power.

32
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 17: Number of deaths by risk factor, 2019

Figure 18: Primary energy from low-carbon sources, 2020

33
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 19: Energy consumption per capita by source, 2020

Another interesting information is to compare the energy consumption by source per capita in
the main countries or zones of the world and see which are the differences. Fossil fuels
continue to show as the main resources, as shown in Figure 19.

It is interesting to see how certain policies that have been adopted in some countries, such as
Germany, for example, have had an impact. In the last decade in this country, a policy of
dismantling nuclear power plants and replacing them with gas-fired plants has been
implemented. This has resulted in Germany being one of the countries most affected by the
current war between Russia and Ukraine, and at the same time, polluting more than other
countries such as France, characterized by being an openly nuclear country. Politics is very
important as it can play a leading role in issues such as energy.

Even though with the previous graphics it is noticeable to see that fossil fuels are the main
resource, as seen in Figure 20, in the last 10 years there has been a higher percentage of
renewable sources in the energy mix, not including biofuels. These data are encouraging, and
hopefully this trend continues to grow upward in the future. The problem is that energy
demand, as explained above, will also increase in the future.

34
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 20: Energy from low-carbon sources, 2020

Figure 21: Energy production from wind, 2021

35
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 22: Solar power generation

2.1.4. Solar and Wind energy


Now let’s discuss the two main renewable energies, solar and wind, especially solar which is
going to be a huge part of this project. Europe again, as Figure 21 shows, is in good position
and a trend in renewable energy, mainly in wind.
Wind energy is more complex than solar energy, wind turbines are very expensive and their
implementation often causes irreparable damage to the landscape. Besides, it is not windy
everywhere, so it is an energy that can only be placed where it is effective, unlike solar energy
where it can be placed on the roofs of houses. Another important factor is that the great
potential of wind power lies in "offshore" technology, i.e., in the sea. This makes installations
more expensive and makes projects more costly.

Continuing with solar energy, Figure 22 is about the solar generation at scale – compared to
hydropower, for example – is a relatively modern renewable energy source but is growing
quickly in many countries across the world. Its growth is focused on Asia (India and China),
the United States and Europe (as Figure 23 shows), where Spain is set to be a very important
country in respect. It is notable in the installed solar energy capacity, where China is becoming
the main generator above the rest of the world.

36
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 23: Installed solar energy capacity, 2020

Note that the Figure 22 is for total capacity, so it is normal that countries with larger populations
generate more solar energy. If a new measurement is made by dividing solar generation by
the country's population If we were to divide the generation by the population of the country,
we will know which country is greener per capita. This is represented in the Figure 23 below.
In Spain, a country with many hours of sunshine and 45 million inhabitants, due to some
policies about the taxes on solar panels and generation, it is perfectly noticeable in the graph,
where it can be seen that in those years that these types of policies were implemented, solar
generation stagnated. A couple of years ago these policies and taxes were modified and since
then the generation has had an exponential growth. This is a clear example of how public
administrations and political parties can influence and delay the progress of an entire country
in terms of technology and energy.
What about food?
There are other factors as Figure 9 shows, and it can be highlight food production because it
is responsible for 20% of global emissions. In the annex number 4 (Food the hidden key?),
there is a little explanation of how our diets and food humanity consume impacts on the earth
and the environment4.

4 For further information, go to Annex 4 where there is a major explanation and discussion about the
impact of our diet on the earth.

37
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 24: Installed solar energy capacity, Spain, 2020

2.1.5. Electric mobility


As it has been shown in Figure 9, transport, together with energy, is the main source of
pollution worldwide. At this point, there is going to be a brief explanation of the global situation
of transport electrification. The newest data from this sector compiled in Figure 25 and Figure
26, shows a clear tendency in the north countries of Europe for the electric or hybrid vehicle.

Unfortunately, there is no contrast or official information about China with electric vehicles, but
the world knows that China is the main producer of batteries and electric vehicles, and the
sales data says that China is the country that has more electric vehicles.

38
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 25: Battery electric vehicles, Europe, 2019

Figure 26: Battery electric and Plug-in Hybrid vehicles, Europe, 2019

39
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 27: Lithium-ion batteries prices

The main problem of electrification in vehicles is the battery, but there are good news in this
sector because the prices of lithium batteries have been reduced by 97% over the years as
Figure 27 shows. Something similar has happened with solar panels, which have also
experienced a significant reduction.

Although electric mobility has concerns with the issue of recharging cars in public
infrastructures, battery life and other factors such as pollution generated by the construction
of an electric car itself, it is necessary to continue working and innovating to achieve a
transition to a sustainable and efficient electric mobility and transportation.

40
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

2.1.6. Conclusions
As conclusions of this general introductory section, it seems that the electrification of transport
and energy are essential to develop in a greener, more sustainable and technological
environment. Also, the necessity of innovation and good policies to help us take that step
forward as a society. Following the World Energy Council study “World Energy Scenarios
Composing energy futures to 2050” mentioned in section 2.1.3 and the little summary of this
complex situation in this introduction, the world energy most probably scenarios and their
solutions to solve it could be:
- More complexity in our Energy systems by 2050.
- Energy efficiency should be crucial in dealing with demand outstripping supply of energy.
- The energy mix in 2050 will mainly be fossil based.
- As right now, there is not going to be a ‘one-size-fits-all’ solution to energy, probably the best
solution is going to be a mix of technologies.
- The global economy will be challenged with a higher population and unacceptable carbon
prices for Third World countries.
- A low-carbon future is not only linked to renewables: carbon capture, utilization and storage
is important as well as consumer behavior requires changing.
- Solar energy and energy storage are the key uncertainties up to 2050 due to their lack of
capacity for generating energy in big quantities. Even so, the mentality should be to install
solar panels on as many roofs as possible.
- Balancing the energy dilemma means making difficult choices.
- It is important to generate energy where it is consumed, the closer the better (such as on the
roofs of houses thanks to solar panels).
- Energy markets require investments and regional integration to deliver benefits to all
consumers and also to generate wealth around the globe.
- Energy policy should ensure that energy and carbon markets deliver their commitments.
- Improvements in public transportation simultaneously with electric vehicles technologies.
- Investigate more in nuclear power and their variations like mini or micro nuclear reactors.
- Be more sustainable in our food production, reducing beef and investigating other
alternatives that are healthier and eco-friendly.

41
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

2.2. Smart Grid


Currently, there is a trend in the electricity industry to avoid centralization in favor of a more
diversified grid to meet consumer needs in a more direct and efficient way. This is why Smart
Grids, a new vision of electricity grids that offer a new way of understanding and managing
electricity more efficiently, have gained in popularity in recent years. Also, due to the climate
emergency explained above, all devices and technologies that work on efficiency and
renewable energies have been on the rise. It is estimated that this technology, together with
others, will allow to reach the main sustainability points established by certain countries. For
example, Spain has established the following:

- 40% reduction in greenhouse gas emissions with respect to 1990.


- 32% of renewables as a percentage of total gross final energy consumption.
- 32.5% improvement in energy efficiency.
- 15% electricity interconnection of Member States.
- 42% of renewables over final energy use.
- 39.5% improvement in energy efficiency.
- 74% of renewable energy in electricity generation.

These points can be found on pages 7-15 of the National Integrated Energy and Climate Plan
2021-2030. In order to meet all the points, grids must be modernized and Smarts Grids will
play a fundamental role. Before the smart grid’s explanation, let's take a brief look at what a
conventional electricity grid is like. The traditional electricity grid is currently the system
responsible for delivering energy to homes. This system is composed of elements responsible
for the generation, transport and distribution of energy, in addition to the control, security and
protection mechanisms. The management model can be summarized model as follows:
- Generation: First, power plants generate electricity from energy sources. Within the
energy sources are non-renewable and renewable sources. These generation plants
are generally located far from populated areas and are usually large-scale.

- Transmission: The transmission electrical grid is responsible for linking the power
plants with the distribution electrical grids, connecting the power plants with the
transformation substations. High-voltage lines are used for long-distance transmission.

- Transformer substations: They provide interconnection of all lines with each other to
deliver the power generated to the power plants at the consumption centers. This
requires a voltage transformation, the energy arrives from the transmission electrical

42
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

grid at high voltage to travel long distances. At the substation, a transformer is used to
reduce this voltage in order to start distribution.

- Distribution electrical grids: These are the approach power lines found in large
consumption centers (cities and industrial facilities of a certain importance). Most of
these lines tend to be overhead, and generally once they reach the urban centers,
subway electrical grids are used.

- Transformer substations: These are responsible for carrying out the final
transformation, reducing the medium-voltage distribution voltage to voltages with
values suitable for low-voltage consumption. The voltage used in Spain ranges from
220V to 380V for domestic use.

- Electricity control center: coordinates in real time the energy demand with the
generation and transmission facilities of the electricity system. With the information
received from the substations, the operation of the electrical system is checked and
makes the needed decisions.

Sending electrical energy through a electrical grid means that some energy is lost in the
process. In the case of transmission and distribution lines, the lost energy varies depending
on factors such as their length, location of generation and demand, technical characteristics
of the equipment, etc. This electricity grid structure, maintained practically since the middle of
the last century, has begun a process of transformation caused by the introduction of
distributed generation (small generation plants located close to consumption). These
generation points are connected directly to the distribution electrical grid and to consumption
(specifically speaking about talking about photovoltaic generation by solar panels and the use
of electric vehicles).

The electric grid has not evolved much since its invention, but current circumstances require
the evolution of the conventional electric grid towards a Smart Grid. These grids have (and
will have) the capacity to transport energy and information in a bidirectional way, having the
ability to integrate renewable energy installations, all controlled by an intelligent control
system. A Smart Grid, in comparison with a traditional grid, adds the digital and domotic
technology necessary for a fluid supply/demand interaction between the installation and the
user or public grid. Thanks to these types of grids, it will be possible to calculate in real time
the electricity needed in order to produce or inject only the amount that will be used.

43
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 28: Smart grid scheme illustration

Therefore, smart grids are based on the use of sensors, communication systems and must be
able to compute and control data in order to make the most appropriate decisions in time.
Could lead to obtaining a more efficient, economical and reliable supply. They become
"intelligent" when they are able to make more efficient decisions in real time in the face of
fluctuations. These electrical grids will be able to make electric cars behave like a battery,
which would lead to absorb or give energy to the grid while it is plugged in, thus improving the
efficiency of generation and optimizing the installation. Everything connects to each other to
add up the benefits [Figure 28].

An example of the many applications that have these devices would be to put the washing
machine at 4 am, the price of kWh is lower than at peak hours and also at that time there is
not so much electrical demand from the electrical grid, making this small movement the
electricity bill is reduced and also consumption and electricity peaks. Another example would
be with the solar energy surplus: the Smart Grid would automatically take this energy and
send it, for example, to the next-door neighbor who for whatever reason needs more power.

Therefore, Smart Grid uses IT and home automation tools, as well as the latest technology
and the most innovative equipment, to respond to the volatile demand for electricity. Electricity
must be consumed at the same time as it is generated, otherwise it is lost. A power plant
generates energy, but cannot store it until it is needed. Thanks to these devices, energy can
be sent where it is most needed, without wasting it, thus seeking maximum energy efficiency,
as a result improving the integration of intermittent generation and new storage technologies.
Smart grids also mean developing decentralized generation architectures (distributed
generation). The last few years have seen an increase in electricity consumption, and it is
expected to continue to increase in the future.

44
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Therefore, cities and villages will have to manage and handle more and more energy, it will
require and improvement in order to combat the climate emergency and be more efficient.
There is also a growing participation of customers in the energy markets where customers can
play two roles: being producers or being customers. The cheapening of renewables in recent
years is one of the main reasons why Smart Grids have now emerged.

Spain spent a total of 37,340 million euros on importing hydrocarbons in 2017 as a whole. If
there is an increase efficiency and green energy production, less energy will be needed to buy
from abroad. Reduced peak demand, which will also result in lower prices and less energy
waste. They will favor the large-scale integration of renewable energy systems and also the
implementation of systems in which the owner is the consumer. It will also give better security
because the energy system will be much more diversified. It is a step forward in the
development of the electricity market, offering new functionalities and services to marketers
and consumers in the market. Besides being the gateway for renewable energies, it is also
the gateway for electric vehicles. To conclude this point, the advantages of a smart grid can
be summarized in the following 6 points:
- Renewed and innovative power grid: improve the quality of service, strengthen and
automate the grid. In order to obtain a quality transmission and distribution electrical
grid and minimize grid losses.
- A secure supply: solving the problem of the depletion of current energy sources (fossil
fuels, non-renewable), optimizing the connection of areas with renewable energy
sources and minimizing costs such as transportation losses, since if consumers are
closer to energy generation, everything will be much more efficient. More diversification
means more safety supply.
- Reducing environmental impact: reducing smoke and gas emissions, helping to
reduce the greenhouse effect, trying to increase social responsibility and sustainability.
- Manage energy demand: allowing consumers to manage their energy consumption
more efficiently. Enable self-management during incidents, ensuring a constant flow of
energy at all points in the event of failures or errors in the grid. Liberalize the sector to
enhance the active participation of consumers, encouraging local energy generation
and the delivery of excess energy to the grid at peak hours. Provide consumers with
more information and options when selecting their energy supply.
- Variety in generation modalities: allowing the coexistence in the grid of all types of
generators, regardless of size and technology. Variety in storage strategies, aided by
the implementation of microgrids and distributed energy generation.

45
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

- Facilitating the growth of national and European markets: facilitating the transport
of energy over long distances, introducing elements such as electric vehicles,
increasing the use of renewable energies and other elements under development.

Smart Grids still have a long way to go. However, it must be followed in terms of energy
efficiency and savings in order to build a sustainable world. According to some estimates: if
grid installations that were only 5% more efficient were incorporated into the domestic grid,
the savings would be comparable to the emissions of 53 million cars. Therefore, any gesture
can make a difference in terms of efficiency. Smart grids are definitely a bet on the future, not
to say the future itself.

2.2.1. The effect of electrical vehicles and solar panels in the


electrical grid
As it has been mentioned above, another feature that plays an important role in the
implementation of new smart grids is the electric vehicle. When people talk about electric cars,
they usually only think of the environmental benefits, such as reductions in CO2 emissions,
less noise pollution.... However, one of the great potentials of the electric car is its use as an
energy storage system, which can be consumed and managed by smart grids. In this sense,
the following technologies being implemented are:
- V2G: Vehicle to grid (vehicle to grid). This is a system in which the energy stored in
the vehicle can be injected (sold) to the electric grid. It could therefore sell electricity at
peak hours, buying it at off-peak hours, thus achieving an economic benefit for the
individual.
- V2H: Vehicle to Home. This technology is a variant of V2G, but intended for homes,
giving the possibility of using the car battery as a power source for the home itself,
allowing lower electricity bills and, for example, being able to use it as an emergency
power generator in the event of interruptions.
- V2B: Vehicle to Building (vehicle to building). Conceptually identical to V2H, but
applied to buildings or industries, with this technology a fleet of vehicles connected to
the same building can serve as a power source.
They would provide a more efficient transmission of electricity. Faster and more efficient
restoration after a service interruption thanks to its bidirectional feature. It provides active and
much more specialized demand management, allowing consumers to manage their
consumption more efficiently and improve energy efficiency, thus reducing costs and,
consequently, the expenses of the end consumer and the state. In addition, the injection could

46
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

be also from reactive energy, in the next subsection, there is going to be a discussion of
different applications of reactive injection.
2.3. How can reactive power help to stabilize the public electrical grid?
What does it mean to say the electricity electrical grid needs to be balanced? It does not refer
to the structural stability of the high-power tower. Rather, balancing the power system is about
ensuring electricity supply meets demand second by second. From the side of a consumer,
the power system serves one purpose: to deliver electricity to homes and businesses so that
it powers the human activity. But from a generator and a system operator perspective, there
is much more.
Electricity must be transported the length of the country, levels of generation must be
managed, so they are exactly equal to levels being used, and properties like voltage and
frequency must be minutely regulated across the whole electrical grid to ensure power
generated at scale in industrial power stations can be used by domestic installations. This is
something already discussed above in the Smart Grid chapter, where it has been shown that
it would provide more efficient power where the consumed is generated. The stabilization of
the grid relies on the system operator, working with power generators that keep the power
system in operation, stable and balanced.

One of the main factors that contribute to the destabilization of the grid is the frequency. In the
world, the power electrical grid operates at a frequency of 50 Hz or 60 Hz, which is determined
by the number of directional changes alternating current (AC) electricity makes every second.
However, just a 1% deviation from this begins to damage equipment and infrastructure, so it
is imperative it remains consistent. This is done by National Grid instructing flexible generators
(such as thermal, steam-powered or batteries) to either increase or decrease generation, thus
electricity supply is matched exactly to demand. If this is unbalanced, it affects the electrical
grid’s frequency and leads to instability and equipment damage. Generators are set up to
respond automatically to these requests, correcting frequency deviations in seconds. With a
distributed power generation with solar panels and electric vehicles, it could help with
frequency stabilization.

The other factor to be considered and the one that will be addressed in this document is
reactive power. The electricity that turns on light and charges phones is what is known as
‘active power’. However, getting that active power around the transmission system efficiently,
economically and safely requires something called ‘reactive power’. Reactive power is
generated the same way as active power and assists with “pushing” the real power around
the system, but unlike active power it does not travel very far. The influence of Reactive power
is local, and the balance in any particular area is very important to maintain power flows and

47
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

a stable system. Working with generators to either generate more reactive power when there
is not enough, or absorb it when there is an excess, which can happen when lines are ‘lightly
loaded’ (meaning they have a low level of power running through them). Absorb reactive power
is also vital in controlling the grid’s voltage. Producing reactive power a generator increases
the voltage on a system, but by switching to absorbing reactive power it can help lower the
voltage, keeping the grid’s electricity safe and efficient.

Reactive energy appears in electrical installations that need to create magnetic and electric
fields to operate. That is, electrical appliances that have coils and capacitors. For example,
refrigerator and freezer motors, fluorescent lamps and transformers, among others. This
energy is a nuisance for distribution, as it increases losses in electrical electrical grids. For this
reason, charges were created for the excess reactive energy discharged into the grid.
Depending on the devices present in the installation, the reactive energy that may appear can
be inductive reactive energy or capacitive reactive energy. Reactive power is measured in
kVArh (kilovolt-amperes reactive per hour).

Solar panels and electric cars need inverters. Inverters give the possibility to inject active and
also to inject or absorb reactive power. Throughout this document, it will be analyzed which
influence would have injecting or absorbing reactive power through photovoltaic or electric car
inverters. How is reactive power compensated? To ensure a stable power grid, grid operators
require power generators to contribute to reactive power compensation. During the day, this
is not a problem: Inverters can generate reactive power during injection operation. In order to
compensate for reactive energy, the only solution so far has been to build expensive
compensation systems, mainly using capacitors. But thanks to today's technologies, in
particular the inverters mentioned above, every single-family house or building can provide
the necessary power to the grid depending on its needs. This is known as dynamic generation,
meaning reactive power is generated according to the needs of the grid.

Thanks to innovation in the latest inverters, they can now also provide reactive power
compensation during the night. Pure reactive power is fed into the public grid. This saves the
costs associated with the purchase of reactive power. In addition, it is also possible to
compensate for the need of other producers by making this additional reactive power
available. This generates a new source of revenue and greater grid stability in line with the
previously defined principles of the smart grid, i.e. more efficiently and directly.

48
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

3. System Description
This chapter will contain the explanation of the different systems and controls used in the later
cases from a theoretical point of view. Block diagrams and equations will be used for the
explanations. The values of the variables, operation of the simulations and subsequent
justifications will be discussed individually for each case study, in chapter 4 in particular.
3.1. Introduction
Inverters are used to convert DC power into AC power, which is supplied normally to the grid.
This power injection into the grid through inverters can produce single-phase or three-phase
output. A solar inverter or PV inverter is a type of electrical converter that converts the variable
DC output from a PV solar panel into an (AC) output which is at utility frequency which can be
directly fed to power appliances or fed directly into the electrical grid. Some solar power
inverters have extra functions for optimizing the output of PV arrays, like maximum power
point tracking and anti-islanding protection. In this project, the inverter will be bidirectional
since it will have to be able to inject or absorb reactive power.

In case of the electric vehicles, they have 2 inverters: the first one converts DC power to the
AC power used in an electric vehicle motor. The inverter can change the speed at which the
motor rotates by adjusting the frequency of the alternating current. It can also increase or
decrease the power or torque of the motor by adjusting the amplitude of the signal. The second
inverter is the charger, which is the one to be discussed in this work. The battery charger
inverter converts the AC power available on the electrical grid to DC power stored in a battery.
It controls the voltage level of the battery cells by adjusting the rate of charge. It will also
monitor the cell temperatures and control the charge to help keep the battery healthy. This
document will specifically discuss a bidirectional inverter (charger), capable of absorbing or
injecting power from the grid, which means that it will switch from DC to AC and vice versa.

There are two types of inverters: the single-phase and three-phase. Below is an explanation
with the differences between single-phase inverter and three-phase inverter:
- A single-phase inverter is fairly obvious. It converts the DC power generated by solar
panels or electric vehicle into (EV) a single phase of AC power that the house can use.
- A three-phase inverter produce three-phase power from the PV modules or electric
vehicle (EV) and can be connected to the three-phase equipment or grid. Its three
phases are normally delayed by an angle of 120° to generate the 3-phase AC supply.
With the three-phase inverter, it is possible to produce more power for direct use and
also send much more solar energy back into the grid compared to single-phase.

49
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

What are the differences between the two? Single-Phase Inverter are typically used in most
new houses and small businesses, single-phase electricity is transported via two wires: active
and neutral. The electricity from the grid or solar PV or EV system will only flow through the
one active wire, while the neutral wire is connected to the earth at the switchboard. The
purpose of the neutral wire is to provide a path back to the switchboard, the source of the
electrical current, in the event of a fault or problem which could lead to trip the breaker or blow
the fuse, cutting the electricity and preventing from getting electrocuted. Three-phase power
has four wires, three of which are active, in addition to one neutral wire, which is earthed at
the switchboard. Three phase electricity is common in both larger homes and businesses, as
well as older homes, and allows for smaller and less expensive wiring, and lower voltages.

Which one should be chosen? If the property has single-phase power, then the installation
needs a single-phase inverter. On the other hand, when the property has three-phase power,
it is technically able to install both single-phase and three-phase compatible inverters.
However, electrical grid operators do not allow an imbalance across the phases, that is why
the only solutions are to install three single-phase inverters for each phase, or one three phase
inverter that will work across all three phases.

3.2. Control and Inverters


At this point, there is going to be an explanation of the inverters implemented. In this project,
2 different inverters were used: single-phase and three-phase. Case 1 and case 2, both cases,
correspond to single-phase simulations. Case 3 is a three-phase simulation.

3.2.1 Inverter Control (single-phase)


Before going into more detail about the control, let's look at the following block diagram (Figure
29) to get a general idea of what the inverter and the system will look like. The figure shows a
system formed 4 main parts. Basically, the solar and EV inverter model is the same with a few
differences that will be explained later. The DC voltage source equals the voltage rise that
would be produced by a buck-boost circuit. This decision has been made to simplify and
reduce simulation run time. Knowing that, first there is going to be the solar inverter
explanation first and second blocks of the seeing the diagram and later the Simulink model
implemented.

50
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 29: Block diagram system Case 1 and Case 2 - Single phase

Figure 30: Single-phase inverter: (a) General block diagram and (b) blocks forming the Solar/EV inverter.

Solar inverter (1) and EV inverter (2)


Continuing the numeration from Figure 30, before explaining the Simulink model implemented,
both inverters (Solar and EV) will follow the next structure shown in Figure 30.

51
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Measures 1:
In this block 1 there is going to be measured the intensity (I_boost_solar) and the voltage
(V_boost_solar) of the simplified back-boost circuit (by the DC voltage source). With these two
measures, the solar DC power (SOLAR_POWER_1) can be calculated (1):
𝑆𝑂𝐿𝐴𝑅𝑃𝑂𝑊𝐸𝑅1 = 𝑉𝑏𝑜𝑜𝑠𝑡𝑠𝑜𝑙𝑎𝑟 · 𝐼𝑏𝑜𝑜𝑠𝑡𝑠𝑜𝑙𝑎𝑟 (1) → 𝑃 = 𝑉 · 𝐼 (1)
Equation 1: Solar Power, Single-Phase Inverter

Filter:
Corresponds to a filter for having a good lecture of the measurements of voltage and current.
The values are C=52*1e-6 [F] and L=1.9656*1e-3 [H], considering the max current output from
the inverter.

Measures 2:
This block corresponds to the measure of AC voltage and current, meaning output values.

Variables 1:
Finally, this block has the function of the calculation of both active and reactive power using
the signals of block 4.

IGBT bridge and control:


The inverter control corresponds to Figure 31 and Figure 32. In Figure 31, it is shown that the
control starts with the active and reactive power references, later there is a specific control for
each and the current reference is created. The sum of both currents results in the current
reference which is compared with the real current of the inverter.

The difference is passed through a PI controller, where, thanks to the integral, the error is
eliminated. Besides that, there is a division between the voltage of the inverter and the boost
voltage (the Vdc indicated in previous figures) multiplied by the constant kd. Finally, the sum
of the signal from the PI and the kd signal is compared to a repeating sequence to create the
IGBT signals of the inverter. These signals are the ones which will trigger the IGBT bridge
(Figure 32).
The P&Q references block in Figure 31 has the function to introduce the references of active
and reactive power. In the case of the solar inverter, it is programmed as the inverter has to
provide the maximum power, also the max active and reactive. On the other hand, the inverter
of the car will deliver the reactive power with a small modification that will be explained later.
It is important to remember that in this control, the reference current is the sum of the reference
currents generated by the active and reactive controls.

52
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 31: Block diagram of the single-phase Solar and EV Inverter control

Solar EV

Figure 32: IGBT bridge for Solar and EV inverter

53
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 33: PI Block diagram of the single-phase Inverter control

Figure 34: Delay to get 100% of reactive power

The symbology used with the character “▷” corresponds to a NOT (meaning multiplied by -1).
Inside the PI control boxes from Figure 33, there is the next control where they also have their
own proportional (kp) and integral (ki) gains, as shown in Fig. 31.

The signals s1, s2, s3 and 24 from solar inverter and s11, s12, s13 and s14 from the EV
(Figure 31), goes to the IGBT bridge (Figure 32). Thanks to these signals, the inverter is going
to provide the power introduced by the references. To generate the reactive power, there is a
delay in the control followed by the reactive control (Q control). The phase difference between
voltage and current must be 90º, to get full reactive power as Figure 34 shows.

54
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Solar

Figure 35: Block diagram of Solar active and reactive control

Figure 31 shows the blocks forming the P and Q controls for both the solar and EV cases, in
these blocks there is going to be the next control shown in Figure 36 and Figure 35 where the
main variables are the real power produces and the current voltage from the inverter. In case
of the electric vehicle, it is the same control only by changing the main variables as shows
Figure 36. Each of the power controls ("P Control" and "Q Control"), generates a reference
current for each power, which when added together results in the inverter reference current.

3.2.2 Inverter Control (three-phase)


To do the three-phase control, instead of using proportional and integral controls, αβ reference
frame by the Clarke Transformer and a SVM adapter (Support Vector Modulator) will be used.
The structure of this inverter is more complex, but before explaining how it works, let's see
where it is located in the simulation. Figure 37 shows 6 boxes called COMB (combinations).
Each of them contains 3 houses connected to the 3 phases (since this inverter is three phase).
In each "COMB" box there are 3 the "Power Generation" block which is where the inverter is,
the rest of the blocks are for measuring the current and voltage of the COMB box.

55
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Electric Vehicle (EV)

Figure 36: Block diagram of EV active and reactive control

Figure 37: Three-Phase System Scheme

56
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 38: Three-phase Inverter location

The three-phase inverters of each house are located within the "Power Generation" blocks,
as shown in Figure 38. For the subsequent control, 2 essential variables are needed, the
phase current of the inverter (measured in the current blocks inside "Power Generation") and
the voltages between phases A-B and B-C of the grid (obtained in the block "Measures Block
(1)"). The following control will be the same for both solar panels and electric vehicles.

As can be seen in the following Figure 39, the control for this three-phase inverter will consist
of 5 essential initial variables, the mains voltage between phases and the phase currents
flowing through each house. The control will give us the signals that will trigger the IGBTs. As
shown in Figure 39, within the control it can be differentiate 3 more controls:
- Alfa-Beta Control
- Power and Current loop Control
- SVM

57
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 39: Three-Phase Inverter Control, Essential variables

The explanation will follow with the Alpha-Beta control as shown Figure 40, where the input
variables are the phase-to-phase voltages (vab and vbc) and the phase currents measured in
their respective blocks explained above. Through the Clarke transformation αβ values of the
current and voltage (Figure 40) are found. With these values, the control aims to create the
variables α and β for current and voltage. At the same time, these variables will be the ones
used to calculate the active and reactive power being generated by the inverter. This power
will follow the setpoint powers entered in the "Control Power and Current loop" block.

Within the "Voltage Clarke Transf" block, the α and β values for the voltage are created. Inside
the block, it is represented the following Clarke transform matrix (Equation 2).

2 1 2 2
·𝑣 𝑣
𝑣𝑎𝑙𝑓𝑎 𝑣𝑎𝑏 𝑣𝑏𝑐 3 3 𝑣𝑎𝑙𝑓𝑎 3 𝑎𝑏 3 𝑏𝑐 (2)
(𝑣 )= ( 0 𝑣𝑏𝑐 ) · → (𝑣 )=
𝑏𝑒𝑡𝑎 √3 𝑏𝑒𝑡𝑎 √3
0 0 𝑣
( 3) ( 3 𝑏𝑐 )

Equation 2: Voltage Clarke Transform, Three-phase Inverter

58
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 40: Alpha-Beta Three-Phase Inverter Control

Furthermore, in the block corresponding to the current, the matrix introduced inside the block
would be the following equation 3:
2 1 2 2
· (𝑖 − 𝑖𝐵 ) (𝑖 − 𝑖𝐶 )
𝑖𝑎𝑙𝑓𝑎 (𝑖 − 𝑖𝐵 ) (𝑖𝐵 − 𝑖𝐶 ) 3 3 𝑖𝑎𝑙𝑓𝑎 3 𝐴 3 𝐵 (3)
( )= ( 𝐴 )· → ( )=
𝑖𝑏𝑒𝑡𝑎 0 (𝑖𝐵 − 𝑖𝐶 ) √3 𝑖𝑏𝑒𝑡𝑎 √3
0 0 (𝑖 − 𝑖𝐶 )
( 3) ( 3 𝐵 )

Equation 3: Current Clarke Transform, Three-phase Inverter

Once all the variables have been obtained, the "P&Q Calculation" block determines the
instantaneous active and reactive power using the following expression form equation 4:
3
𝑝= (𝑣 ·𝑖 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑏𝑒𝑡𝑎 )
2 𝑎𝑙𝑓𝑎 𝑎𝑙𝑓𝑎 (4)
3
𝑞 = (−𝑣𝑎𝑙𝑓𝑎 · 𝑖𝑏𝑒𝑡𝑎 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑎𝑙𝑓𝑎 )
2
Equation 4: Instantaneous Active and Reactive Power, Three-phase Inverter

Before the final result, the signal is passed through a discrete "LPF" filter. This is a second
order filter discretized using Tustin.

59
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 41: Power and Control Loop Block, Three-phase Inverter

Once instantaneous powers are calculated, the process continues in the "Control Power and
Current loop" block where it will use the voltage and current variables calculated in the
previous block. In this part of the controller, the objective is to make the current follow the
reference current. When entering inside there is the following circuit Figure 41.
The current reference function takes the values of vα, vβ and together with the active and
reactive power reference values generates the reference iα and iβ. The power references are
introduced through vectors created within the Matlab code, in the "P&Q references" block.
Knowing that the reference power can be defined as the equation 5.
3
𝑃𝑟𝑒𝑓 = (𝑣 ·𝑖 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑏𝑒𝑡𝑎𝑟𝑒𝑓 )
2 𝑎𝑙𝑓𝑎 𝑎𝑙𝑓𝑎𝑟𝑒𝑓 (5)
3
𝑄𝑟𝑒𝑓 = (−𝑣𝑎𝑙𝑓𝑎 · 𝑖𝑏𝑒𝑡𝑎𝑟𝑒𝑓 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑎𝑙𝑓𝑎𝑟𝑒𝑓 )
2
Equation 5: Power reference calculation, Three-phase Inverter

60
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 42: Current Loop Controller, Three-phase Inverter

If it is isolated form equation 5 the reference currents, it results in equation 6. These


references will be entered in the "Current Loop" block:
2 𝑣𝑎𝑙𝑓𝑎 2 𝑣𝑏𝑒𝑡𝑎
𝑖𝑎𝑙𝑓𝑎𝑟𝑒𝑓 = ( 𝑃𝑟𝑒𝑓 ) + ( 𝑄 )
3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 𝑟𝑒𝑓 (6)
2 𝑣𝑏𝑒𝑡𝑎 2 𝑣𝑏𝑒𝑡𝑎
𝑖𝑏𝑒𝑡𝑎𝑟𝑒𝑓 = ( 𝑃 )− ( 𝑄 )
3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 𝑟𝑒𝑓 3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 𝑟𝑒𝑓
Equation 6: Reference Currents Calculation, Three-phase Inverter

Now that control have the instantaneous and reference αβ currents, the process can continue
with the next control inside “Current Loop” shown in Figure 42. The Figure 42 shows 2 control
diagrams where it can be seen a voltage cancellation.

61
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 43: Alfa and Beta controller, Three-phase inverter

Figure 44: SVM Control Block, Three-phase Inverter

Specifically with the DC voltage raised by the boost circuit of the inverter (remember that in
this control, as in the single-phase inverter, this control is not shown in order to simplify the
simulations). Since what the control wants to equate the input to the output, in this case, control
wants to equal iαref and iβref to iα and iβ. Therefore, a Feed-Forward for Voltage is going to
be needed and a cancellation by division of Vdc/2. Inside the alfa and beta controller, there is
the next control shown in Figure 43.
𝑌(𝑧)
The filter 𝑍(𝑧) is a Tustin transformation as the equation:
𝑌(𝑧) 𝑌(𝑠) 𝑌(𝑠) 2·𝑘𝑖·𝜉·𝑤0 (7)
𝑍(𝑧)
= 𝑇𝑢𝑠𝑡𝑖𝑛 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑍(𝑠) where 𝑍(𝑠)
= 𝑠+ 2·𝜉·𝑤0 +𝑤0 2

Equation 7: Alfa and Beta Tustin Controller Transformation, Three-phase Inverter

62
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 45: SVM adapter before pulses generation, Three-phase Inverter

Figure 46: 3 Half-Bridge switching triggered by Pulses Block, Three-phase Inverter

The variable "wo" is the computational frequency. In the simulation’s explanation section, the
concrete values of all variables and constants will be given. Finally, the obtained variables
dalfa and dbeta, will be used to be compared with a SVM to obtain the 6 signals that will
activate the IGBTs as shown in Figure 44. Before the pulses generation there must be an SVM
adapter as shown in Figure 45. Pulses block generates pulses for a three-phase basic two-
level voltage-sourced converter (VSC) consisting of three half-bridge switching devices
(IGBTs). The block will utilize the space vector pulse width modulation (SV PWM) technique
to generate firing pulses to the 6 switching devices of the 3 half-bridge switching devices as
shown in Figure 46.

63
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

64
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

4. Cases of studying
4.1. Introduction to the different cases
In cases 1 and 2 the system is single-phase, where there is going to be the monophasic
inverter. Furthermore, cases 3 and 4 are a three-phase system. In this way, there is going to
be an analysis of single-phase and three-phase with different profiles of consumption and
generation. All cases are going to be evaluated in 24 seconds, which emulates 24 hours, i.e.
one day. In all the simulations, if the signal is positive means injection, if it is negative it is
absorption. The nomenclature "P" stands for active power, and "Q" for reactive power. In all
cases they will be evaluated in 3 scenarios:
- Scenario 1: reactive absorption.
- Scenario 2: Reactive injection.
- Scenario 3: system without self-generation houses.
4.2. Case 1: Single-family house with solar panels and one electric
vehicle
As mentioned above, this first case corresponds to a single-phase system. It will be studied
what influence can have a house with self-generation in one phase.
4.2.1. Simulink Description
The following Figure 47 corresponds to the Simulink system for Case 1 and 2, where it has
the same structure as the block diagram system as described in chapter 2.

Figure 47: Simulink system Case 1 and Case 2 - Single phase

65
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 48: Simulink Solar and EV Inverter model - Single phase

Now that there is an idea of the structure of the inverter, the explanation will follow the Simulink
model (Figure 48) with the same order established in the Figure 47.

- Solar inverter and EV inverter, from Figure 47 (1) (2)


The explanation is going to start with the inverters (Solar and EV), where, like the model
explained in chapter 2 Figure 30, it consists of 5 blocks as shows in Figure 48. Since the
function of each block has been explained in chapter 2, at this point there is only going to be
a simply explaining of which functions have each block.

66
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 49: Block 1, measures Single-phase Inverter

Block 1:
In this block 1 there are the current and voltage measurements needed for the forward control.
As can be seen in Figure 49, there is going to be measured the intensity (I_boost_solar) and
the voltage (V_boost_solar) of the simplified back-boost circuit (by a DC voltage source). With
these two measures, applying the same Equation 1, the system calculates the solar DC power
(SOLAR_POWER_1).
𝑆𝑂𝐿𝐴𝑅𝑃𝑂𝑊𝐸𝑅1 = 𝑉𝑏𝑜𝑜𝑠𝑡𝑠𝑜𝑙𝑎𝑟 · 𝐼𝑏𝑜𝑜𝑠𝑡𝑠𝑜𝑙𝑎𝑟 (1) → 𝑃 = 𝑉 · 𝐼
To obtain a more real and finer, a first order transfer function filter is performed, where ωc is
the angular velocity. This parameter follows the next equation →
ωc = 2π / Tc or ωc = 2πfc (rad / s)
Block 2:
Following the established order and the structure of the block diagram in chapter 2 (Figure
49), the inverter in Simulink looks like in the next figure. Also, the symbology used with the
character “▷” corresponds to a NOT (meaning multiplied by -1). In the case of the Electric
vehicle inverter, the operation is going to be the same as the solar inverter, changing the
necessary variables. In the next Figure 50 there are the diagrams block with the Simulink
model.

67
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 50: Block diagram & Simulink Model of single-phase Solar and EV Inverter control

Figure 51: Half-Bridge IGBTs Switching, Single-phase Inverter

In both cases, voltage and current are the output signals of the inverter, those variables are
measured in block 4, next to the filter block 3. Once the variables s1, s2, s3 and s4 (Solar
inverter), also s11, s21, s31 and s41 (EV inverter) have been selected, the variables go to the
IGBT Bridge, Figure 51.

68
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 52: Repeating Sequence configuration for IGBT trigger signals

𝑺 = √𝑷𝟐 + 𝑸𝟐 → 𝑸 = √𝑺𝟐 − 𝑷𝟐 (8)


Equation 8: Maximum reactive power provided by the Inverter equation, Single-phase

These IGBT bridge signals are generated by comparing with a ramp signal, this signal is inside
the block Ramp_1 and Ramp_2 (both are identical). The variable "ts" corresponds to the
inverse of the computational frequency ("fs") as shown in Figure 52. In this case 1 and in the
rest of them, fs= [Hz] and ts= 1/fs [s].

Inside P&Q references boxes from Figure 50, it will set up the control and creation of
references for the inverters. The control will be related with the apparent power, whereas if it
is introduced as well as the amount of active energy produced, using the next simple Equation
8 is easy to know the maximum reactive power that the inverter can provide.

Therefore, only the values of active power, reactive power and time are needed for each value.
The code for this part will be as follows in next page Figure 53, where SPG is the power
entered by the repetition sequence, followed by the reactive calculation. The GPS values will
be introduced by means of Matlab code, which can be consulted in annex 55.

The EV inverter, the control, has the same idea, meaning that it provides the maximum active
and reactive power all the time. But in this case, as it is an electric vehicle, if the vehicle is not
charging because it is on the road, there is no battery, so there is no power supply. Therefore,
in the code shown next to this paragraph, if the reference is equal to 0, that means the car is
not in the house, if it is not, it means it is in the charging pull. Go to next page Figure 54 to see
the code.

5For further information, go to Annex 5 where the Matlab code has been copied with its respective
annotations

69
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 53: P&Q references block - Solar inverter

Figure 54: P&Q references block - EV inverter

As it has been said, the output values of the repeating sequences are defined in the Matlab
code, as well as the time values. The code can be consulted in annex 5. To do the reactive
absorption, there should be a negative ahead of the square root of the Qref in the P&Q
references block code (line 4 in the solar inverter and line 8 in the EV inverter).

70
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 55: P&Q references block - reactive absorption

Figure 56: P¬Q references block, sign modification

This sign change will be defined by the variable "SIGNO" entered in the Matlab code. This will
obtain values of 1 (reactive injection), -1 (reactive absorption) or 0 (in case of wanting to
eliminate the generation), Figure 56 shows the above.

The "Active Control" and "Reactive Control" boxes contain the same control presented in the
block diagram in the corresponding section of Chapter 2. This control subtracts the actual
power value (measured in block 5, "Preal_solar_1", "Preal_EV_1", "Qreal_solar_1",
"Preal_EV_1",) from the reference power (entered in the positive).

71
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 57: Solar Inverter constants from P and Q control boxes

This error is then passed through a PI, and summed with the operations shown in the image.
Variables "V_AC_EV_1" and "V_AC_SOLAR_1" are measured in blocks 4 of their respective
inverters. The variable “ v_amplitude_2”, corresponds to the electrical grid amplitude squared
as Figure 57 and Figure 58 shows.

For the reactive delay, it is used the Simulink block “Transport Delay”. The variables
“delay_solar” and “delay_EV” have the same value. The phase difference between voltage
and current must be 90º. This parameter block requires the time lag variable, knowing that the
frequency is 50 Hz and that the period is its inverse, it can be find out that the time lag must
be half the period (T=1/f=1/50=0.02 and delay=T/2=0.01 [s]). This variable is entered by the
Matlab code as shown in next page Figure 59.

72
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 58: EV Inverter constants from P and Q control boxes

Figure 59: Reactive delay introduction

73
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Function Name Value

DC voltage to simulate back-boost circuit [V] Vdc 400

Integral solar PI control constant ki_Sol 3

Proportional solar PI control constant kp_Sol 3

Integral EV PI control constant ki_EV 3

Proportional EV PI control constant kp_EV 3

Integral solar PI Active control constant ki_Psol 20

Proportional solar PI Active control constant kp_Psol 0.2

Integral solar PI Reactive control constant ki_Qsol 20

Proportional solar PI Reactive control constant kp_Qsol 0.2

Integral EV PI Active control constant ki_Pev 20

Proportional EV PI Active control constant kp_Pev 0.2

Integral EV PI Reactive control constant ki_Qev 20

Proportional EV PI Reactive control constant kp_Qev 0.2

Computational frequency [Hz] fs 1000

Frequency [Hz] fo 50

[rad/s] ωO 2𝜋fo

Reactive delay [s] delay T0/2


Table 1: Constants and variables values for single-phase inverter control

The Table 1 compiles all the variables seen so far and their respective value.

Block 3: the function of this block is simply because it is just a filter with considering the max
current output from the inverter, the values are the following:
C_filter= 52*1e-6 [F]
L_filter= L2=1.9656*1e-3 [H]

Block 4: Here the output voltage of the inverter and its corresponding peak value are
measured.
Block 5: Finally, with the current and voltage variables read in block 4, using the Matlab power
calculation block, reactive and active power is obtained as Figure 60 shows in the next page.
These 2 variables are the ones that will be used to make the graphs and are the ones that are
sent to block 2 for inverter control.

74
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 60: Active and reactive power generated, Block 5, single phase inverter

Figure 61: Configuration of Grid(3), Single-Phase

Following with the order established, the next blocks to comment on are Grid (3) and Load (4).
- Grid, from Figure 47 (3)
This block represents the grid, there is a RL resistance where in the following simulations there
is going to be variations in the inductance with the objective to reach the parasitic electrical
grid inductance, the values are introduced in the Matlab code. Also, there are the necessary
measurements of the voltage and current grid values. The grid is going to be 220√2 of peak
amplitude value and 50Hz of frequency as it shows Figure 61.

- Load, from Figure 47 (4)


In this block, there is going to be introduced the load sequence using a repeating sequence.
In all the cases simulated in this project, the profile of the load is going to be the same as the
next Figure 62 shows, which represents the average consumption profile in a single house in
Spain in the year 2019 with 2 sons (blue) or single couple (orange).

75
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Increased consumption
couple with 2 children

Figure 62: Average consumption profile in a single house in Spain in the year 2019

Figure 63: Load Sequence Control

Table 2: Standardized Electrical Power (kW)

Figure 63 is the control for the Load sequence, where it is introduced by a repeating sequence
and is the divider of the voltage read in the controlled Current source (I=V/R). This current is
going to simulate the charge of the single-family house. The time parameters and output
values will be introduced by means of vectors with Matlab code, see annex 5 for the code
used. The power of the single house is going to be the stipulated by the normative values in
Spain law resumed in next page Table 3.

76
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

t [h] n (Sequence) t [h] n (Sequence) t [h] n (Sequence)

1 0,2 9 0,4 17 0,40

2 0,2 10 0,23 18 0,35

3 0,2 11 0,25 19 0,67

4 0,2 12 0,25 20 0,80

5 0,2 13 0,35 21 0,90

6 0,2 14 0,5 22 1

7 0,3 15 0,5 23 0,85

8 0,4 16 0,45 24 0,65

Table 3: Formula and profile sequence for the Load

0,5 · (220 · √2)2 0,5 · (220 · √2)2 (9)


𝑃𝐻𝑜𝑢𝑠𝑒 = → 𝐿𝑜𝑎𝑑 =
𝐿𝑜𝑎𝑑 𝑃𝐻𝑜𝑢𝑠𝑒
Equation 9: Single Home Load [ohm] equation

0,5 · (220 · √2)2 (10)


𝐿𝑜𝑎𝑑 (𝑛) =
𝑛 · 𝑃𝐻𝑜𝑢𝑠𝑒
Equation 10: Single Home Load equation as a function of "n"

Knowing the power of the house (PHouse), using Equation 9, doing a simple clearing it is easy
to get the Load value (Ohm) of the House (Equation 10). As it has been said in this chapter,
the load sequence is going to follow the average consumption profile in a single house in Spain
in the year 2019 (Figure 62).

To do so, the variable “n” is going to have the same values of the
Table 3, which is related to the Figure 62. resulting in a new equation as a function of the
variable "n". This ensures that the load profile of the house always follows the average
consumption profile in the figure below.

With the different values of the contracted power of each house, different sequences will be
obtained, but they will always follow the profile of the average consumption profile. With the
end of this section, the explanation of the single-phase Solar and EV inverter will be almost
the same for case 2.

77
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

PHouse [kW] Solar Power [kW] EV Power [kW]

House 1 5,5 4,4 3,6

Table 4: Main parameters Case 1

Figure 64: Resistance House Profile

4.2.2. Control
In case number 1, is going to be a single-phase house with solar power generation and an
electrical vehicle. For the code only 3 variables are needed for the code:
- Solar power
- EV power
- Installed capacity power of the house.
The values under consideration are as follows in Table 4. With these values, the load value
is calculated which later is going to be used to calculate the load profile. Also, the maximum
power values for the solar inverters and the electric vehicle are also established.
0,5 · (220 ·√2)2
For the load sequence, with the formula→ 𝐿𝑜𝑎𝑑 = 𝑃𝐻𝑜𝑢𝑠𝑒
, the value of Load is 8,4174 Ω.
0,5 · (220 ·√2)2
Once the value is obtained, the profile using 𝐿𝑜𝑎𝑑 (𝑛) = , where “n” follows the
𝑛·𝑃𝐻𝑜𝑢𝑠𝑒
values of Table 4 to have the average profile. With the “n” corresponding values, the house
will have the Figure 64 resistance profile.

In the following Figure 65, an extract of the code that can be found in annex 1 is shown, where
it is shown how this profile is introduced in the Simulink model: first the resistance of the house
is calculated, then the profile is produced where it is collected in a vector that together with
the time one, both are introduced in the block.

78
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Load Calculation

Profile generated
following Equation 10

Sequence
vector

Repeating
Sequence
Introduction

Figure 65: Load Sequence introduction

79
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 66: Energy production curve

Table 5: Solar and Electric vehicle production table - Case 1

For this case the control is going to be single-phase, the inverters used are the same explained
in chapter 3. For the solar case, the production is going to follow an average solar curve shown
in Figure 66.
Due to the inverter control, it is going to provide the maximum reactive power in function of
the active power that could be generated. For the electric vehicle, there has to be a
consideration that at night the car will only charge the battery, more specifically, it charges the
battery slowly and to not lose power, so that it does not degrade over time. When the car is
coming back to the house, it is going to act as an energy storage and will provide power at
night, in the peak hours (21 to 22). Later it will generate reactive power. As it has been said,
all the simulations are going to be compared with reactive injection, reactive absorption and
with a non-self-generation home. To make it simple here is a table of the energy production
from solar and the EV, Q power is going to be injection or absorption depending on the
configuration shown in Table 5.

These references are entered via Matlab code in much the same way as the house load profile.
As can be seen in Figure 67, first the profile is created, then the vector is created and finally it
is entered into the repeating sequence. The time vector is always the same, both for powers
and load sequences. Note that the reference power profiles conform to the conditions shown
in Table 5.

80
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 67: Power References introduction to the repeating sequence, Solar and EV, Single-phase Inverter

81
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 68: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 – Scenario 1

4.2.3. Simulation
Remember that in all cases as well as this Case 1, are going to be evaluated in 3 scenarios:
- Scenario 1: reactive absorption.
- Scenario 2: Reactive injection.
- Scenario 3: system without self-generation.
The first figure obtained from the simulation is the active and reactive generated in the grid in
scenario 1, Solar and EV inverter and the Load. Also, at the end of each column there is the
load sequence as shown in Figure 68. In this figure is shown that the inverters work perfectly
fine due to power generated (red) following the reference (blue), this one introduces as Figure
67. The first conclusion that can be drawn is the amount of reactive energy that the solar
inverter injects into the grid, provoking the grid to absorb the energy. It can also be seen how
the grid is absorbing reactive power, since the inverters are in absorption mode. Also, if the
reader focus on the active power from the grid, it is clear the influence of solar generation. In
the hours with the highest solar incidence (midday), when the greatest amount of power is
produced, the grid switches from injecting to absorbing.

In the next page Figure 69 shows the behavior of the system. Now let's see what happens
when the inverter absorbs reactive power instead of injecting. The figure is going to have the
same structure as the previous above.

82
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 69: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 – Scenario 2

Figure 70: Active and Reactive generation of Grid, Solar, EV, and Load (H1) - Case 1 - Non self-generation

Here it is notable the impact of the inverter in the reactive power. The active power has the
same behavior in all cases, whereas the reactive is clear that the grid now has to inject the
reactive due to the inverters being able to inject. Finally, the same figure is going to be
evaluated in scenario 3, where there is no solar self-generation and electric vehicle at the
house, Figure 70.

83
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 71: Active and Reactive power generation of Grid (H1) – All Scenarios - Case 1

Figure 72: Apparent power generation of Grid (H1) - 3 All Scenarios - Case 1

In this case, it is notable that the active power from the grid is more like the load profile or the
load power demand. Also, there is no reactive generation or demand. On the other hand, the
grid is always injecting and never absorbing. Now let's compare the 3 simulation scenarios
with the graphics shown in Figure 71, been “P//Q” (Scenario 2 - injection), “P’//Q’” (Scenario 1
- absorption) and “Scenario 3 p//q” (non-self-generation)

Here it is clearly visualized that at night the active consumption of the self-generation house
(P or P’) is the same and both are higher than the non-self-generation scenario. This is due to
charging the electric vehicle (EV) at night. In addition, when the sun comes up, the solar panels
start generating power and the EV is gone, the grid starts absorbing power instead of injecting.
In the dinner hours, when the load demand is at its best, the needed power is very similar.
Besides, the reactive power Q and Q’ are the opposite, in contrast “q” is almost 0 all the time.

In addition, Figure 72 shows the apparent power where is shown that scenarios 1 and 2 have
much more apparent energy compared to the non-self-generation scenario 3.

84
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 73: Active and Reactive Energy produced (H1) – All Scenarios - Case 1

Figure 74: Apparent Energy produced (H1) - 3 simulation scenarios - Case 1

Another way to visualize all this data is making the total amount of energy provided in each
scenario as Figure 73 shows. In this figure is easy to see that the self-generation scenarios
(45 kWh) need less active energy than a non-self-generation case (58 kWh).

In case of the reactive power, the scenarios with auto generation have the same quantity but
at the same time they are the opposite (injection +97 kVArh, absorption -97 kVArh). In addition,
the third scenario (7 kVArh) is much smaller than the other two.

Finally, another intriguing figure is Figure 74, where it represents the apparent energy.
Self-generation scenarios (125 kVAh) are the same and much bigger than the non-self-
generation case (58 kVAh).

85
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 75: Spanish Law, variation of the supply voltage

Figure 76: Relation between load sequence and voltage variation through inductance

4.2.4. Parasitic Grid Inductance


In this Section, the main objective is to find what is the inductance value of the electrical grid
that causes the voltage to exceed the limits of the Spain law. These limits are +/- 7% of the
nominal value, they are established in the ROYAL DECREE 1955/2000, of December 1st,
article 104, point 3 as shown in Figure 75.

So, the limits that will appear in the following figures are the +/-7% of the peak voltage value,
which is 220·√2, meaning that the range voltage limits are -289,35 V and +332,9 V. By
modifying the grid inductance, the simulation is going to show us how it affects the injection or
absorption of energy, especially reactive energy. The 3 inductance values introduced are:
Red → L=12e-6 H ; R= 1e-6 Ω
Blue→ L=6e-6 H ; R= 1e-6 Ω
Magenta → L=9e-6 H ; R= 1e-6 Ω
In the next page Figure 77 there is going to be the results of the 3 different scenarios and their
response to the 3 inductance variations from the grid. With the Figure 77 is it does not matter
if the house has self-generation or not, if it absorbs or injects reactive power, in all cases it has
behaved in the same way with respect to inductance variations. The impact of a single house
is very little. Also, the variation in voltage follows more the curve of the load rather than the
reactive injection as Figure 76 shows.

86
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Scenario 1 (Reactive absorption) Scenario 2 (Reactive injection)

Scenario 3 (non-self-generation)

Figure 77: Voltage variation across grid inductance - 3 Scenarios - Case 1:

4.2.5. Conclusions from Case 1


In the P and Q generation section, simulation scenarios with auto generation need less energy
compared to the scenario of a house without solar panels and an electric car. This reinforces
the points shown in the introductory sections on Smart Grids, i.e. that distributed generation
can help the grid and reduce large-scale power generation. Apart from needing less active
energy, they can deliver by absorbing or injecting reactive energy, something that a house
without self-generation could not do.

Likewise in the inductance variation in this case 1, it is demonstrated that the impact of a house
with self-generation is practically negligible when it comes to presenting changes in the grid
by injecting or absorbing energy, provoking the voltage variation caused by the grid inductance
to be more like the load curve rather than the reactive energy.

87
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 78: Simulink Case 2

4.3. Case 2: A neighborhood with several single-family houses like the


case one
4.3.1. Case description
In this case, the study has 3 self-generation houses with single-phase inverters like in the
previous case 1. There is going to be a single house for every grid phase. Each house is going
to have Solar panels and an electric vehicle. The sequence load is going to follow the same
0,5 · (220 ·√2)2
equation from case 1 𝐿𝑜𝑎𝑑 (𝑛) = , where “n” values also will follow the average
𝑛·𝑃𝐻𝑜𝑢𝑠𝑒

load profile explained in the single-phase inverter control point.

Case number 2 is going to be the same as Case 1 but with 3 houses, the same control
explained in case 1 will repeat it here 3 times, one for each home. Also, with the required
measurement blocks, RL grid branch and a three-phase programmable Voltage Source as
Figure 78 shows.

The variables will always have the same name and will only be differentiated with "_H1"
(representing house 1), "_H2" (representing house 2) and "_H3" (representing house 3). For
the Matlab code used for the simulation, see Appendix 6. The code has the same structure of
case 1, the only difference is in the name of the variables and the number of profiles, since in
this case there will be a total of 3 sequence and power profiles (one for each house).

88
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

. – P (Active absorption) + P (Active injection)


. – Q (Reactive absorption) +Q (Reactive injection)

Table 6: Solar and Electric vehicle production table - Case 2

PHouse [kW] Solar Power [kW] EV Power [kW]

House 1 5,5 4,4 3,6

House 2 4,4 4,4 3,6

House 3 7,7 4,4 3,6

Table 7: Main Power House variables, Case 2

4.3.2. Control
Every home will have different behaviors, profiles and power. In the following tables Table 6
and Table 7 there are the main characteristics of the 3 houses and their injection or absorption
power times. All these reference characteristics will be introduced in the simulation code,
which is located in Annex 66 following the same structure and process as in Figure 67 shown
above in previous chapter 4.2.2.

4.3.3. Simulation
After the simulation from Simulink of all three scenarios, the fist figure is about the active and
reactive power from the 3 scenarios for each grid phase:
- Scenario 1, self-power reactive injection (P, Q and S)
- Scenario 2, self-power reactive absorption (P’, Q’ and S’)
- Scenario 3, non-self-power (p, q and s)

6For further information, go to Annex 6 where the Matlab code has been copied with its respective
annotations

89
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 79: P and Q from each phase in Scenario 1 (Reactive absorption) - Case 2

Figure 80: P and Q from each phase in Scenario 2 (Reactive injection) - Case 2

The symbol criteria will also remain the same as those used up to now: + → injection - →
absorption. All this graphics are shown in figures 79, 80 and 81. These figures represent the
values from the grid. Since the individual graphs for each house are not shown at this point, if
the reader is interested on the Active and Reactive generation of Grid, Solar, EV, and Load
from each house like the previous Figures 69 and 70, go to annex 7 7

7
For further information, go to Annex 7 where there are complementary figures from Case 2

90
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 81: P and Q from each phase in Scenario 3 (non-self-generation) - Case 2

H1- Phase A H2- Phase B H3- Phase C

Figure 82: Apparent power phase grid - Case 2

Figure 83: Total P&Q power phase grid - Case 2

𝑺 = √𝑷𝟐 + 𝑸𝟐 (11)
Equation 11: Apparent Power formula

Reading the active and reactive values of each one of the phases and applying Equation 11,
as shown in Figure 82, representing the apparent power values over 24 hours. Figure 83
represents the sum of each active and reactive power of each phase, i.e., the reactive power
of phase A, B and C is added. The same with the reactive power.

91
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Phase A Phase B Phase C

Figure 84: Active, Reactive and Apparent energy each phase - Case 2

Figure 85: Sum of Active, Reactive and Apparent energy grid - Case 2

With figure 83, is shown that active power generation does not differ in whether inverters are
injecting or absorbing reactive power. The same happens with the reactive power, where they
simply have a difference of signs as in case 1. Another observation, as in case 1, is that in the
sunny hours, there is energy excess and, at night, the consumption of the self-generation
scenarios is higher because of charging the car at those hours. Also, due to the reactive
generation, the apparent power of the self-generation scenarios is much higher. In figure 84,
when the active and reactive power from each phase is added together, is confirmed that all
what has been said before. Repeating the same process as in case 1, in order to visualize
what has been described above in a clearer and simpler way, a graph will be made with the
sum of the active, reactive and apparent energy, joining the values of the 3 phases and for
each single phase.

92
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 86: Voltage variation across grid inductance - Scenarios 1 (Reactive absorption) - Case 2

Seeing figure 85, is it clear that self-production scenarios generate more energy, needing less
active power and with the possibility to provide power to the grid. The conclusions are the
same as case 1 in this aspect.
4.3.4. Parasitic Grid Inductance
In this case 2 it will be repeated the same process as in case 1 above. The grid inductance
variation values are the followings:
Red → L=6.5e-6 H ; R= 1e-6 Ω
Blue→ L=9.5e-6 H ; R= 1e-6 Ω
Magenta → L=12e-6 H ; R= 1e-6 Ω

Once the simulation has been carried out, in Figures 86, 87 and 88, it can be seen the voltage
variation. In case 2 the grid inductance is bigger than in case 1, meaning that with the increase
of loads, the inductance grid grows.

With the mentioned figures, the voltage variation of the 3 phases, a higher grid inductance
causes an increase in distortion. However, this case does it in a different way than Case 1, in
fact it almost does not go out of the normative values and it does it with a very flat shape that
is decreasing throughout the day.

93
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 87: Voltage variation across grid inductance - Scenarios 2 (Reactive injection) - Case 2

Figure 88: Voltage variation across grid inductance - Scenarios 3 (non-self-generation) - Case 2

As can be seen in Figures 86, 87 and 88, the voltage variation is very similar independently of
the scenario that is being evaluated.

94
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 89: Voltage through inductance variation, P&Q grid power from the phase A and Load sequence House 1
- Case 2

In this case 2, the voltage variation does not follow either the load curve and power grid, even
though the variation declines as the load decreases. As is shown in Figure 89 representing
the voltage variation through inductance variation and the active and reactive grid power from
the phase, in this case is phase A, and the load sequence from the house of the phase (house
1).

Also, it is shown that at night, when the consumption and reactive power is the highest, the
variation decreases a little bit. If the reader consults Annex 7, there is going to be all the figures
from the simulation, and it is easy to see that in case 2 there is no correlation between the
reactive power or load sequence with voltage variation this happens in all the scenarios.

95
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

4.3.5. Conclusions from Case 2


The conclusions from this case 2 are very similar to the case 1. Is it clear that the self-
generation scenarios provide much more power to the grid, rather than de non-self-generation.
Also, due to the car charging, the self-generation scenarios have their biggest consumption of
active power from the grid at night (normally when the EV’s are charging). In addition, when
the sun rises and the solar panels start working, they inject active power.

Likewise in the inductance variation in this case 2, it is noticed that the impact of a house with
self-generation is as well practically negligible like the case 1. The difference is that in this
case 2, the variation does not follow either load sequence or a reactive power curve.

Therefore, once cases 1 and 2 have been simulated, is it shown that with one single house
per phase, it is not enough to present significant changes in the voltage variation through
inductance variation (regardless of whether the inverter is working to inject or absorb reactive
power). On the other hand, it is possible to reaffirm that the houses with solar generation and
electric vehicles increase the consumption in low hours (at night) and decrease it in the sunny
hours. Making a balance of all the energy consumed, it can be concluded that the houses with
self-generation consume considerably less active energy than the normal ones and provide a
large amount of reactive energy to inject or absorb.

4.4. Case 3: A neighborhood with several single-family houses like the


case one but in a three-phase grid
This case number 3, unlike the previous ones, is a case where the inverter will be three-phase.
The dynamic will be the same as in the previous cases. Since the operation of the inverter is
more complex than in the previous cases, the reader is recommended to reread chapter 3
corresponding to the three-phase inverter.

For the Matlab code used for the simulation, see Annex 88. As in case 3, the corresponding
figures for each house will be attached in the explanation, the graphs related to the electrical
grid will be shown. If the reader wishes to view the graphs for each house individually, see
annex number 9.

8
For further information, go to Annex 8 where the Matlab code has been copied with its respective
annotations

96
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 90: Case 3 System Scheme

4.4.1. Case description


This case consists of 18 houses, in the simulation they have been grouped in combos of 3.
Each combo (in the Simulink “COMB”) contains 3 houses so there is a total of 6 as shown in
Figure 90. Each combo will be formed by 4 main blocks also shown in Figure 90; the first one
is in charge of power generation ("Power Generation COMB"), the second and third blocks
are for measuring the current and voltage of the combo. Once the reading has been taken,
the block will be connected to one phase of the three-phase electrical grid. In each phase
there will be 2 combos connected (equivalent to 6 houses).
- Phase A: COMB 1 and COMB 4
- Phase B: COMB 2 and COMB 5
- Phase C: COMB 3 and COMB 6

Before continuing with the explanation, let's see an image of the real model in Simulink in
Figure 91 where, if compared with the previous figure 90, the above-mentioned structure is
perfectly visible.

Within each combo there will be a block where it will calculate the variables of the phase to
which it belongs. The power generation block is where the three-phase inverter and all its
respective controls explained in chapter 2 will be installed. This block will be structured as
follows the next figure, where it will be a measure block, a filter and the block where is going
to be the three-phase inverter as Figure 92 shows.

97
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 91: Complete Case 3 Simulink Model

98
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 92: Essential blocks scheme and Simulink model, Case 3

99
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 93: Voltage and Current variables Simulink

L[H] = 1.9656*1e-3

C[F] = 52*1e-6

Figure 94: Currents read, filter values and the structure of the model - Case 3

The following section will explain the calculations. It is recommended to review the explanation
of the three-phase inverter in chapter 3, section 3.2.2. The active and reactive grid values will
be calculated as the cases 1 and 2, using the Power block, which compute the active and
reactive powers of a voltage-current pair at fundamental frequency. Figure 93 shows where
the current and voltage values are obtained. It is very important to remember that the grid
voltage values should be measured before the Three-Phase Series RL-Branch. The Simulink
model gives problems if the voltage is measured after the RL Brunch, as this causes distortions
in the reading, which causes the control to be destabilized. As mentioned above, in each

100
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 95: Control general block, Case 3

Figure 96: 3 main sub-blocks of the general control block, Case 3

combo there are 3 houses. In Figure 94 it is possible to see the currents read, the filter values
and the structure of the model. Within each block "H1", "H2"... "H18", there is the three-phase
inverter where it follows the same structure exposed in chapter 3. This explanation will be for
only one house, but the process will be the same for the rest of them.

Figure 95 shows the control block where the mains voltage signals between phases A-B and
B-C enter. The current signals read by the measuring block in the previous Figure 94 are also
input. This control block, from calculation processes that will be explained below, knowing the
voltage between phases and the currents, will generate the signals that will trigger the three-
phase IGBT Half-Bridge switching. Within the control block, as shown in Figure 96, there are
these 3 more blocks (same structure as described in chapter 3).

101
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 97: Alpha-Beta control Three-phase Inverter, Case 3

2 2 2 2
· (𝑖 − 𝑖𝐵 ) (𝑖𝐵 − 𝑖𝐶 ) ·𝑣 𝑣
𝑖𝑎𝑙𝑓𝑎 3 𝐴 3 𝑣𝑎𝑙𝑓𝑎 3 𝑎𝑏 3 𝑏𝑐 (2)
( )= (𝑣 )=
𝑖𝑏𝑒𝑡𝑎 √3 𝑏𝑒𝑡𝑎 √3 (3)
0 (𝑖𝐵 − 𝑖𝐶 ) 0 𝑣
( 3 ) ( 3 𝑏𝑐 )

Figure 98: Clarke transform Alpha-Beta Control with Equations 2 and 3, Case 3

3
𝑝= (𝑣 ·𝑖 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑏𝑒𝑡𝑎 )
2 𝑎𝑙𝑓𝑎 𝑎𝑙𝑓𝑎 (4)
3
𝑞 = (−𝑣𝑎𝑙𝑓𝑎 · 𝑖𝑏𝑒𝑡𝑎 + 𝑣𝑏𝑒𝑡𝑎 · 𝑖𝑎𝑙𝑓𝑎 )
2

Figure 99: Instantaneous power is calculated by alfa-beta values with Equation 4, Case 3

The first block of the 3 main sub-blocks of the general control block (which is the alpha-beta),
is where the control voltages and currents are calculated, as well as the instantaneous power
generated by the inverter. It is structured as follows Figure 97. As can be seen, it consists of
2 Clarke transformations, one for voltage and the other for current. These Clarke transforms
are introduced by means of a Matlab function. Voltage and Current Matlab Clarke function are
equal to the equations seen in chapter 3, which is introduces as Figure 98 shows. Thus, with
the variables obtained, the instantaneous power is calculated with the following Matlab
function as Figure 99 shows.

102
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 100: LPF Matlab Simulation

Figure 101: Power and Current Loop Block, Case 3

The Low Pass Filter (LPF) is introduced by Matlab simulation code as shown in Figure 100.
Then, the process continues with the calculation of dalfa and dbeta in the "Power and Current
loop" block. In this block, shown in Figure 101, the voltage and current variables of the
previous block are used, so that together with the introduction of the reference powers, the
reference current variables are created. Within the "P&Q References" block there are 2
Repeating Sequences, one for active power and the other for reactive power. The values of
the power sequences are entered using the Matlab code of the simulation as seen in the
previous cases and as can be seen in Figure 102 on the following page. Unlike the previous
cases, here the reactive profile must be entered, while in cases 1 and 2 only the active one,
since the reactive one was generated by itself. This is because being a simulation with so
many houses, it was very difficult to have a block dedicated to generating the active and
reactive powers of each house separately and then enter them in a vector to the repeating
sequence. This way the simulation is streamlined and the process is faster. Each house will
have a different profile, the only one that is the same for all of them is the weather.

103
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 102: Repeating Sequence of active and reactive powerhouse, Case 3

2 𝑣𝑎𝑙𝑓𝑎 2 𝑣𝑏𝑒𝑡𝑎
𝑖𝑎𝑙𝑓𝑎𝑟𝑒𝑓 = ( 𝑃𝑟𝑒𝑓 ) + ( 𝑄 )
2
3 𝑣𝑎𝑙𝑓𝑎 + 𝑣𝑏𝑒𝑡𝑎 2 3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 𝑟𝑒𝑓 (6)
2 𝑣𝑏𝑒𝑡𝑎 2 𝑣𝑏𝑒𝑡𝑎
𝑖𝑏𝑒𝑡𝑎𝑟𝑒𝑓 = ( 𝑃𝑟𝑒𝑓 ) − ( 𝑄 )
2
3 𝑣𝑎𝑙𝑓𝑎 + 𝑣𝑏𝑒𝑡𝑎 2 3 𝑣𝑎𝑙𝑓𝑎 2 + 𝑣𝑏𝑒𝑡𝑎 2 𝑟𝑒𝑓
Figure 103: Reference Current calculation with Equation 6

For this reason, in this case 3 the load profile is not introduced, since it has been previously
executed, when obtaining the active and reactive profiles, these are already shaped by the
load when introduced.

The reference current (Reference Current Block in Figure 101) is calculated by a Matlab
function that introduces the same equation seen in chapter 3 as shown in Figure 103. Even if
it says ialfa and ibeta, the code refers to the reference values.

Within the current loop block (Current Loop Block in Figure 101) is the next control shown in
next page Figure 104. Where PRES alfa and beta are the same controller formed by a
proportional constant and a resonant integrator introduced by Matlab code as next page Figure
105 shows.

104
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 104: Current Loop block, dalfa and dbeta generation - Case 3

Figure 105: PRES alfa and beta controller, Case 3

wo=2*pi*50; Vnom=230*sqrt(2); num=[wo]; den=[1 wo]; Voref=1.03*Vnom;


sysd1_h1_sol=c2d(tf(num,den),10e-6,'tustin');
[numLPF_h1_sol,denLPF_h1_sol]=tfdata(sysd1_h1_sol,'v');
[numLPF_h1_ev,denLPF_h1_ev]=tfdata(sysd1_h1_sol,'v');

𝑌(𝑧) 𝑌(𝑠) 𝑌(𝑠) 2·𝑘𝑖·𝜉·𝑤0


𝑍(𝑧)
= 𝑇𝑢𝑠𝑡𝑖𝑛 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛 𝑜𝑓 𝑍(𝑠) where 𝑍(𝑠)
= 𝑠+ 2·𝜉·𝑤0 +𝑤0 2
(7)

Figure 106: Resonant Integrator Filter introduced by Code with equation 7

𝑌(𝑧)
The filter resonant integrator 𝑍(𝑧) is a Tustin transformation as the equation 7 seen it chapter

3, as figure 106 shown, the variables are introduced by Matlab code.

For the rest of the houses it will be exactly the same filter, with the same values and the
same introduction method.

105
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Finally, the last part of the control corresponds to the SVM block (Figure 96), in this block
Simulink is going to use an SVM to achieve the signals that will trigger the IGBTs as next
page Figure 107 shown. This discrete block generates pulses for a three-phase basic two-
level voltage-sourced converter (VSC) consisting of three half-bridge switching devices
(IGBTs). The block utilizes the space vector pulse width modulation (SV PWM) technique to
generate firing pulses to the 6 switching devices of the converter. With these functions, control
generates the trigger IGBTs signals. All this blocks and controls will be repeated for each
home, the only change will be the variables names by using the word "_H1", "_H2" ... "H18"
appended to the end of each variable name.

4.4.2. Control
This case 3 will have a total of 18 houses where to be more realistic there will be some with
solar panels and an electric car, others with just one or none at all, also other houses will have
contracted higher power. This has been decided to do so in order to obtain more average and
realistic results. Table 8 on the following page shows the distribution of active and reactive
power of the solar panels and electric vehicle of each house, with their respective powers. In
this way, it is clearly shown in which hours power will be generated from the sun or the electric
vehicle and in which hours the inverters will inject or absorb active or reactive energy.

106
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

. – P (Active absorption) + P (Active injection)


. – Q (Reactive absorption) +Q (Reactive injection)

Table 8: Solar and Electric vehicle production table - Case 3

107
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Table 9: Summary of the load, solar and reactive power of each house

Table 9 shows a summary of the load, solar and reactive power of each house and their total
sum.
4.4.3. Simulation
First, as has been done throughout this work, scenarios 1 and 2 (with self-generation) will be
analyzed first. The nomenclature to identify each scenario will remain the same as in the past:
- Scenario 1, self-power reactive injection (P, Q and S)
- Scenario 2, self-power reactive absorption (P’, Q’ and S’)
- Scenario 3, non-self-power (p, q and s)
The symbol criteria will also remain the same as those used up to now:
+ → injection
- → absorption
Due to the number of houses that have this case 3, in this explanation and subsequent, the
focus will be in the grid. As mentioned above, if the reader wishes to go deeper on the specific
sequence of each home, go to annex 99.

9 For further information, go to Annex 9 where there is more Figures and information of the simulation

108
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 107: P and Q from each phase in Scenario 1 (Reactive absorption) - Case 3

Figure 108: P and Q from each phase in Scenario 2 (Reactive injection) - Case 3

Now there is going to be a comparison between scenario 1 and 2. The first scenario as it is
known, is the reactive absorption, the second is reactive. With all the power generated form
each house, the three-phase grid voltage looks like in Figures 107 and 108. Active power is
the same in both scenarios and follows the logic observed in the previous cases: the highest
consumption is always in the evening from 00:00 am onwards, where the cars or electric
vehicles are charging; and, when the sun comes up, the solar panels begin to generate energy

109
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 109: Comparison between the absolute reactive energy value generated from each phase of Scenario 1
(blue) and Scenario 2 (red) in kVArh

and consumption decreases substantially. Moreover, in this case 3, since many houses with
different consumption and generation profiles have been introduced, this causes the electrical
grid values to be more similar, causing in each phase the same amount of active and reactive
power produced, the system is balanced, for this reason the values are very similar in the
three phases. Reference and real generation lines are not distinguished, as the inverter follows
the reference perfectly, so it overlaps

But when visualizing the reactive power, something happens here that did not happen in the
other cases, the absolute values of reactive power in scenario 2 (reactive injection) are higher
than in the scenario 1, unlike in the previous cases in which the reactive power was always the
same in absolute values. This phenomenon can be seen more easily in Figure 109.

It seems like the three phase inverters in a grid with lots of houses, there is a remaining
reactive power. If the power difference is made in absolute values between the reactive values
from scenarios 1 and 2 as shown in next page Figure 110, it is noticeable that the difference
is completely the same and follows the same profile, independently of the phase. It can be
observed that in sunny hours (specially between 11:00 and 16:00) the difference goes down.
This range of time matches when de self-power generation houses injects more active power
to the grid, which means inverters are producing less reactive. This decrease occurs when the
inverters inject active power and at the same time generate less reactive power.

110
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 110: Difference between reactive power from scenario 1 and scenario 2 in absolute value

Figure 111: P and Q from each phase in Scenario 3 (non-self-generation houses) - Case 3

Figure 111 shows the results scenario 3 where all houses have neither solar panels nor an
electric car. The conclusions in this scenario 3 are the same as the previous cases, due to
there are not electric vehicles the consumption at night is the lowest. As household
consumption increases, the active power does it so also. It can be seen that the active power
has a similar form like the average consumption profile in a single house in Spain in the year
2019 (Figure 62). However, the reactive power is different because is not 0 or similar. This
means that when there are the three-phase inverters and a big number of houses, the system
has a remaining reactive power, this observation reinforces the same idea exposed above.
Like in the previous cases, there is going to be a comparison between all three scenarios using
excel and later the needed commentaries where red is scenario 1, blue is scenario 2 and
yellow is scenario 3 in next page Figure 112.

111
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 112: Active (P) and Reactive (Q) power generated in the 3 Scenarios - Case 3

This figure 112 show and reaffirm the influence of solar and EV in active generation, and in
the reactive is easy to see what had been explained before, which is that scenario 1 (red)
produces less reactive. Now in the following next page Figure113 it will be shown the amount
of energy produced in each scenario. The reader is reminded that these values are obtained
by adding the values of the 3 phases of active power in one band and reactive power in the
other. Multiplying the power of each one by the time (which in this case is always hours), it
can be obtained the energy value. In the active energy, the conclusions form Figure 113 are
the same as the previous Case 1 and 2, which is that non-self-generation houses demand
more active power than those which have self-generation. Due to the less use of reactive
power injection in scenario 1, when the apparent energy is analyzed, in contrast to the other
cases, scenario 2 and scenario 3 are much more similar. Besides that, when the inverters are
programed to inject reactive power, the apparent energy is almost the double of the absorption
scenario.

112
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 113: Active & Reactive Energy produced in each scenario - Case 3

Figure 114: Apparent Energy produced in each scenario - Case 3

113
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Table 10: Total Active Energy comparison

Table 11: Total Reactive Energy comparison

For more Matlab figures of the simulation, see Annex 9. Compared to the other cases, the
difference of active energy between scenario 1 or 2 and scenario 3, is getting larger as there
are more houses. Table 10 shows this difference in comparison with the other cases summing
the active energy of all the phases of each case and scenario.

With this Table 10 it could be said that from the point of view of generating energy, the more
self-generation houses the grid has, the less active energy it will need. However, is it going to
happen the same if sum the reactive energy of all the phases? Let’s take a look at the reactive
energy with Table 11 where it can be confirmed what has been told above about.

4.4.3.1. What would happen if the number of houses were increased


considerably?
If the reference power vectors entered in Matlab are taken and multiplied by 4, it is as if the
number of dwellings has also been multiplied by 4, since the active and reactive power
generation and consumption profiles have also quadrupled. In order not to lengthen the
process too much, it has been considered to multiply by 4 and 8 the reference power vectors
introduced in the inverters is equivalent to multiplying the number of houses, so next Figures
115, 116 and 117 will show the data of the same case 3 but with18, 72 and 144 houses. Since
when the number of houses are increasing, the data between grid phases are very similar. It
is for this reason that it has been decided to show only the data of phase A, since they are
practically identical to those of phases B and C. Even thought, go to annex 1010 to have more
graphic information about this point.

10 For further information, go to Annex 10 where there more graphic data and information

114
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 115: Active and Reactive Energy Generated by Case 3 with 18 Homes

Figure 116: Active and Reactive Energy Generated by Case 3 with 72 Homes (x4)

Figure 117: Active and Reactive Energy Generated by Case 3 with 144 Homes (x8)

With these figures it is possible to see that the trends repeat it themselves again: the more
houses with self-generation, the greater the difference compared to a system of houses
without generation. Therefore, as the number of houses increase, if the reader looks at the
reactive power, there is less difference between the absorption and injection scenarios, on the
other hand, in the third scenario there is not much difference. This indicates something
contrary to what it had been seen and commented previously with the case of the 18 houses.
In next page Figures 118, 119 and 120 the values of the apparent energy are displayed, it is
noticeable that a better control for scenario 1 would be needed for the reactive power because
as the number of houses increases, there is less difference with respect to the injection
scenario 2.

115
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 118: Apparent Energy Generated by Case 3 with 18 Homes

Figure 119: Apparent Energy Generated by Case 3 with 72 Homes (x4)

Figure 120: Apparent Energy Generated by Case 3 with 144 Homes (x8)

Table 12 summarizes all the values shown in the previous figures. In the case of active energy,
if the values of scenario 3 are divided by those of scenario 1 or 2, it can be seen h ow much
more active energy is being generated by scenarios 1 and 2 compared to scenario 3. Figure
121 on the following page shows the described. If the same process is carried out, Figure 122
is obtained. What these graphs show is very intriguing, looking Figure 121, for 50 dwellings
the active energy required from the non-self-generation electrical grid ("p") is going to be 1.8
(180%) times higher than the self-generation electrical grid ("P" or "P' "). Furthermore, taking
the value for 18 dwellings, the active power grid required for "p" is going to be 2 (200%) times
higher than the P or P' scenario. The same happens with Figure 122, where for 25 dwellings,
in the case of reactive absorption, the non-self-generation system will have -0.7 (-70%) less
reactive power, and it will also have 0.4 (40%) times less power than the injection scenario. In
the graph of the reactive power we can see the limitation of the inverters or the c

116
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Table 12: Summary table from Case 3 simulations

Figure 121: Active Power Relation with the nº of homes

Figure 122: Reactive Power Relation with the nº of homes

117
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 123: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase A - Case 3

In the graph of the reactive power (Figure 122) it can be seen the limitation of the inverters or
the system in case 3, since, from 75 houses, the curve flattens, which means that the increase
of reactive power does not vary much with respect to a grid without self-generation.

4.4.4. Parasitic Grid Inductance


As it has been made on the other cases, there is going to be the evaluation of the voltage grid
through inductance variation, always inside the range (+/- 7%) stipulated by the Spanish
ROYAL DECREE 1955/2000, of December 1st, article 104, point 3 (Figure 75).
In this case the values of the inductance are:
Red → L=1.0e-6 H ; R= 1e-6 Ω
Blue→ L=9.0e-5 H ; R= 1e-6 Ω
Magenta → L=2.4e-4 H ; R= 1e-6 Ω

The final results are the following figures showing the peak voltage variation with the active
and reactive power for each phase. The following figures are summarized as follows:

- Figures 123, 124 and 125 → Scenario 1


- Figures 126, 127 and 128 → Scenario 2
- Figures 129, 130 and 131 → Scenario 3

118
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 124: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase B - Case 3

Figure 125: Voltage variation through grid Inductance and P&Q Power, Scenario 1 Phase C – Case 3

119
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 126: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase A – Case 3

Figure 127: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase B – Case 3

120
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 128: Voltage variation through grid Inductance and P&Q Power, Scenario 2 Phase C – Case 3

Figure 129: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase A – Case 3

121
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 130: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase B – Case 3

Figure 131: Voltage variation through grid Inductance and P&Q Power, Scenario 3 Phase C – Case 3

122
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 132: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase A – Case 3

Unlike the previous cases, the relationship between voltage variation and reactive power is
clearly seen here. In cases 1 and 2, the relationship was much more related to the load profile.
Another interesting phenomenon that manifests itself for the first time is that there is a notable
difference between the scenarios simulated: in scenario 1 (reactive absorption) it can be seen
that the voltage variation remains within the margins of +/- 7% established by Spanish
regulations.

In addition, in scenario 2 (reactive injection) the limit is exceeded most of the time. In this case,
this occurs when the inductance has the value of L3. This means that if the inverters work to
absorb reactive power, they help to stabilize the grid within the normative values.

Finally, in scenario 3 where the houses have no self-generation, there is no variation.


However, what would happen if inverters are programmed to only produce or absorb active
power, i.e., not to inject or absorb reactive power? In this way, the grid system would take
advantage of the self-generation of the houses, needing less power and, at the same time,
having a less variable grid voltage. However, would this statement be true? To respond to this
statement, the simulation has repeated with all the same profiles and variables except the
inverters, where they will only be generated or extract active power. The results are shown in
the following Figures 132, 133 and 134.

123
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 133: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase B – Case 3

Figure 134: Voltage variation through grid Inductance and P&Q Power, Scenario without Reactive Power
generated by Inverters, Phase C – Case 3

In the figure quoted, it can be confirmed that the active injection does not show any change in
the power injection to the electrical electrical grid. Although inverters have been programmed
to not generate or absorb reactive power, the system itself generates reactive power and this
causes the voltage variation. The voltage variation graphs in this figure are the same as in
scenario 3. Therefore, it seems that the efficient way to operate the inverters would be to only

124
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

absorb reactive power when the grid demands it. Because, as has been shown, active power
does not have a significant impact on voltage variation. Working in this way, the grid system
would benefit from self-generation and, at some point, would demand reactive absorption from
the inverters when needed to keep the voltage in the normative range. However, this issue
will be explained in the next section of this work, where it is going to explain if this hypothesis
is true.

4.5. Conclusions of all cases in Chapter 4


From the results obtained in the various simulations and cases, it can be draw 3 main
conclusions:
Conclusion 1: Decrease of active power
In all cases, scenarios 1 and 2 (self-generation) show to use less active power than scenario
3 (no self-generation). It is also shown that as the number of houses with self-generation
increases, the grid system needs to deliver less active power. More self-generation presents
less active injection from the power grid. In addition, systems with self-generation also
presents much more reactive power than in scenarios 3 from all the cases.
Another interesting conclusion that can be drawn is how the impact of the photovoltaic
generation and electric vehicles affects the consumption curves from the houses. In different
countries, as is the case in Spain, changes are being made to electricity prices so that it is
cheaper at night, thus making car charging more economical for the user. As it has been seen
in the simulations comparing scenarios 1 and 2 with scenario 3, the self-generation scenarios
increase the consumption of active power at night. Then again, the non-self-generation
scenario (number 3), has the lowest consume at night. On the other hand, if the car is plugged
in at home, it can act as a battery and reduce the consumption injecting active power in the
hours when the consumption is higher, and the electricity is more expensive. In case of solar
generation, it can be seen that as the sun rises, generation increases until there is a surpluses
delivered to the grid. This does not happen in houses without self-generation. So, in the end,
the extra consumption of the electric car when charging at night is compensated by the surplus
of solar energy, where finally, as mentioned in conclusion 1 of this point, houses with self-
generation represent less consumption for the grid.

Conclusion 2: More homes, more power


As more houses have been added in the various cases, it has been shown that there is more
impact when it comes to stabilizing the electrical grid. Cases 1 and 2 were almost negligible,
where the voltage variation was influenced more by the consumption curves of each house
than by reactive injection or absorption.

125
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

In case 1, the impact of a house with self-generation is practically negligible when it comes to
presenting changes in the grid by injecting or absorbing energy, provoking the voltage
variation caused by the grid inductance to be more like the load curve rather than the reactive
energy. In case 2, the impact of a house with self-generation is as well practically negligible
like the case 1. The difference is that in this case 2, the variation does not follow either load
sequence or a reactive power curve. In addition, in case 3 it does not occur, this one having
18 houses influences much more in the voltage variation.

As far as reactive power is concerned, it seems that as the number of houses in three-phase
systems increases, the reactive power generated by the system also increases.

Conclusion 3: Reactive absorbing is better, but it has limits


Given that in cases 1 and 2 there is not much influence because there are few houses, no
differentiation was seen between the injection and absorption scenarios. In case 3 it is clear
that if the inverters are programmed to absorb and not to inject, they help in the stabilization
of the system, since as demonstrated in the graphs, the voltage variation remained within the
regulatory ranges of +/- 7% in Spain. In the same case 3, if the inverters were configured to
inject reactive power, the voltage would rise and exceed these ranges.

At the same time, focusing on the apparent energy data, it can be seen that if reactive power
is injected (Figure 76), the apparent power increases much more compared to absorbing it,
so the sizing of the electrical grid transformers, protections and others should be higher.
Therefore, absorbing reactive power not only helps to better stabilize the electrical grid, but
also to reduce the sizing of the devices.

It is also demonstrated that in a system there is a reactive saturation point, which means that
from that point on, the increase of houses with self-generation will not cause a proportional
increase in reactive power. In the next chapter, it will perform a simulation with the files used
for case 3, to see how the system would behave in the event of an electrical grid failure.

126
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

5. Response of Case 3 subjected to voltage sags


This chapter is going to analyze the behavior of case 3, subjected to voltage sags. At this
point, the operation of the models will not be explained, since exactly the same models as in
case 3 are used as well as the power profiles. In other words, it is exactly the same simulation.
To perform the voltage sags, it is going to be used the "Fundamental and/or Harmonic
generation" functions (Figure 135), where they are found within the three-phase electrical grid
model explained above. Unblocking the “Fundamental and/or Harmonic generation” option,
two harmonics can be programmed to be superimposed on the fundamental voltage of the
source.

The first vector is A: [Order Amplitude Phase Seq]. This parameter is only enabled if the
Fundamental and/or Harmonic generation check box is selected. Here it can be specified the
order, amplitude, phase, and the type of sequence (1 = positive-sequence; 2 = negative-
sequence; 0 = zero-sequence) of the first harmonic to be superimposed on the fundamental
signal. The voltage of the harmonic is specified in p.u of the positive-sequence voltage.

The second vector is B: [Order Amplitude Phase Seq]. This parameter is only enabled if the
Fundamental and/or Harmonic generation check box is selected. Here it can be specified as
the order, amplitude, phase, and the type of sequence (0 = zero sequence, 1 = positive
sequence, 2 = negative sequence) of the second harmonic to be superimposed on the
fundamental signal. The voltage of the harmonic is specified in p.u of the positive - sequence

Figure 135: Three- Phase Voltage Grid Source, Block Parameters

127
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

voltage. Finally, the last variable to be introduced is Timing (s), where this parameter is
enabled only if the Fundamental and/or Harmonic generation check box is selected. In Matlab
code, two variables must be introduced in this vector: er1 corresponds to the stars and er2 to
the end.

This study simulated 3 scenarios with 3 different inductance values and 3 different voltage
sags range times. Inductance grid values are going to be the same as the case 3:
Red → L=1.0e-6 H ; R= 1e-6 Ω
Blue→ L=9.0e-5 H ; R= 1e-6 Ω
Magenta → L=2.4e-4 H ; R= 1e-6 Ω

The 3 scenarios will be the same as those seen up to now:


- Scenario 1: reactive absorption (self-generation)
- Scenario 2: reactive injection (self-generation)
- Scenario 3: non-self-generation

The 3 time ranges where voltage sags will occur are as follows:
- Range 1 → from 02:00 to 04:00 (er1=02:00, er2=04:00) (maximum reactive power)
- Range 2 → from 13:00 to 15:00 (er1=13:00, er2=15:00) (minimum reactive power)
- Range 3 → from 21:00 to 23:00 (er1=21:00, er2=00:00) (maximum consume)

These time ranges have not been chosen at random: Range 1 corresponds to when in
scenarios 1 and 2 there is more reactive power available and in scenario 3 there is less
consumption also. In range 2 it happens that in ranges 1 and 2 there is not much reactive
power. Finally, in range 3 is when the highest consumption occurs in all scenarios and those
with self-generation again have enough reactive power. The graphs extracted from the
simulation will be presented in the pages below, followed by the subsequent figures:
- Figures 136, 137 and 138 correspond to Range 1
- Figures 139, 140 and 141 correspond to Range 2
- Figures 142, 143 and 144 correspond to Range 3

128
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 136: Case 4, Voltage sags Scenario 1 (reactive absorption) – Range Time 1

129
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 137: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 1

130
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 138: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 1

131
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 139: Case 4, Voltage sags Scenario 2 (reactive absorption) – Range Time 2

132
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 140: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 2

133
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 141: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 2

134
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 142: Case 4, Voltage sags Scenario 2 (reactive absorption) – Range Time 3

135
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 143: Case 4, Voltage sags Scenario 2 (reactive injection) – Range Time 3

136
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure 144: Case 4, Voltage sags Scenario 3 (non-self-generation) – Range Time 3

137
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

5.1. Annotations From Range 1 (Figures 136, 137 and 138)


With the corresponding figures, it can be seen that phase A exceeds the value regardless of
the grid inductance and scenario. In the reactive absorption scenario 1, the voltage exceeds
the -7% normative. In addition, in the injection scenario 1 it helps to maintain the voltage values
of phases B and C at the normative values. In addition, another thing that can be observed is
the relationship between the grid inductance and the variation of the voltage exceeding the
limits, since the higher the grid inductance, the more the grid voltage exceeds the limits. In the
hourly section where the fault occurs, it is shown that if the system has reactive capacity, it is
better to inject than to absorb, since this causes the voltage to rise.

Outside this hourly period, the reactive power absorption scenario is superior to the reactive
power absorption scenario. So, it seems clear that in case of lifting the electrical grid, the
scenario of injecting outperforms the absorbing scenario in terms of raising the tension. In
scenario 3, the system has no response capacity since it can neither inject nor absorb reactive
power, so the voltages of all phases are not raised. What causes the voltage to rise in this
case is the increase of the parasitic inductance of the electrical grid.

5.2. Annotations From Range 2 (Figures 139, 140 and 141)


The conclusions of this range 2 are very similar to those of range 1. Let us remember that this
range is when the system has less reactive power, so it is the time of the day when it has less
capacity to support the electrical grid. In this case, since there is less reactive power, as this
energy is the one that causes more distortion in the electrical grid, in this range the voltage of
phases B and C is maintained in the ranges in the 3 cases. Except in scenario 2 where it
depends on the electrical grid inductance, the values are out of the norm.

This range implies that in cases where a grid disturbance occurs and the system has less
reactive power, it is better for the inverters to absorb. Just the opposite of range 1, where the
system has a lot of reactive power and it is better to inject it to raise the voltage.

5.3. Annotations From Range 3 (Figures 142, 143 and 144)


In this last range the previous conclusions are reaffirmed: the system has reactive power, so
if there is a disturbance in the electrical grid it is better to inject rather than absorb. In addition,
if it is a electrical grid without generation, the system simply has no response and only
increases the voltage if there is an increase in the parasitic inductance of the electrical grid.

138
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

5.4. Conclusions
With this simulation it is clear that in a system without generation, the voltage variation due to
reactive power is less unstable and higher grid inductances are needed to exceed the
normative values. The problem with this system is that although it is more stable from this
point of view, it does not have the capacity to react and to lift or support the electrical grid, it
adopts a passive behavior. Apart from eliminating the benefits of needing less active power
with respect to the scenarios with self-generation.

In contrast, scenarios 1 and 2 show greater voltage variation with the same grid inductance
values as scenario 3. This makes it a more sensitive system, where the voltage has more
variations. But contrary to scenario 3, scenarios 1 and 2 have the ability to support the grid. It
has been seen from the figures that in cases where the system has less reactive power
capacity, it is better for the inverters to absorb. Otherwise, in cases where there is a high
reactive capacity it is just the opposite, it is better to inject it to raise the voltage. Because it
seems clear that in case of lifting the electrical grid, the scenario of injecting outperforms the
absorbing scenario if the system has reactive power capacity. However, as shown in the
comparison of Figures 136 and 137, absorbing reactive power is better for the overall stability
of the electrical grid. What happens is that in the time section where there is a fault, if reactive
power is absorbed, the voltage remains outside the margins, whereas if it is injected, the
voltage rises within the margins.

Therefore, the ideal control would seem to be that the injection and absorption of reactive
power would change according to the needs of the electrical grid. In case there is no fault it is
better that the inverters are absorbing. Besides that, if a fault causes the voltage of a phase
to decrease, it is better that the reactive is injected just in that specific time range in which the
fault occurs. On the other hand, if the fault causes an overvoltage, as can be seen in phase A
of the figures in this section, it is better to be absorbed, since it causes the voltage variation to
decrease.

139
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

140
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

6. Final conclusions of the study


To become more sustainable, environmentally friendly and greener, societies and
governments must innovate in all areas, especially in the electrification of transportation and
power generation. Until a new technology capable of reducing the negative impacts of these
sectors is developed, there are 2 options: either wait to find that technology or take advantage
of and improve current resources so that when that new technology arrives, the electricity
system will already have a long way to go and will be ready to adapt those technologies.
Today, with the rise of solar generation and the advance of electric vehicles along with the
forecast of global energy consumption, it seems clear that all these major changes will force
the power grid to become a new one with more:
- Complexity in energy systems.
- Efficiency in dealing with demand outstripping supply of energy.
- It will have to be prepared for the future and current technologies of energy storage
systems like batteries of electric cars behaving like it.
- Friendly with self-generation solar power and electric vehicles to generate energy
where it is consumed, the closer generation the better.
- Flexible in user consumption profiles. Modernization of data systems to have greater
control of the grid and encourage Smart Grids.
Throughout this work, the impact of these technologies on a conventional electrical grid has
been presented, showing the advantages and disadvantages of their implementation.

In the case of analyzing a single house with solar self-generation and electric car it has been
proved that scenarios with self-generation need less energy compared to the scenario of a
house without solar panels and an electric car showing that a single house could help to the
grid and reduce large-scale power generation. In addition, apart from needing less active
energy, self-generated houses can deliver by absorbing or injecting reactive power.
Unfortunately, this study demonstrates that the contribution of a single house is not enough,
in fact, it is practically negligible when it comes to presenting changes in the grid by injecting
or absorbing energy. All this makes the voltage variation curve caused by the grid inductance
more similar in shape to the load curve than the reactive power. For this reason, it was decided
to continue the investigation but with 3 houses, giving rise to case study 2.

In this case 2 the results were very similar to the case 1 meaning the self-generation scenarios
provide more power to the grid and at the same time needing less active power. In this regard,
the effect of electric car charging on the change in grid consumption compared to a grid system
without self-generation and EVs was seen more clearly. In fact, the differences in the
consumption profile were noticeably at night. Regardless of whether the inverters are working

141
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

to inject or absorb reactive power, any remarkable results show improvements in voltage
variation through the grid inductance. With the simulations of case 1 and 2, it is demonstrated
that for a system of houses with self-generation and electric vehicles to have the capacity to
support the grid, it needs a greater number of these homes. Knowing this situation, case 3
was simulated in a three-phase grid with 18 houses.

From the simulations performed on case 3, it was possible to reaffirm that the houses with
solar generation and electric vehicles increase the consumption in low hours (at night) and
decrease it in the sunny hours. Making a balance of all the energy consumed, it can be
concluded that the houses with self-generation consume considerably less active energy than
the normal ones and also presents much more reactive power to inject or absorb than in
scenario 3 (houses without self-generation and EVs). So, in the end, the extra consumption of
the electric car when charging at night is compensated by the surplus of solar energy, where
finally, as mentioned above, houses with self-generation represent less consumption for the
grid. With the simulation of case 3, it is clear that the more houses with self-generation and
electric vehicles, the higher the power for grid stabilization is, having 18 houses influences
much more in the voltage variation. As far as reactive power is concerned, it seems that as
the number of houses in three-phase systems increases, the reactive power generated by the
system also increases. Contrary to the previous cases, in case 3 it is clear that if the inverters
are programmed to absorb and not to inject, they help in the stabilization of the system. On
the other hand, if the inverters are configured to inject reactive power, the voltage trends to
rise. An observation that could not be made in the other cases is on the apparent energy,
where it can be seen that if reactive power is injected, apparent power increases much more
compared to absorbing it. This would lead to improvement and expansion in the sizing of the
electrical grid transformers, protections and others. Therefore, absorbing reactive power not
only helps to better stabilize the electrical grid, but also to reduce the sizing of the devices.

Finally with the evaluation of case 3 subjected to voltage sags, it is clear that in a system
without self-generation and EVs, the voltage variation due to reactive power is less unstable
and higher grid inductances are needed to exceed the normative values. Even so, given that
the system stops to obtain the other advantages of having self-generating homes and electric
vehicles, it cannot be considered a good line of thinking. Scenarios with self-generation and
EVs (scenarios 1 and 2) presented greater voltage variation making it a more sensitive system.
Also, when inverters are injecting, outperforms the absorbing scenario if the system has
reactive power capacity and needs to elevate the grid voltage. On the other hand, if the system
need to reduce the voltage grid, the scenario of absorbing reactive outperforms the injection
one.

142
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Having clarified the main conclusions of each point, the following is a summary list of the most
important conclusions of this research conducted through this work:
- In order to show an effect on grid support, the system needs several houses with self-
generation and electric vehicles.
- If the car is plugged in at home, it can act as a battery and reduce the consumption
injecting active power in the hours when the consumption is higher, and the electricity
is more expensive.
- It is possible to reaffirm that the houses with solar generation and electric vehicles
increase the consumption in low hours (at night) and decrease it in the sunny hours
- Systems with self-generation presents much more reactive power than in scenarios 3
from all the cases.
- The voltage variation due to reactive power in non-self-generation systems is less
unstable and higher grid inductances are needed to exceed the normative values. The
problem with this system is that although it is more stable from this point of view, it
does not have the capacity to react and to lift or support the electrical grid, it adopts a
passive behavior. Apart from eliminating the benefits of needing less active power with
respect to the scenarios with self-generation.
- In large simulations and cases with a vast number of homes with self-generation and
EVs, absorbing reactive power not only helps to a better stabilization of the electrical
grid, but also to reduce the sizing of the devices due to the apparent energy. If reactive
power is injected through inverters, apparent power increases much more compared
to absorbing it, leading to a necessary improvement and expansion in the sizing of the
electrical grid transformers, protections and others.
- It is also demonstrated that in a system there is a reactive saturation point, which
means that from that point on, the increase of houses with self-generation will not
cause a proportional increase in reactive power.
- If the system is subjected to voltage sags, it is clear that in a system without self-
generation and EVs, the voltage variation due to reactive power is less unstable and
higher grid inductances are needed to exceed the normative values.
- Even so system without self-generation and EVs are more stable, given that the
system obtaining the other advantages of having self-generating homes and electric
vehicles, it cannot be considered a good line of thinking.
- Systems with self-generation and EVs presents greater voltage variation with less grid
inductance, making it a more sensitive system than a normal electric grid.
- In cases where the system has less reactive power capacity, it is better for the inverters
to absorb.

143
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

- In case of rising the grid voltage, the scenario of injecting outperforms the absorbing
scenario if the system has reactive power capacity
- In the case of lowering the grid voltage, the absorption scenario outperforms the
injection scenario if the system has reactive power capacity.
- The ideal control would be that the injection and absorption of reactive power would
change according to the needs of the electrical grid. In case there is no fault it is better
that the inverters are absorbing. In addition, if there is a fault that causes the voltage
of a phase to decrease, it is better to inject reactive power just in that specific time
range in which the fault occurs. On the contrary, if the fault causes an overvoltage, it
is better to be absorbed, since it causes the voltage variation to decrease.
Before the end, a review of the objectives of the work will be made to see if they have been
met:
- Analyze and comprehend the impact of solar panels & electric vehicles in the public
grid.
Thanks to the set of simulations, the use of graphs and the conclusions drawn, this point is
considered analyzed.
- See which reactions have the public grid due to active power.
- See which reactions have the public grid due to reactive power injection and
absorption.
- See the results using different grid inductance values.
Throughout this work, different simulations have been done by configuring the inverters to
absorb or inject reactive power. This has been one of the main points studied in this work, so
it is considered that it has been fulfilled.
- Compare a complete model with and without distributed power generation through
solar panels and electric vehicles and, at the same time, differentiating reactive power
injection and absorption.
In all the simulated cases, the results obtained have been constantly compared with scenarios
where the grid did not have self-generating houses and electric vehicles.
- Analyze if a distributed power generation grid could support the public grid through
reactive power.
This topic has been discussed but not as deeply as the previous ones, since it has been
shown that it can support the electrical grid but it needs a more complex control. As a personal
objective, my intention would be to further develop this point and implement it in the different
cases exposed.
- Analyze and understand the advantages and disadvantages of a distributed generation
system.
With all the research done, this objective has been completed.

144
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

After reading the entire work, it can be seen that most of the initial objectives have been
achieved. As possible future improvements, the most important would be the proposal of a
real time control over the grid voltage, injecting and absorbing reactive power through the
inverters of the solar panels and electric vehicles. Personally, the result has been very
satisfactory.

145
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

146
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

References

[1] Z. Li and Y. Yuan, “Smart microgrid: a novel organization form of smart distribution grid in
the future,” Automation of Electric Power Systems, vol. 33, no.17, pp. 42–47, September 2009.

[2] Michael E., Sigifredo Gonzalez. "Development of a MATLAB/Simulink model of a single-


phase grid-connected photovoltaic system." IEEE Transactions on Energy Conversion, 24.1
(2009): 195-202

[3] Ogbonnaya Bassey, Student Member. “Modeling Single-Phase PQ Inverter for


Unbalanced Power Dispatch in Islanded Microgrid” IEEE, Karen L. Butler-Purry, Fellow, IEEE

[4] Winid Sripipat and Sakorn Po-Ngam. “Simplified Active Power and Reactive Power Control
with MPPT for Single-Phase Grid-Connected Photovoltaic Inverters”. Power Electronics and
Motor Drives Laboratory (PEMD LAB) Department of Electrical engineering, Faculty of
Engineering King’s Mongkut University of Technology Thonburi , Thailand

[5] R. Kabiri, D. G. Holmes, B. P, McGrath. “The Influence of PV Inverter Reactive Power


Injection on Grid Voltage Regulation”. School of Electrical and Computer Engineering RMIT
University, Melbourne, Australia

[6] Yang CHEN, Jinbin ZHAO, Keqing QU, Fen LI. “A PQ Control strategy for Voltage-
Controlled Inverters Applied in Low-Voltage Power System”. College of Electric Engineering
Shanghai University of Electric Power Shanghai, China, 2019

[7] Bill Gates (2020). How to Avoid a Climate Disaster: The Solutions We Have and the
Breakthroughs We Need. (Chapter 1-4)

[8] Miquel Barceló (2020). Innocities (Chapter 2.3)

[9] Amirnaser Yazdani; Reza Iravani (2010). Voltage-Sourced Converters in Power Systems.
Modeling, Control and Applications (Chapter 4)

[10] Updated draft of the National Integrated Energy and Climate Plan 2021-2030 (2020)
document link:
https://www.miteco.gob.es/images/es/pniec_2021-2030_borradoractualizado_tcm30-
506491.pdf

[11] International Energy Agency (2021) Net Zero by 2050: Net Zero by 2050 Scenario - Data
product – IEA. Document link: https://www.iea.org/data-and-statistics/data-product/net-zero-
by-2050-scenario

[12] Agustín Gargallo Tatay (2017). Medición y análisis del consumo energético de energía
eléctrica en los receptores doméstico en condiciones reales de funcionamiento: Aplicación a
una vivienda unifamiliar, 9-21. Document link:
https://riunet.upv.es/bitstream/handle/10251/106520/21790210X_Trabajo_15308153330007
985563568234754430.pdf?sequence=1

147
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

[13] Organización de Consumidores y Usuarios (2020). Information link:


https://www.ocu.org/vivienda-y-energia/gas-luz/noticias/aumento-consumo-electrico-
confinamiento

[14] World Energy Scenarios. Project Partner Paul Scherrer Institute (PSI), Switzerland
(2020). Composing energy futures to 2050. Composing Energy Futures to 2050 Chapter.
Document link: https://www.worldenergy.org/assets/downloads/World-Energy-
Scenarios_Composing-energy-futures-to-2050_Executive-summary.pdf

[15] Hannah Ritchie; Max Roser; Pablo Rosado (2022). Our World in Data. Energy.
Document link: http://https//ourworldindata.org/energy

[16] Hannah Ritchie (2020). Our World in Data: The carbon footprint of foods: are differences
explained by the impacts of methane? Document link: https://ourworldindata.org/carbon-
footprint-food-methane

[17] Hannah Ritchie (2020). Our World in Data: You want to reduce the carbon footprint of
your food? Focus on what you eat, not whether your food is local. Document link:
https://ourworldindata.org/food-choice-vs-eating-local

[18] Hannah Ritchie (2020). Our World in Data: You want to reduce the carbon footprint of
your food? Focus on what you eat, not whether your food is local. Document link:
https://ourworldindata.org/food-choice-vs-eating-local

[19] Hannah Ritchie; Max Roser (2022). Our World in Data: CO2 emissions. Document link:
https://ourworldindata.org/co2-emissions

[20] Hannah Ritchie (2019). Our World in Data: Food production is responsible for one-
quarter of the world’s greenhouse gas emissions. Document link:
https://ourworldindata.org/food-ghg-emissions

[21] Brandon Graver, Ph.D., Kevin Zhang, Dan Rutherford, Ph.D (2018). CO2 emissions from
commercial aviation. Document link:
https://theicct.org/sites/default/files/publications/ICCT_CO2-commercl-aviation-
2018_20190918.pdf

[22] Energy Environment Agency (2017). Energy and climate change. Document Link:
https://www.eea.europa.eu/signals/signals-2017/articles/energy-and-climate-
change#:~:text=Climate%20change%20can%20alter%20our,for%20heating%20in%20the%
20winter

[23] Hannah Ritchie; Max Roser; Pablo Rosado (2020). Our World in Data: Emissions by
sector. Document link:
https://ourworldindata.org/emissions-by-sector#total-greenhouse-gas-emissions-by-sector

[24] Hannah Ritchie; Max Roser; Pablo Rosado (2020). Our World in Data Global primary
Global primary energy: how has the mix changed over centuries? Document link:
https://ourworldindata.org/energy-mix

148
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

[25] Hannah Ritchie; Max Roser; Pablo Rosado (2020). Nuclear Energy Power. Document
link: https://ourworldindata.org/nuclear-energy

[26] Hannah Ritchie; Max Roser; Pablo Rosado (2020). Renewable Energy Power. Document
link: https://ourworldindata.org/renewable-energy

[27] Hannah Ritchie; Max Roser (2022). Electricity-Mix Energy Power. Document link:
https://ourworldindata.org/electricity-mix

[28] Hannah Ritchie; Max Roser (2021). Energy Access. Document link:
https://ourworldindata.org/energy-access

[29] Hannah Ritchie; Max Roser (2021). Energy Production Consumption. Document link:
https://ourworldindata.org/energy-production-consumption

149
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

150
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A1: Global greenhouse gas emissions by sector, Annex 1

Annex 1: CO2 Emissions by sector


In this annex, is going to contain an a more deeply explanation into the greenhouse gas
emissions by sector. Let’s talk a bit about the main sector of this project, the energy and their
sub-sectors in the pie Figure A1.

Energy use in industry (24.2%)


- Iron and Steel (7.2%):
Emissions from the manufacturing of iron and steel.
- Chemical & petrochemical (3.6%):
Emissions from the manufacturing of fertilizers, pharmaceuticals, refrigerants, oil and gas
extraction, etc.

151
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

- Food and tobacco (1%):


Emissions from the manufacturing of tobacco products and food processing (for example, the
conversion of raw agricultural products into their final products, such as the conversion of
wheat into bread).
- Non-ferrous metals (0.7%):
Non-ferrous metals are metals which contain very little iron: this includes aluminium, copper,
lead, nickel, tin, titanium and zinc, and alloys such as brass. The manufacturing of these
metals requires energy, which results in emissions.
- Paper & pulp (0.6%) & Machinery (0.5%):
Emissions from the conversion of wood into paper and pulp and from the production of
machinery.
- Other industry (10.6%):
Such as construction, textiles, wood products, and transport equipment or car manufacturing

Transport (16.2%)
This part has to be considered as indirect emissions due to it includes a small amount of
electricity as well as all direct emissions from burning fossil fuels to power transport activities.
It is important to know that the above graphic does not include emissions from the
manufacturing of motor vehicles or other transport equipment, this is included in the previous
point ‘Energy use in Industry’.
- Road transport (11.9%):
Emissions from the burning of petrol and diesel from all forms of road transport which includes
cars, trucks, motorcycles, buses etc. Approximately 60% of the emissions come from
passenger travel (cars, motorcycles and buses); and the remaining forty percent from road
freight (lorries and trucks). Knowing that road transport emissions are the biggest factor in
transport emissions, it is clear society should become aware of this and transform our vehicles
into electric or other non-polluting technologies.
- Aviation (1.9%):
According ICCT (The International Council on Clean Transportation) the 81% of aviation
emissions come from passenger travel; and 19% from freight. From passenger aviation, 60%
of emissions come from international travel, and 40% from domestic. The study is from 2018,
there have not been many changes.
- Shipping (1.7%):
Emissions from the burning of petrol or diesel on boats. This includes both passenger and
freight maritime trips.

152
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

- Rail (0.4%):
Emissions from passenger and freight rail travel. Apart from the electrification of our particular
vehicles, maybe new policies should be oriented into the develop of more railways. Trains are
clean and very efficient.
- Pipeline (0.3%):
Fuels and commodities (e.g. oil, gas, water or steam) often need to be transported (either
within or between countries) via pipelines. This requires energy inputs, which results in
emissions. Poorly constructed pipelines can also leak, leading to direct emissions of methane
to the atmosphere. However, these leaks are in the category ‘Fugitive emissions from energy
production’.

Energy use in buildings (17.5%)


- Residential buildings (10.9%):
Emissions related from the generation of electricity for lighting, appliances, cooking and
heating at home.
- Commercial buildings (6.6%):
Emissions related from the generation of electricity for commercial buildings such as offices,
restaurants, and shops.

Unallocated fuel combustion (7.8%)


This category considers the emissions from the production of energy from other fuels including
electricity and heat from biomass; on-site heat sources; combined heat and power, nuclear
industry and pumped hydroelectric storage.

Fugitive emissions from energy production (5.8%)


- Fugitive emissions from oil and gas (3.9%):
Fugitive emissions, are the accidental leakage of methane to the atmosphere during oil and
gas extraction and transportation, from damaged or poorly maintained pipes. This also
includes flaring, which is the act of burning gas or oil intentionally and normally happens when
producers do not have an existing network of pipelines to transport it, or when it wouldn’t make
economic sense to provide the infrastructure needed to effectively capture and transport it.
- Fugitive emissions from coal (1.9%):
Emissions are the accidental leakage of methane during coal mining.

153
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Energy use in agriculture and fishing (1.7%)


Emissions from the use of machinery in agriculture and fishing, such as fuel for farm machinery
and fishing vessels.
Direct Industrial Processes (5.2%)
- Cement (3%):
Carbon dioxide is produced as a by-product of a chemical conversion process used in the
production of clinker, a component of cement. Cement production also produces emissions
from energy inputs, but these are included in ‘Energy Use in Industry’.
- Chemicals & petrochemicals (2.2%):
Greenhouse gases can be produced as a by-product from chemical processes Chemical and
petrochemical manufacturing also produces emissions from energy inputs (included in ‘Energy
Use in Industry’).

Waste (3.2%)
- Wastewater (1.3%):
Organic wastes and residues from animals, plants, humans and their waste products can
collect in wastewater systems. When this organic matter decomposes, it produces methane
and nitrous oxide.
- Landfills (1.9%):
Landfills are often low-oxygen environments. In these environments, organic matter is
converted to methane when it decomposes.

Agriculture, Forestry and Land Use (18.4%):


Agriculture, Forestry and Land Use directly accounts for 18.4% of greenhouse gas emissions.
The food system as a whole (including refrigeration, food processing, packaging, and
transport) accounts for around one-quarter of greenhouse gas emissions. If will be discussed
in more detail below.

154
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A2: Greenhouse gas emissions by sector, Annex 2

Figure A3: CO2 emissions by sector Per capita from China in 2018, Annex 2

Annex 2: Emissions by sector


Seen Figure A2 first it can be visualized the data at the global level and confirm that energy
generation, heat and transport are the biggest factors in CO2 emissions Let's see what
happens in the area that generates the most pollution in absolute terms, China (Figure A3).
China is the country with the most electric cars, high speed trains and regular trains. This is

155
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

expected to only increase in the near future, as China's intention is to have more trains than
airplanes and to be the world power in terms of electric mobility.

Figure A4: CO2 emissions by sector Per capita from USA in 2018, Annex 2

Also, because it is a country in constant growth, construction and manufacture represents a


huge part of China's emissions, and this has a double impact because it produces more land-
use and deforestation. On the other hand, the comparison between a more stable economy
in terms of not growing their population and GDP massively, their emissions by sector are
more similar to the world. Let’s see what happens in the USA in the Figure A4.

The USA has a problem with transport, North American people use their cars for everything
and there is not enough public transport like buses or trains and there are not many electric
vehicles. That is why they use aviation more frequently than China. In contrast, the major part
of buildings in the USA are old, that is why it is supposedly a major factor than China’s
buildings. Although the USA is growing, it is not growing at the same rate as China, so its
impact is also lower.

In the next page Figure A5, it can be seen the data from the European Union, where it can be
seen in terms per capita, every sector is less compared to China and USA. It could surprise
the contribution of transport and agriculture, but Europe is leading the world in terms of
recovering forests and protecting national parks, that is why in the European Union the land-
use change and forestry is higher and is helping with the absorption of CO2 emissions.

156
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A5: CO2 emissions by sector Per capita from EU in 2018, Annex 2

Figure A6: CO2 emissions by sector Per capita from Spain in 2018, Annex 2

Finally, there is going to be the presentation of Spain data (Figure A6), where it is surprising
to see that the main source of pollution is transportation, surpassing energy generation. Due
to being one of the most visited countries, Aviation and shipping are huge factors too.

157
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

158
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A7: Number of deaths by risk factor in 2019, Annex 3

Annex 3: Is nuclear clean energy?


It could sound weird to say that nuclear energy is clean, but scientifically and statistically
speaking it is true. One of the main factors to reinvent our energy mix is due to the deaths
attributed to air pollution, becoming the third risk factor of human deaths in the world Figure
A7.

Is it clear that renewable energy should be the main focus, but governments and societies
shouldn’t leave apart nuclear generation because this energy does not generate CO2 or
greenhouse gasses and also it is very safe. If there are a comparison between nuclear energy
with others, especially fossil fuels it can be seen that the balance between safe and clean is
clearly on the side of nuclear and renewable energies as it can be seen in the next page Figure
A8. If it is not enough, the death rates from energy production per TWh and the conclusions
are the same, nuclear power is safer according to this data Figure A9.

159
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A8: Safest and cleanest sources of energy, Annex 3

Figure A9: Death rates from energy production per TWh, Annex 3

The potential risks of nuclear energy are real: in both Chernobyl and Fukushima, deaths
occurred as a result of direct nuclear impacts, radiation exposure and psychological stress.
Chernobyl was an accident caused by a technology that was not mature and above all
because a nuclear power plant was built in a facility that was not designed for it. Since then,
there have been no more accidents caused by technological or man-made failures. Fukushima
was a horrible accident, but it was caused by a tsunami.

160
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A10: Nuclear Power Generation, Annex 3

There have only been 2 accidents, one due to a lack of technology and one due to a tsunami.
Since then, nuclear power plants have improved a lot, and there is already talk that the new
plants will only have nuclear waste for 200 years. It should be noted that nuclear plants have
not had the same level of investment as the automotive sector. This sector had a lot of
investment from the beginning and that is why today's cars are safer, pollute less and consume
much less fuel than the first ones. This has not been the case with nuclear power plants since
the 70's when research stopped. If research had continued during the last 50 years, we would
surely have much better, more efficient nuclear power plants with less nuclear waste.

There is a need for more innovation in this energy because it is one of the cleanest and less
deadly that exists. Nonetheless, of the two largest nuclear disasters, the death toll was of the
order of thousands, and hundreds in the latest. Arguably still too many, but far fewer than the
millions who die every year from impacts of other conventional energy sources, as it could
have seen before. Nuclear risk is generally focused within low-probability, high-impact single
events, in contrast to air pollution impacts which provide a persistent background health risk.
In the last years nuclear generation has been in conversations, it seems that the scientific
community has convinced some countries and regions to continue using this type of
generation. Thanks to the Figure A10 is can be noticed that there has been a small growth in
nuclear energy.

161
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A11: Greenhouse gas emissions from food production, Annex 4

Annex 4: Food, the hidden key?


Finally, I would like to talk a bit about food and its implication in climate change. And I’m going
to talk in the same way as before. Following the information from Our World in Data, there is
Figure A11 of the gas emissions from food production.

It is alarming that only 26% of the greenhouses of global emissions came from food production,
which is something that maybe the world, especially the first world countries might need to
change with local agriculture, a more reasonable use of the resources and changes in our
diet.

162
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Now there is going to be an detailed explanation of each one gap:


- Grassland (0.1%):
When grassland becomes degraded, these soils can lose carbon, converting to carbon dioxide
in the process.
- Cropland (1.4%):
Depending on the management practices used on croplands, carbon can be lost or
sequestered into soils and biomass. This affects the balance of carbon dioxide emissions.
- Deforestation (2.2%):
Reforestation is counted as ‘negative emissions’ and deforestation as ‘positive emissions’. Net
forestry change is therefore the difference between forestry loss and gain. Emissions are
based on lost carbon stores from forests and changes in carbon stores in forest soils.
- Crop burning (3.5%):
The burning of agricultural residues releases carbon dioxide, nitrous oxide and methane.
Farmers often burn crop residues to prepare land and make it more rich.
- Rice cultivation (1.3%):
Although it has his impact, it is important to put this into context: rice accounts for around one-
fifth of the world’s supply of calories, and is a staple crop for billions of people globally.
- Agricultural soils (4.1%):
This includes emissions from agricultural soils for all agricultural products – including food for
direct human consumption, animal feed, biofuels, and other non-food crops (such as tobacco
and cotton).
- Livestock & manure (5.8%):
Animals produce greenhouse gasses through the process of ‘fermentation’ in their digestive
systems, they produce methane as a by-product. Beef and lamb tend to have a high carbon
footprint, eating less is an effective way to reduce the emissions of your diet. Nitrous oxide
and methane can be produced from the decomposition of animal manures under low oxygen
conditions. This often occurs when large numbers of animals are managed in a confined area
(such as dairy farms, beef feedlots, and swine and poultry farms), where manure is typically
stored in large piles or disposed of in lagoons and other types of manure management systems
‘Livestock’ emissions here include direct emissions from livestock only – they do not consider
impacts of land use change for pasture or animal feed.

163
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A12: Global greenhouse gas emissions by gas, Annex 4

Following Figure A12, approximately 17% of the global greenhouse gas emissions came from
Methane, the problem is that it is 4 times more potent in greenhouse effect. Also, with the next
page graphic, it can be seen which kind of meats and products have more impact in the earth
comparing their use of:
- Land → biomass loss from deforestation or ground
- Farm → mainly methane emissions
- Animal feed → emissions from crop production and its processing
- Industrial processing → emissions from energy use in the conversion of raw food into
the final product
- Transport → emissions from the energy need it in the transport of food around the
world
- Retail → energy use in refrigeration or other processes to maintain in good quality of
the food and the final product
- Packaging → emissions from the production of the packaging and material transport

With the next page Figure A13 it can be seen that beef meat is by far the food that has the
highest impact on earth, followed by lamb, mutton, cheese and dairy products from beef.
Personally, what surprises me the most is that the production of coffee and chocolate surpass
pork and poultry meats. In the vast majority of the cases, it can be noticed that transport, retail
and packaging contribute to a lesser extent to the impact. The use of land and farm are the
main factors, especially in meat products and derivatives. May be world does not realize it,
but by eating less meat, or substituting poultry and fish for beef, along with reducing other
products, these actions can make a big impact on the earth. The change has to come not only
from technology, also from our habits and diets. If it is too much for us to become vegetarian
or vegan, it could be a good decision in terms of the planet to substitute beef, lamb and mutton
for poultry, pork and eggs, this change would maintain the amount of animal proteins and
amino acids having less impact on the earth and at the same time, improving our diet.

164
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A13: Deforestation produced by food category, Annex 4

Because these types of meats have less fat and are not red meat. If at the same time, also
reduce our consumption of cheese or dairy products, eat more vegetables and fruits from our
area, people would be also healthier and more sustainable. In addition, a major part of the
deforestation came from the production of beef, representing 41% of the total as shown in
Figure A14.

165
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A14: Greenhouse gas emissions across the supply chain, Annex 4
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 5: Case 1 Matlab code


close all;clear all;clc

%% definition of voltage
fo=50;
wo=2*pi*fo;
To=1/fo;
v_amplitut=220*sqrt(2); Definition of voltage, frequency and network
v_amplitut_2=v_amplitut^2; period. Also of the cut-off and computational
v_ef=v_amplitut/sqrt(2); frequency values. The variable “delma”
corresponds to a value for the decimation of the
fc=0.5;
wc=2*pi*fc; variables (internal parameter of a "To Workspace
fs=10e3; %switching block).
ts=1/fs;
delma=10;

V_DC_SOLAR=400;
V_DC_EV=400;
DC voltage simulating the buck-boost circuit.
% MAIN VARIABLES Declaration of the power ratings of the house, solar
PHouse=5750;
panels and electric vehicle (W). Capacitor and
SOLAR_POWER=4400;
EV_POWER=3600; inductor values for the voltage filter inside the
inverters.
%% PASSIVE ELEMENTS
C2=52*1e-6; %[F] considering the max current output from the inverter
L2=1.9656*1e-3; %[H] considering the max current output from the inverter
C2EV=C2;
L2EV=L2;

%SOLAR PANELS
%% definition of K constant Definition of control constants for the Solar
ki_SOLAR=3; inverter. Calculation of the house resistance
kp_SOLAR=3;
and average absorbed power of the house.
kd_SOLAR=1;

%P=VI=I^2·R=V^2/R --> R= P/I^2 = V^2/P


P_LOAD_1=PHouse;
LOAD_1=0.5*v_amplitut_2/P_LOAD_1;%[Ohm] minimum LOAD

V_pico=v_ef*sqrt(2);
Pave_load=V_pico^2/(2*LOAD_1); %average power absorved by the LOAD

delay_solar=To/4; %DELAY TIME

%%%%% SOLAR CONTROL CONSTANTS %%%%%


kp_P_SOLAR=0.2;
ki_P_SOLAR=20; Definition of active and reactive power
kp_Q_SOLAR=0.2; control constants for the solar inverter.
ki_Q_SOLAR=20;
Definition of control constants for the Solar
%BATTERY CAR inverter. Delay for reactive power.
%% definition of K constant
ki_EV=3;
kp_EV=3;
kd_EV=1;%encender o apagar ese termino

167
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%%%%% EV CONTROL CONSTANTS %%%%%


kp_P_EV=0.2;
Definition of active and reactive power
ki_P_EV=20; control constants for the EV inverter.
kp_Q_EV=0.2; Definition of control constants for the Solar
ki_Q_EV=20; inverter. Delay for reactive power.

%PROFILE LOAD
L11=(LOAD_1/0.2); L12=(LOAD_1/0.2); %CASE 1 00:00-01:00
L21=(LOAD_1/0.2); L22=(LOAD_1/0.2); %CASE 2 01:00-02:00
Declaration of the
L31=(LOAD_1/0.2); L32=(LOAD_1/0.2); %CASE 3 02:00-03:00 load profile plus the
L41=(LOAD_1/0.2); L42=(LOAD_1/0.2); %CASE 4 03:00-04:00 creation of the
L51=(LOAD_1/0.2); L52=(LOAD_1/0.2); %CASE 5 04:00-05:00 vector that will go
L61=(LOAD_1/0.2); L62=(LOAD_1/0.2); %CASE 6 05:00-06:00
into the repeating
L71=(LOAD_1/0.2); L72=(LOAD_1/0.3); %CASE 7 06:00-07:00
L81=(LOAD_1/0.3); L82=(LOAD_1/0.4); %CASE 8 07:00-08:00 sequence
L91=(LOAD_1/0.4); L92=(LOAD_1/0.4); %CASE 9 08:00-09:00
L101=(LOAD_1/0.4); L102=(LOAD_1/0.23); %CASE 10 09:00-10:00
L111=(LOAD_1/0.23); L112=(LOAD_1/0.25); %CASE 11 10:00-11:00
L121=(LOAD_1/0.25); L122=(LOAD_1/0.25); %CASE 12 11:00-12:00
L131=(LOAD_1/0.30); L132=(LOAD_1/0.35); %CASE 13 12:00-13:00
L141=(LOAD_1/0.35); L142=(LOAD_1/0.50); %CASE 14 13:00-14:00
L151=(LOAD_1/0.50); L152=(LOAD_1/0.50); %CASE 15 14:00-15:00
L161=(LOAD_1/0.50); L162=(LOAD_1/0.45); %CASE 16 15:00-16:00
L171=(LOAD_1/0.45); L172=(LOAD_1/0.40); %CASE 17 16:00-17:00
L181=(LOAD_1/0.40); L182=(LOAD_1/0.35); %CASE 18 17:00-18:00
L191=(LOAD_1/0.47); L192=(LOAD_1/0.67); %CASE 19 18:00-19:00
L201=(LOAD_1/0.67); L202=(LOAD_1/0.80); %CASE 20 19:00-20:00
L211=(LOAD_1/0.80); L212=(LOAD_1/0.90); %CASE 21 20:00-21:00
L221=(LOAD_1/0.90); L222=(LOAD_1/1.00); %CASE 22 21:00-22:00
L231=(LOAD_1/1.00); L232=(LOAD_1/0.80); %CASE 23 22:00-23:00
L241=(LOAD_1/0.80); L242=(LOAD_1/0.50); %CASE 24 23:00-00:00

sequence_LOAD= [L11 L12 L21 L22 L31 L32 L41 L42 L51 L52 L61 L62 L71 L72
L81 L82 L91 L92 L101 L102 L111 L112 L121 L122 L131 L132 L141 L142 L151
L152 L161 L162 L171 L172 L181 L182 L191 L192 L201 L202 L211 L212
L221 L222 L231 L232 L241 L242];

%%%%%%%%%% TIME FOR CASES %%%%%%%%%%%


st1=0.001;%separation time
absolute_tolerance=0.000001;
time_scale_factor=1;
%_______________________________________________________________________________
t11=0.02;t12=1; %00:00 - 01:00
t21=t12+st1;t22=t21+1; %01:00 - 02:00
t31=t22+st1;t32=t31+1; %02:00 - 03:00
t41=t32+st1;t42=t41+1; %03:00 - 04:00 Definition of the time vector that
t51=t42+st1;t52=t51+1; %04:00 - 05:00 will go into the repeating
t61=t52+st1;t62=t61+1; %05:00 - 06:00 sequence
t71=t62+st1;t72=t71+1; %06:00 - 07:00
t81=t72+st1;t82=t81+1; %07:00 - 08:00
t91=t82+st1;t92=t91+1; %08:00 - 09:00
t101=t92+st1; t102=t101+1;%09:00 - 10:00
t111=t102+st1;t112=t111+1;%10:00 - 11:00
t121=t112+st1;t122=t121+1;%11:00 - 12:00
t131=t122+st1;t132=t131+1;%12:00 - 13:00
t141=t132+st1;t142=t141+1;%13:00 - 14:00

168
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

t151=t142+st1;t152=t151+1;%14:00 - 15:00
t161=t152+st1;t162=t161+1;%15:00 - 16:00
t171=t162+st1;t172=t171+1;%16:00 - 17:00
t181=t172+st1;t182=t181+1;%17:00 - 18:00
t191=t182+st1;t192=t191+1;%18:00 - 19:00
t201=t192+st1;t202=t201+1;%19:00 - 20:00
t211=t202+st1;t212=t211+1;%20:00 - 21:00
t221=t212+st1;t222=t221+1;%21:00 - 22:00
t231=t222+st1;t232=t231+1;%22:00 - 23:00
t241=t232+st1;t242=t241+1;%23:00 - 00:00

%SOLAR CASE
S11=0.00;S12=0.00; %00:00 - 01:00
S21=0.00;S22=0.00; %01:00 - 02:00
S31=0.00;S32=0.00; %02:00 - 03:00
S41=0.00;S42=0.00; %03:00 - 04:00
S51=0.00;S52=0.00; %04:00 - 05:00 Declaration of the
S61=0.00;S62=0.00; %05:00 - 06:00 Solar and EV profile
S71=0.00;S72=500; %06:00 - 07:00 vector that will go
S81=500;S82=1000; %07:00 - 08:00 into the repeating
S91=1000;S92=1500; %08:00 - 09:00
S101=1500;S102=2000; %09:00 - 10:00
sequence
S111=2000;S112=2500; %10:00 - 11:00
S121=2500;S122=3000; %11:00 - 12:00
S131=4000;S132=4400; %12:00 - 13:00
S141=4400;S142=4400; %13:00 - 14:00
S151=4400;S152=4400; %14:00 - 15:00
S161=4400;S162=4000; %15:00 - 16:00
S171=4000;S172=2500; %16:00 - 17:00
S181=2500;S182=1500; %17:00 - 18:00
S191=1500;S192=0.00; %18:00 - 19:00
S201=0.00;S202=0.00; %19:00 - 20:00
S211=0.00;S212=0.00; %20:00 - 21:00
S221=0.00;S222=0.00; %21:00 - 22:00
S231=0.00;S232=0.00; %22:00 - 23:00
S241=0.00;S242=0.00; %23:00 - 24:00

%ACTIVE EV CASE
EV11=-3600;EV12=-3600; %00:00 - 01:00
EV21=-3600;EV22=-3600; %01:00 - 02:00
EV31=-3600;EV32=-3600; %02:00 - 03:00
EV41=-3600;EV42=-3600; %03:00 - 04:00
EV51=-3600;EV52=-3600; %04:00 - 05:00
EV61=-3600;EV62=-3600; %05:00 - 06:00
EV71=-3600;EV72=-3600; %06:00 - 07:00
EV81=0.000;EV82=0.000; %07:00 - 08:00
EV91=0.000;EV92=0.000; %08:00 - 09:00
EV101=0.00;EV102=0.00; %09:00 - 10:00
EV111=0.00;EV112=0.00; %10:00 - 11:00
EV121=0.00;EV122=0.00; %11:00 - 12:00
EV131=0.00;EV132=0.00; %12:00 - 13:00
EV141=0.00;EV142=0.00; %13:00 - 14:00
EV151=0.00;EV152=0.00; %14:00 - 15:00
EV161=0.00;EV162=0.00; %15:00 - 16:00
EV171=0.00;EV172=0.00; %16:00 - 17:00
EV181=0.00;EV182=0.00; %17:00 - 18:00
EV191=0.00;EV192=0.00; %18:00 - 19:00
EV201=0.00;EV202=0.00; %19:00 - 20:00
EV211=1000;EV212=1000; %20:00 - 21:00

169
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

EV221=1000;EV222=1000; %21:00 - 22:00


EV231=0.00;EV232=0.00; %22:00 - 23:00
EV241=0.00;EV242=0.00; %23:00 - 24:00

sequence_TIME= [ t11 t12 t21 t22 t31 t32 t41 t42 t51 t52
t61 t62 t71 t72 t81 t82 t91 t92 t101 t102 t111 t112
t121 t122 t131 t132 t141 t142 t151 t152 t161 t162 t171 t172
t181 t182 t191 t192 t201 t202 t211 t212 t221 t222 t231 t232
t241 t242]*time_scale_factor;

sequence_S_H1=[ S11 S12 S21 S22 S31 S32 S41 S42 S51 S52 S61 S62
S71 S72 S81 S82 S91 S92 S101 S102 S111 S112 S121 S122 S131 S132
S141 S142 S151 S152 S161 S162 S171 S172 S181 S182 S191 S192 S201 S202
S211 S212 S221 S222 S231 S232 S241 S242];

sequence_E_H1=[ EV11 EV12 EV21 EV22 EV31 EV32 EV41 EV42 EV51 Data collection
EV52 EV61 EV62 EV71 EV72 EV81 EV82 EV91 EV92 EV101 EV102 to create time,
EV111 EV112 EV121 EV122 EV131 EV132 EV141 EV142 EV151 EV152 EV161 Solar and EV
EV162 EV171 EV172 EV181 EV182 EV191 EV192 EV201 EV202 EV211 EV212 vectors
EV221 EV222 EV231 EV232 EV241 EV242];

%__________________________________________________________________________

%%% FILTER
psi=0.1; %selectividad
num=[2*psi*wo 0];
den=[1 2*psi*wo wo^2];
Declaration of filter variables,
sysd=c2d(tf(num,den),1e-6,'tustin'); simulation time, discretization
[numBPF,denBPF]=tfdata(sysd,'v'); variables and RL Branch
values.
%% definition of the simulation's parameters
t_simula=1e-6;
t_stop=24*time_scale_factor;

%% SIMULATION
%RLC BRANCH POWER LINE
R_branch_line=1e-6;L_branch_line=6e-6; SIGNO=1;
sim('CASE_1_SIM_FINAL')

170
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 6: Case 2 Matlab code


close all;clear all;clc
%% VOLTAGE CHARACTERISTICS
fo=50;
wo=2*pi*fo;
To=1/fo; Definition of voltage, frequency and network
v_amplitut=220*sqrt(2); period. Also of the cut-off and computational
v_amplitut_2=v_amplitut^2; frequency values. The variable “delma”
v_ef=v_amplitut/sqrt(2);
fc=0.5; corresponds to a value for the decimation of the
wc=2*pi*fc; variables (internal parameter of a "To Workspace
fs=10e3; %switching block).
ts=1/fs;
delma=15;

%__________________________________________________________________________________
%%%%%%%%%% TIME FOR CASES %%%%%%%%%%%
st1=1e-5;%separation time
time_scale_factor=1;
%__________________________________________________________________________________

%% PASSIVE ELEMENTS
C2=52*1e-6; %[F] considering the max current output from the inverter
L2=1.9656*1e-3; %[H] considering the max current output from the inverter
C2EV=C2;
Capacitor and inductive values for the voltage filter
L2EV=L2;
inside the inverters.
%__________________________________________________________________________________

% definition of K constant for Solar and EV


ki_SOLAR=3; kp_SOLAR=3; kd_SOLAR=1;
V_DC_SOLAR_H1=400; Definition of control constants
V_pico=v_ef*sqrt(2); %VOLTAGE COLOUR for solar inverter and EV.
delay_solar=To/4; %DELAY TIME ALSO FOR EV Definition of delay. Definition of
the current voltage that replaces
%BATTERY CAR
V_DC_EV_H1=400; the back boost circuit.

%% EV CONTROL CONSTANTS HOUSE 1


ki_EV_H1=3; kp_EV_H1=3; kd_EV_H1=1;
kp_P_EV_H1=0.2; ki_P_EV_H1=20; Definition of control constants
kp_Q_EV_H1=0.2; ki_Q_EV_H1=20; for power.

%% EV CONTROL CONSTANTS HOUSE 2


ki_EV_H2=3; kp_EV_H2=3; kd_EV_H2=1;
kp_P_EV_H2=0.2; ki_P_EV_H2=20;
kp_Q_EV_H2=0.2; ki_Q_EV_H2=20;

%% EV CONTROL CONSTANTS HOUSE 3


ki_EV_H5=3; kp_EV_H5=3; kd_EV_H5=1;
kp_P_EV_H3=0.2; ki_P_EV_H3=20;
kp_Q_EV_H3=0.2; ki_Q_EV_H3=20;

171
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HOUSE NUMBER 1


%P=VI=I^2·R=V^2/R --> R= P/I^2 = V^2/P
P_LOAD_1=5750;
LOAD_1=0.5*v_amplitut_2/P_LOAD_1;%[Ohm] minimum LOAD

%PROFILE SOLAR
SH1_11=0; SH1_12=0; %00:00 - 01:00
SH1_21=0; SH1_22=0; %01:00 - 02:00
Definition of house power (W).
SH1_31=0; SH1_32=0; %02:00 - 03:00 Calculation of the minimum load
SH1_41=0; SH1_42=0; %03:00 - 04:00 of the house. Definition of solar
SH1_51=0; SH1_52=0; %04:00 - 05:00 and EV generation profiles.
SH1_61=0; SH1_62=0; %05:00 - 06:00
SH1_71=0; SH1_72=500; %06:00 - 07:00
SH1_81=500; SH1_82=1000; %07:00 - 08:00
SH1_91=1000; SH1_92=1500; %08:00 - 09:00
SH1_101=1500; SH1_102=2000; %09:00 - 10:00
SH1_111=2000; SH1_112=2500; %10:00 - 11:00
SH1_121=2500; SH1_122=3500; %11:00 - 12:00
SH1_131=3500; SH1_132=4400; %12:00 - 13:00
SH1_141=4400; SH1_142=4400; %13:00 - 14:00
SH1_151=4400; SH1_152=4400; %14:00 - 15:00
SH1_161=4400; SH1_162=4000; %15:00 - 16:00
SH1_171=4000; SH1_172=3000; %16:00 - 17:00
SH1_181=3000; SH1_182=1000; %17:00 - 18:00
SH1_191=1000; SH1_192=100; %18:00 - 19:00
SH1_201=100; SH1_202=0; %19:00 - 20:00
SH1_211=0; SH1_212=0; %20:00 - 21:00
SH1_221=0; SH1_222=0; %21:00 - 22:00
SH1_231=0; SH1_232=0; %22:00 - 23:00
SH1_241=0; SH1_242=0; %23:00 - 24:00

%PROFILE EV
EH1_11=-3600; EH1_12=-3600; %00:00 - 01:00
EH1_21=-3600; EH1_22=-3600; %01:00 - 02:00
EH1_31=-3600; EH1_32=-3600; %02:00 - 03:00
EH1_41=-3600; EH1_42=-3600; %03:00 - 04:00
EH1_51=-3600; EH1_52=-3600; %04:00 - 05:00
EH1_61=-3600; EH1_62=-3600; %05:00 - 06:00
EH1_71=0; EH1_72=0; %06:00 - 07:00
EH1_81=0; EH1_82=0; %07:00 - 08:00
EH1_91=0; EH1_92=0; %08:00 - 09:00
EH1_101=0; EH1_102=0; %09:00 - 10:00
EH1_111=0; EH1_112=0; %10:00 - 11:00
EH1_121=0; EH1_122=0; %11:00 - 12:00
EH1_131=0; EH1_132=0; %12:00 - 13:00
EH1_141=0; EH1_142=0; %13:00 - 14:00
EH1_151=0; EH1_152=0; %14:00 - 15:00
EH1_161=0; EH1_162=0; %15:00 - 16:00
EH1_171=0; EH1_172=0; %16:00 - 17:00
EH1_181=0; EH1_182=0; %17:00 - 18:00
EH1_191=0; EH1_192=0; %18:00 - 19:00
EH1_201=0; EH1_202=0; %19:00 - 20:00
EH1_211=0; EH1_212=0; %20:00 - 21:00
EH1_221=0; EH1_222=0; %21:00 - 22:00
EH1_231=3600; EH1_232=3600; %22:00 - 23:00
EH1_241=3600; EH1_242=3600; %23:00 - 24:00

172
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%PROFILE LOAD H1
H1L11=(LOAD_1/0.2); H1L12=(LOAD_1/0.2); %CASE 1 00:00-01:00
H1L21=(LOAD_1/0.2); H1L22=(LOAD_1/0.2); %CASE 2 01:00-02:00
Generation of the
H1L31=(LOAD_1/0.2); H1L32=(LOAD_1/0.2); %CASE 3 02:00-03:00 consumption
H1L41=(LOAD_1/0.2); H1L42=(LOAD_1/0.2); %CASE 4 03:00-04:00 (load) profile of
H1L51=(LOAD_1/0.2); H1L52=(LOAD_1/0.2); %CASE 5 04:00-05:00 the house
H1L61=(LOAD_1/0.2); H1L62=(LOAD_1/0.2); %CASE 6 05:00-06:00
H1L71=(LOAD_1/0.2); H1L72=(LOAD_1/0.3); %CASE 7 06:00-07:00
H1L81=(LOAD_1/0.3); H1L82=(LOAD_1/0.4); %CASE 8 07:00-08:00
H1L91=(LOAD_1/0.4); H1L92=(LOAD_1/0.4); %CASE 9 08:00-09:00
H1L101=(LOAD_1/0.4); H1L102=(LOAD_1/0.23); %CASE 10 09:00-10:00
H1L111=(LOAD_1/0.23); H1L112=(LOAD_1/0.25); %CASE 11 10:00-11:00
H1L121=(LOAD_1/0.25); H1L122=(LOAD_1/0.25); %CASE 12 11:00-12:00
H1L131=(LOAD_1/0.30); H1L132=(LOAD_1/0.35); %CASE 13 12:00-13:00
H1L141=(LOAD_1/0.35); H1L142=(LOAD_1/0.50); %CASE 14 13:00-14:00
H1L151=(LOAD_1/0.50); H1L152=(LOAD_1/0.50); %CASE 15 14:00-15:00
H1L161=(LOAD_1/0.50); H1L162=(LOAD_1/0.45); %CASE 16 15:00-16:00
H1L171=(LOAD_1/0.45); H1L172=(LOAD_1/0.40); %CASE 17 16:00-17:00
H1L181=(LOAD_1/0.40); H1L182=(LOAD_1/0.35); %CASE 18 17:00-18:00
H1L191=(LOAD_1/0.47); H1L192=(LOAD_1/0.67); %CASE 19 18:00-19:00
H1L201=(LOAD_1/0.67); H1L202=(LOAD_1/0.80); %CASE 20 19:00-20:00
H1L211=(LOAD_1/0.80); H1L212=(LOAD_1/0.90); %CASE 21 20:00-21:00
H1L221=(LOAD_1/0.90); H1L222=(LOAD_1/1.00); %CASE 22 21:00-22:00
H1L231=(LOAD_1/1.00); H1L232=(LOAD_1/0.85); %CASE 23 22:00-23:00
H1L241=(LOAD_1/0.85); H1L242=(LOAD_1/0.65); %CASE 24 23:00-00:00

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HOUSE NUMBER 2


%P=VI=I^2·R=V^2/R --> R= P/I^2 = V^2/P
P_LOAD_2=4600;
LOAD_2=0.5*v_amplitut_2/P_LOAD_2;%[Ohm] minimum LOAD

%PROFILE SOLAR
SH2_11=0; SH2_12=0; %00:00 - 01:00
SH2_21=0; SH2_22=0; %01:00 - 02:00 Definition of house power (W).
SH2_31=0; SH2_32=0; %02:00 - 03:00 Calculation of the minimum load
SH2_41=0; SH2_42=0; %03:00 - 04:00
of the house. Definition of solar
SH2_51=0; SH2_52=0; %04:00 - 05:00
SH2_61=0; SH2_62=0; %05:00 - 06:00 and EV generation profiles.
SH2_71=0; SH2_72=500; %06:00 - 07:00
SH2_81=500; SH2_82=1000; %07:00 - 08:00
SH2_91=1000; SH2_92=1500; %08:00 - 09:00
SH2_101=1500; SH2_102=2000; %09:00 - 10:00
SH2_111=2000; SH2_112=2500; %10:00 - 11:00
SH2_121=2500; SH2_122=3500; %11:00 - 12:00
SH2_131=3500; SH2_132=4400; %12:00 - 13:00
SH2_141=4400; SH2_142=4400; %13:00 - 14:00
SH2_151=4400; SH2_152=4400; %14:00 - 15:00
SH2_161=4400; SH2_162=4000; %15:00 - 16:00
SH2_171=4000; SH2_172=3000; %16:00 - 17:00
SH2_181=3000; SH2_182=1000; %17:00 - 18:00
SH2_191=1000; SH2_192=100; %18:00 - 19:00
SH2_201=100; SH2_202=0; %19:00 - 20:00
SH2_211=0; SH2_212=0; %20:00 - 21:00
SH2_221=0; SH2_222=0; %21:00 - 22:00
SH2_231=0; SH2_232=0; %22:00 - 23:00
SH2_241=0; SH2_242=0; %23:00 - 24:00

173
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%PROFILE EV
EH2_11=-3600; EH2_12=-3600; %00:00 - 01:00
EH2_21=-3600; EH2_22=-3600; %01:00 - 02:00
EH2_31=-3600; EH2_32=-3600; %02:00 - 03:00
EH2_41=-3600; EH2_42=-3600; %03:00 - 04:00
EH2_51=-3600; EH2_52=-3600; %04:00 - 05:00
EH2_61=-3600; EH2_62=-3600; %05:00 - 06:00
EH2_71=0; EH2_72=0; %06:00 - 07:00
Definition of EV
EH2_81=0; EH2_82=0; %07:00 - 08:00 generation profile.
EH2_91=0; EH2_92=0; %08:00 - 09:00
EH2_101=0; EH2_102=0; %09:00 - 10:00
EH2_111=0; EH2_112=0; %10:00 - 11:00
EH2_121=0; EH2_122=0; %11:00 - 12:00
EH2_131=3550; EH2_132=3550; %12:00 - 13:00
EH2_141=3550; EH2_142=3550; %13:00 - 14:00
EH2_151=3550; EH2_152=3550; %14:00 - 15:00
EH2_161=0.01; EH2_162=0.01; %15:00 - 16:00
EH2_171=0.01; EH2_172=0.01; %16:00 - 17:00
EH2_181=0.01; EH2_182=0.01; %17:00 - 18:00
EH2_191=0.01; EH2_192=0.01; %18:00 - 19:00
EH2_201=0.01; EH2_202=0.01; %19:00 - 20:00
EH2_211=0.01; EH2_212=0.01; %20:00 - 21:00
EH2_221=3600; EH2_222=3600; %21:00 - 22:00
EH2_231=3600; EH2_232=3600; %22:00 - 23:00
EH2_241=3600; EH2_242=3600; %23:00 - 24:00 Generation of the
consumption
%PROFILE LOAD H2 (load) profile of
H2L11=(LOAD_2/0.2); H2L12=(LOAD_2/0.2); %CASE 1 00:00-01:00
H2L21=(LOAD_2/0.2); H2L22=(LOAD_2/0.2); %CASE 2 01:00-02:00
the house
H2L31=(LOAD_2/0.2); H2L32=(LOAD_2/0.2); %CASE 3 02:00-03:00
H2L41=(LOAD_2/0.2); H2L42=(LOAD_2/0.2); %CASE 4 03:00-04:00
H2L51=(LOAD_2/0.2); H2L52=(LOAD_2/0.2); %CASE 5 04:00-05:00
H2L61=(LOAD_2/0.2); H2L62=(LOAD_2/0.2); %CASE 6 05:00-06:00
H2L71=(LOAD_2/0.2); H2L72=(LOAD_2/0.3); %CASE 7 06:00-07:00
H2L81=(LOAD_2/0.3); H2L82=(LOAD_2/0.4); %CASE 8 07:00-08:00
H2L91=(LOAD_2/0.4); H2L92=(LOAD_2/0.4); %CASE 9 08:00-09:00
H2L101=(LOAD_2/0.4); H2L102=(LOAD_2/0.23); %CASE 10 09:00-10:00
H2L111=(LOAD_2/0.23); H2L112=(LOAD_2/0.25); %CASE 11 10:00-11:00
H2L121=(LOAD_2/0.25); H2L122=(LOAD_2/0.25); %CASE 12 11:00-12:00
H2L131=(LOAD_2/0.30); H2L132=(LOAD_2/0.35); %CASE 13 12:00-13:00
H2L141=(LOAD_2/0.35); H2L142=(LOAD_2/0.50); %CASE 14 13:00-14:00
H2L151=(LOAD_2/0.50); H2L152=(LOAD_2/0.50); %CASE 15 14:00-15:00
H2L161=(LOAD_2/0.50); H2L162=(LOAD_2/0.45); %CASE 16 15:00-16:00
H2L171=(LOAD_2/0.45); H2L172=(LOAD_2/0.40); %CASE 17 16:00-17:00
H2L181=(LOAD_2/0.40); H2L182=(LOAD_2/0.35); %CASE 18 17:00-18:00
H2L191=(LOAD_2/0.47); H2L192=(LOAD_2/0.67); %CASE 19 18:00-19:00
H2L201=(LOAD_2/0.67); H2L202=(LOAD_2/0.80); %CASE 20 19:00-20:00
H2L211=(LOAD_2/0.80); H2L212=(LOAD_2/0.90); %CASE 21 20:00-21:00
H2L221=(LOAD_2/0.90); H2L222=(LOAD_2/1.00); %CASE 22 21:00-22:00
H2L231=(LOAD_2/1.00); H2L232=(LOAD_2/0.80); %CASE 23 22:00-23:00
H2L241=(LOAD_2/0.80); H2L242=(LOAD_2/0.65); %CASE 24 23:00-00:00

174
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HOUSE NUMBER 3


%P=VI=I^2·R=V^2/R --> R= P/I^2 = V^2/P
P_LOAD_3=7450;
LOAD_3=0.5*v_amplitut_2/P_LOAD_3;%[Ohm] minimum LOAD

%PROFILE SOLAR
SH3_11=0; SH3_12=0; %00:00 - 01:00
SH3_21=0; SH3_22=0; %01:00 - 02:00
SH3_31=0; SH3_32=0; %02:00 - 03:00
SH3_41=0; SH3_42=0; %03:00 - 04:00
SH3_51=0; SH3_52=0; %04:00 - 05:00 Definition of house power (W).
SH3_61=0; SH3_62=0; %05:00 - 06:00 Calculation of the minimum load
SH3_71=0; SH3_72=500; %06:00 - 07:00 of the house. Definition of solar
SH3_81=500; SH3_82=1000; %07:00 - 08:00 and EV generation profiles.
SH3_91=1000; SH3_92=1500; %08:00 - 09:00
SH3_101=1500; SH3_102=2000; %09:00 - 10:00
SH3_111=2000; SH3_112=2500; %10:00 - 11:00
SH3_121=2500; SH3_122=3500; %11:00 - 12:00
SH3_131=3500; SH3_132=4400; %12:00 - 13:00
SH3_141=4400; SH3_142=4400; %13:00 - 14:00
SH3_151=4400; SH3_152=4400; %14:00 - 15:00
SH3_161=4400; SH3_162=4000; %15:00 - 16:00
SH3_171=4000; SH3_172=3000; %16:00 - 17:00
SH3_181=3000; SH3_182=1000; %17:00 - 18:00
SH3_191=1000; SH3_192=100; %18:00 - 19:00
SH3_201=100; SH3_202=0; %19:00 - 20:00
SH3_211=0; SH3_212=0; %20:00 - 21:00
SH3_221=0; SH3_222=0; %21:00 - 22:00
SH3_231=0; SH3_232=0; %22:00 - 23:00
SH3_241=0; SH3_242=0; %23:00 - 24:00

EH3_11=-3600; EH3_12=-3600; %00:00 - 01:00


EH3_21=-3600; EH3_22=-3600; %01:00 - 02:00
EH3_31=-3600; EH3_32=-3600; %02:00 - 03:00
EH3_41=-3600; EH3_42=-3600; %03:00 - 04:00
EH3_51=-3600; EH3_52=-3600; %04:00 - 05:00
EH3_61=-3600; EH3_62=-3600; %05:00 - 06:00
EH3_71=-3600; EH3_72=-3600; %06:00 - 07:00
EH3_81=-3600; EH3_82=-3600; %07:00 - 08:00
EH3_91=0; EH3_92=0; %08:00 - 09:00
EH3_101=0; EH3_102=0; %09:00 - 10:00
EH3_111=0; EH3_112=0; %10:00 - 11:00
EH3_121=0; EH3_122=0; %11:00 - 12:00
EH3_131=0; EH3_132=0; %12:00 - 13:00
EH3_141=0; EH3_142=0; %13:00 - 14:00
EH3_151=0; EH3_152=0; %14:00 - 15:00
EH3_161=0; EH3_162=0; %15:00 - 16:00
EH3_171=0; EH3_172=0; %16:00 - 17:00
EH3_181=0; EH3_182=0; %17:00 - 18:00
EH3_191=0; EH3_192=0; %18:00 - 19:00
EH3_201=0; EH3_202=0; %19:00 - 20:00
EH3_211=0; EH3_212=0; %20:00 - 21:00
EH3_221=2600; EH3_222=2600; %21:00 - 22:00
EH3_231=2600; EH3_232=2600; %22:00 - 23:00
EH3_241=2600; EH3_242=2600; %23:00 - 24:00

175
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%PROFILE LOAD H3
H3L11=(LOAD_3/0.2); H3L12=(LOAD_3/0.2); %CASE 1 00:00-01:00 Generation of
H3L21=(LOAD_3/0.2); H3L22=(LOAD_3/0.2); %CASE 2 01:00-02:00 the consumption
H3L31=(LOAD_3/0.2); H3L32=(LOAD_3/0.2); %CASE 3 02:00-03:00 (load) profile of
H3L41=(LOAD_3/0.2); H3L42=(LOAD_3/0.2); %CASE 4 03:00-04:00
H3L51=(LOAD_3/0.2); H3L52=(LOAD_3/0.2); %CASE 5 04:00-05:00
the house
H3L61=(LOAD_3/0.2); H3L62=(LOAD_3/0.2); %CASE 6 05:00-06:00
H3L71=(LOAD_3/0.2); H3L72=(LOAD_3/0.3); %CASE 7 06:00-07:00
H3L81=(LOAD_3/0.3); H3L82=(LOAD_3/0.4); %CASE 8 07:00-08:00
H3L91=(LOAD_3/0.4); H3L92=(LOAD_3/0.4); %CASE 9 08:00-09:00
H3L101=(LOAD_3/0.4); H3L102=(LOAD_3/0.23); %CASE 10 09:00-10:00
H3L111=(LOAD_3/0.23); H3L112=(LOAD_3/0.25); %CASE 11 10:00-11:00
H3L121=(LOAD_3/0.25); H3L122=(LOAD_3/0.25); %CASE 12 11:00-12:00
H3L131=(LOAD_3/0.30); H3L132=(LOAD_3/0.35); %CASE 13 12:00-13:00
H3L141=(LOAD_3/0.35); H3L142=(LOAD_3/0.50); %CASE 14 13:00-14:00
H3L151=(LOAD_3/0.50); H3L152=(LOAD_3/0.50); %CASE 15 14:00-15:00
H3L161=(LOAD_3/0.50); H3L162=(LOAD_3/0.45); %CASE 16 15:00-16:00
H3L171=(LOAD_3/0.45); H3L172=(LOAD_3/0.40); %CASE 17 16:00-17:00
H3L181=(LOAD_3/0.40); H3L182=(LOAD_3/0.35); %CASE 18 17:00-18:00
H3L191=(LOAD_3/0.47); H3L192=(LOAD_3/0.67); %CASE 19 18:00-19:00
H3L201=(LOAD_3/0.67); H3L202=(LOAD_3/0.80); %CASE 20 19:00-20:00
H3L211=(LOAD_3/0.80); H3L212=(LOAD_3/0.90); %CASE 21 20:00-21:00
H3L221=(LOAD_3/0.90); H3L222=(LOAD_3/1.00); %CASE 22 21:00-22:00
H3L231=(LOAD_3/1.00); H3L232=(LOAD_3/0.80); %CASE 23 22:00-23:00
H3L241=(LOAD_3/0.80); H3L242=(LOAD_3/0.65); %CASE 24 23:00-00:00

t11=0+0.02;t12=1; %00:00 - 01:00


t21=t12+st1;t22=t21+1; %01:00 - 02:00
t31=t22+st1;t32=t31+1; %02:00 - 03:00
t41=t32+st1;t42=t41+1; %03:00 - 04:00
t51=t42+st1;t52=t51+1; %04:00 - 05:00
t61=t52+st1;t62=t61+1; %05:00 - 06:00 Generation of the time
t71=t62+st1;t72=t71+1; %06:00 - 07:00 vector, it is the same for
t81=t72+st1;t82=t81+1; %07:00 - 08:00 the 3 houses.
t91=t82+st1;t92=t91+1; %08:00 - 09:00
t101=t92+st1; t102=t101+1; %09:00 - 10:00
t111=t102+st1;t112=t111+1; %10:00 - 11:00
t121=t112+st1;t122=t121+1; %11:00 - 12:00
t131=t122+st1;t132=t131+1; %12:00 - 13:00
t141=t132+st1;t142=t141+1; %13:00 - 14:00
t151=t142+st1;t152=t151+1; %14:00 - 15:00
t161=t152+st1;t162=t161+1; %15:00 - 16:00
t171=t162+st1;t172=t171+1; %16:00 - 17:00
t181=t172+st1;t182=t181+1; %17:00 - 18:00
t191=t182+st1;t192=t191+1; %18:00 - 19:00
t201=t192+st1;t202=t201+1; %19:00 - 20:00
t211=t202+st1;t212=t211+1; %20:00 - 21:00
t221=t212+st1;t222=t221+1; %21:00 - 22:00
t231=t222+st1;t232=t231+1; %22:00 - 23:00
t241=t232+st1;t242=t241+1; %23:00 - 00:00

sequence_TIME=[ t11 t12 t21 t22 t31 t32 t41 t42 t51 t52 t61
t62 t71 t72 t81 t82 t91 t92 t101 t102 t111 t112 t121 t122 t131
t132 t141 t142 t151 t152 t161 t162 t171 t172 t181 t182 t191 t192 t201
t202 t211 t212 t221 t222 t231 t232 t241 t242]*time_scale_factor;

176
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Sref_sol_h1=4400; Sref_sol_h2=4400; Sref_sol_h3=4400;


Sref_ev_h1=3600; Sref_ev_h2=3600; Sref_ev_h3=3600;

Generation of active and reactive power vectors for all houses. These
vectors contain the previously introduced profiles. These vectors will be
introduced in the repeating sequences of Simulink.
sequence_E_H1= [EH1_11 EH1_12 EH1_21 EH1_22 EH1_31 EH1_32 EH1_41 EH1_42
EH1_51 EH1_52 EH1_61 EH1_62 EH1_71 EH1_72 EH1_81 EH1_82 EH1_91 EH1_92
EH1_101 EH1_102 EH1_111 EH1_112 EH1_121 EH1_122 EH1_131 EH1_132 EH1_141 EH1_142
EH1_151 EH1_152 EH1_161 EH1_162 EH1_171 EH1_172 EH1_181 EH1_182 EH1_191 EH1_192
EH1_201 EH1_202 EH1_211 EH1_212 EH1_221 EH1_222 EH1_231 EH1_232 EH1_241 EH1_242];

sequence_S_H1= [SH1_11 SH1_12 SH1_21 SH1_22 SH1_31 SH1_32 SH1_41 SH1_42


SH1_51 SH1_52 SH1_61 SH1_62 SH1_71 SH1_72 SH1_81 SH1_82 SH1_91 SH1_92
SH1_101 SH1_102 SH1_111 SH1_112 SH1_121 SH1_122 SH1_131 SH1_132 SH1_141 SH1_142
SH1_151 SH1_152 SH1_161 SH1_162 SH1_171 SH1_172 SH1_181 SH1_182 SH1_191 SH1_192
SH1_201 SH1_202 SH1_211 SH1_212 SH1_221 SH1_222 SH1_231 SH1_232 SH1_241 SH1_242];

sequence_LOAD_H1= [ H1L11 H1L12 H1L21 H1L22 H1L31 H1L32 H1L41 H1L42


H1L51 H1L52 H1L61 H1L62 H1L71 H1L72 H1L81 H1L82 H1L91 H1L92
H1L101 H1L102 H1L111 H1L112 H1L121 H1L122 H1L131 H1L132 H1L141 H1L142
H1L151 H1L152 H1L161 H1L162 H1L171 H1L172 H1L181 H1L182 H1L191 H1L192
H1L201 H1L202 H1L211 H1L212 H1L221 H1L222 H1L231 H1L232 H1L241 H1L242];

sequence_E_H2= [EH2_11 EH2_12 EH2_21 EH2_22 EH2_31 EH2_32 EH2_41 EH2_42


EH2_51 EH2_52 EH2_61 EH2_62 EH2_71 EH2_72 EH2_81 EH2_82 EH2_91 EH2_92
EH2_101 EH2_102 EH2_111 EH2_112 EH2_121 EH2_122 EH2_131 EH2_132 EH2_141 EH2_142
EH2_151 EH2_152 EH2_161 EH2_162 EH2_171 EH2_172 EH2_181 EH2_182 EH2_191 EH2_192
EH2_201 EH2_202 EH2_211 EH2_212 EH2_221 EH2_222 EH2_231 EH2_232 EH2_241 EH2_242];

sequence_S_H2= [SH2_11 SH2_12 SH2_21 SH2_22 SH2_31 SH2_32 SH2_41 SH2_42


SH2_51 SH2_52 SH2_61 SH2_62 SH2_71 SH2_72 SH2_81 SH2_82 SH2_91 SH2_92
SH2_101 SH2_102 SH2_111 SH2_112 SH2_121 SH2_122 SH2_131 SH2_132 SH2_141 SH2_142
SH2_151 SH2_152 SH2_161 SH2_162 SH2_171 SH2_172 SH2_181 SH2_182 SH2_191 SH2_192
SH2_201 SH2_202 SH2_211 SH2_212 SH2_221 SH2_222 SH2_231 SH2_232 SH2_241 SH2_242];

sequence_LOAD_H2= [ H2L11 H2L12 H2L21 H2L22 H2L31 H2L32 H2L41 H2L42


H2L51 H2L52 H2L61 H2L62 H2L71 H2L72 H2L81 H2L82 H2L91 H2L92
H2L101 H2L102 H2L111 H2L112 H2L121 H2L122 H2L131 H2L132 H2L141 H2L142
H2L151 H2L152 H2L161 H2L162 H2L171 H2L172 H2L181 H2L182 H2L191 H2L192
H2L201 H2L202 H2L211 H2L212 H2L221 H2L222 H2L231 H2L232 H2L241 H2L242];

sequence_E_H3= [EH3_11 EH3_12 EH3_21 EH3_22 EH3_31 EH3_32 EH3_41 EH3_42


EH3_51 EH3_52 EH3_61 EH3_62 EH3_71 EH3_72 EH3_81 EH3_82 EH3_91 EH3_92
EH3_101 EH3_102 EH3_111 EH3_112 EH3_121 EH3_122 EH3_131 EH3_132 EH3_141 EH3_142
EH3_151 EH3_152 EH3_161 EH3_162 EH3_171 EH3_172 EH3_181 EH3_182 EH3_191 EH3_192
EH3_201 EH3_202 EH3_211 EH3_212 EH3_221 EH3_222 EH3_231 EH3_232 EH3_241 EH3_242];

sequence_S_H3= [SH3_11 SH3_12 SH3_21 SH3_22 SH3_31 SH3_32 SH3_41 SH3_42


SH3_51 SH3_52 SH3_61 SH3_62 SH3_71 SH3_72 SH3_81 SH3_82 SH3_91 SH3_92
SH3_101 SH3_102 SH3_111 SH3_112 SH3_121 SH3_122 SH3_131 SH3_132 SH3_141 SH3_142
SH3_151 SH3_152 SH3_161 SH3_162 SH3_171 SH3_172 SH3_181 SH3_182 SH3_191 SH3_192
SH3_201 SH3_202 SH3_211 SH3_212 SH3_221 SH3_222 SH3_231 SH3_232 SH3_241 SH3_242];
sequence_LOAD_H3= [ H3L11 H3L12 H3L21 H3L22 H3L31 H3L32 H3L41 H3L42
H3L51 H3L52 H3L61 H3L62 H3L71 H3L72 H3L81 H3L82 H3L91 H3L92
H3L101 H3L102 H3L111 H3L112 H3L121 H3L122 H3L131 H3L132 H3L141 H3L142
H3L151 H3L152 H3L161 H3L162 H3L171 H3L172 H3L181 H3L182 H3L191 H3L192
H3L201 H3L202 H3L211 H3L212 H3L221 H3L222 H3L231 H3L232 H3L241 H3L242];

177
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%__________________________________________________________________________________
psi=0.1; %selectividad
num=[2*psi*wo 0]; Declaration of filter variables,
den=[1 2*psi*wo wo^2];
simulation time, discretization
sysd=c2d(tf(num,den),1e-6,'tustin');
[numBPF,denBPF]=tfdata(sysd,'v'); variables and RL Branch
values.
%RLC BRANCH POWER LINE
L_parasite=3e-3;
%% definition of the simulation's parameters
t_simula=1e-6;
t_stop=t242*time_scale_factor;

%% SIMULATION

R_branch_line=1e-6; L_branch_line=6.5e-6; SIGNO=-1;


sim('CASE_2_SIM_FINAL1')

The reader is reminded that the "SIGNO" variable is the one that decides
whether the inverters absorb or inject reactive power. If the variable takes the
value -1 it means that the inverters absorb reactive, on the contrary if it is 1 it
means that they inject reactive. If the value 0 is set, the inverters will simply
work with active only.

178
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 7: Case 2 figures

Figure A15: Power from House 1, Scenario 1 - Case 2

Figure A16: Power from House 2, Scenario 1 - Case

179
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A17: Power from House 3, Scenario 1 - Case 2

Figure A18: Voltage variation House 1 phase A, Scenario 1 - Case 2

180
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A19: Voltage variation House 2 phase B, Scenario 1 - Case 2

Figure A20: Voltage variation House 3 phase C, Scenario 1 - Case 2

181
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A21: Power from House 1, Scenario 2 - Case 2

Figure A22: Power from House 2, Scenario 2 - Case 2

182
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A23: Power from House 3, Scenario 2 - Case 2

Figure A24: Voltage variation House 1 phase A, Scenario 2 - Case 2

183
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A25: Voltage variation House 2 phase B, Scenario 2 - Case 2

Figure A26: Voltage variation House 3 phase C, Scenario 2 - Case 2

184
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A27: Power from House 1, Scenario 3 - Case 2

Figure A28: Power from House 2, Scenario 3 - Case 2

185
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A29: Power from House 3, Scenario 3 - Case 2

Figure A30: Voltage variation House 1 phase C, Scenario 3 - Case 2

186
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A31: Voltage variation House 2 phase C, Scenario 3 - Case 2

Figure A32: Voltage variation House 3 phase C, Scenario 3 - Case 2

187
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A33: Load profiles Houses 1, 2 and 3 - Case 2

Figure A34: Total Apparent Power system, Scenarios 1, 2 and 3 - Case 2

188
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 8: Case 3 Matlab code


clc; clear all; close all;
nn=8;
The variable "nn" is used to multiply the number
%%% TIME FOR CASES %%% of houses to simulate an increase in
st1=1e-4;%separation time consumption and generation. This point is
time_scale_factor=1; discussed in section 4.4.3.1.
delma=30;

What would happen if the number of houses


%__________________________________________________________________________________
t11=0+0.02;t12=1; %00:00 -were
01:00
increased considerably?
t21=t12+st1;t22=t21+1; %01:00 - 02:00
t31=t22+st1;t32=t31+1; %02:00 - 03:00
t41=t32+st1;t42=t41+1; %03:00 - 04:00
t51=t42+st1;t52=t51+1; %04:00 - 05:00
Creation of the
t61=t52+st1;t62=t61+1; %05:00 - 06:00 variables that will later
t71=t62+st1;t72=t71+1; %06:00 - 07:00 form the time vector
t81=t72+st1;t82=t81+1; %07:00 - 08:00
t91=t82+st1;t92=t91+1; %08:00 - 09:00
t101=t92+st1; t102=t101+1;%09:00 - 10:00
t111=t102+st1;t112=t111+1;%10:00 - 11:00
t121=t112+st1;t122=t121+1;%11:00 - 12:00
t131=t122+st1;t132=t131+1;%12:00 - 13:00
t141=t132+st1;t142=t141+1;%13:00 - 14:00
t151=t142+st1;t152=t151+1;%14:00 - 15:00
t161=t152+st1;t162=t161+1;%15:00 - 16:00
t171=t162+st1;t172=t171+1;%16:00 - 17:00
t181=t172+st1;t182=t181+1;%17:00 - 18:00
t191=t182+st1;t192=t191+1;%18:00 - 19:00
t201=t192+st1;t202=t201+1;%19:00 - 20:00
t211=t202+st1;t212=t211+1;%20:00 - 21:00
t221=t212+st1;t222=t221+1;%21:00 - 22:00
t231=t222+st1;t232=t231+1;%22:00 - 23:00
t241=t232+st1;t242=t241+1;%23:00 - 00:00

%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% COMB1 %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
%ACTIVE PHASE A H1
AH1_11=4.77; AH1_12=AH1_11; %00:00 - 01:00 Creation of the variables
AH1_21=4.77; AH1_22=AH1_21; %01:00 - 02:00 containing the active
AH1_31=4.77; AH1_32=AH1_31; %02:00 - 03:00 power values (kW), which
AH1_41=4.77; AH1_42=AH1_41; %03:00 - 04:00
AH1_51=4.77; AH1_52=AH1_51; %04:00 - 05:00
will then form the active
AH1_61=1.00; AH1_62=AH1_61; %05:00 - 06:00 power vector from House 1
AH1_71=1.11; AH1_72=AH1_71; %06:00 - 07:00
AH1_81=1.23; AH1_82=AH1_81; %07:00 - 08:00
AH1_91=0.30; AH1_92=AH1_91; %08:00 - 09:00
AH1_101=-0.62; AH1_102=AH1_101; %09:00 - 10:00
AH1_111=-1.52; AH1_112=AH1_111; %10:00 - 11:00
AH1_121=-2.40; AH1_122=AH1_121; %11:00 - 12:00
AH1_131=-2.05; AH1_132=AH1_131; %12:00 - 13:00
AH1_141=-1.69; AH1_142=AH1_141; %13:00 - 14:00
AH1_151=-1.49; AH1_152=AH1_151; %14:00 - 15:00
AH1_161=-1.43; AH1_162=AH1_161; %15:00 - 16:00
AH1_171=-1.13; AH1_172=AH1_171; %16:00 - 17:00
AH1_181=0.09; AH1_182=AH1_181; %17:00 - 18:00
AH1_191=3.18; AH1_192=AH1_191; %18:00 - 19:00

189
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

AH1_201=4.61; AH1_202=AH1_201; %19:00 - 20:00


AH1_211=5.13; AH1_212=AH1_211; %20:00 - 21:00
AH1_221=5.65; AH1_222=AH1_221; %21:00 - 22:00
AH1_231=0.23; AH1_232=AH1_231; %22:00 - 23:00
AH1_241=0.23; AH1_242=AH1_241; %23:00 - 24:00

%REACTIVE PHASE A H1
RH1_11=4.45; RH1_12=RH1_11; %00:00 - 01:00
RH1_21=4.45; RH1_22=RH1_21; %01:00 - 02:00
RH1_31=4.45; RH1_32=RH1_31; %02:00 - 03:00 Creation of the variables
RH1_41=4.45; RH1_42=RH1_41; %03:00 - 04:00 containing the reactive
RH1_51=4.45; RH1_52=RH1_51; %04:00 - 05:00
power values (kVAr), which
RH1_61=4.39; RH1_62=RH1_61; %05:00 - 06:00
RH1_71=4.32; RH1_72=RH1_71; %06:00 - 07:00 will then form the active
RH1_81=4.19; RH1_82=RH1_81; %07:00 - 08:00 power vector from House 1
RH1_91=4.07; RH1_92=RH1_91; %08:00 - 09:00
RH1_101=3.94; RH1_102=RH1_101; %09:00 - 10:00
RH1_111=3.36; RH1_112=RH1_111; %10:00 - 11:00
RH1_121=2.77; RH1_122=RH1_121; %11:00 - 12:00
RH1_131=0.19; RH1_132=RH1_131; %12:00 - 13:00
RH1_141=0.06; RH1_142=RH1_141; %13:00 - 14:00
RH1_151=-0.07; RH1_152=RH1_151; %14:00 - 15:00
RH1_161=2.09; RH1_162=RH1_161; %15:00 - 16:00
RH1_171=3.16; RH1_172=RH1_171; %16:00 - 17:00
RH1_181=4.24; RH1_182=RH1_181; %17:00 - 18:00
RH1_191=4.31; RH1_192=RH1_191; %18:00 - 19:00
RH1_201=4.38; RH1_202=RH1_201; %19:00 - 20:00
RH1_211=4.38; RH1_212=RH1_211; %20:00 - 21:00
RH1_221=4.38; RH1_222=RH1_221; %21:00 - 22:00
RH1_231=4.38; RH1_232=RH1_231; %22:00 - 23:00
RH1_241=4.38; RH1_242=RH1_241; %23:00 - 24:00

%ACTIVE PHASE B H2
AH2_11=4.49; AH2_12= AH2_11; %00:00 - 01:00
AH2_21=4.49; AH2_22= AH2_21; %01:00 - 02:00
AH2_31=4.49; AH2_32= AH2_31; %02:00 - 03:00
AH2_41=4.49; AH2_42= AH2_41; %03:00 - 04:00 Creation of the variables
AH2_51=4.49; AH2_52= AH2_51; %04:00 - 05:00 containing the active
AH2_61=0.84; AH2_62= AH2_61; %05:00 - 06:00 power values (kW), which
AH2_71=0.81; AH2_72= AH2_71; %06:00 - 07:00
will then form the active
AH2_81=0.78; AH2_82= AH2_81; %07:00 - 08:00
AH2_91=-0.01; AH2_92= AH2_91; %08:00 - 09:00 power vector from House 2
AH2_101=-0.80; AH2_102=AH2_101; %09:00 - 10:00
AH2_111=-1.51; AH2_112=AH2_111; %10:00 - 11:00
AH2_121=-2.22; AH2_122=AH2_121; %11:00 - 12:00
AH2_131=-5.96; AH2_132=AH2_131; %12:00 - 13:00
AH2_141=-5.70; AH2_142=AH2_141; %13:00 - 14:00
AH2_151=-5.70; AH2_152=AH2_151; %14:00 - 15:00
AH2_161=-1.96; AH2_162=AH2_161; %15:00 - 16:00
AH2_171=-1.31; AH2_172=AH2_171; %16:00 - 17:00
AH2_181=1.96; AH2_182=AH2_181; %17:00 - 18:00
AH2_191=2.85; AH2_192=AH2_191; %18:00 - 19:00
AH2_201=3.75; AH2_202=AH2_201; %19:00 - 20:00
AH2_211=0.52; AH2_212=AH2_211; %20:00 - 21:00
AH2_221=0.52; AH2_222=AH2_221; %21:00 - 22:00
AH2_231=0.52; AH2_232=AH2_231; %22:00 - 23:00
AH2_241=0.49; AH2_242=AH2_241; %23:00 - 24:00

190
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%REACTIVE PHASE B H2
RH2_11=4.40; RH2_12= RH2_11; %00:00 - 01:00
RH2_21=4.40; RH2_22= RH2_21; %01:00 - 02:00
RH2_31=4.40; RH2_32= RH2_31; %02:00 - 03:00 Creation of the variables
RH2_41=4.40; RH2_42= RH2_41; %03:00 - 04:00 containing the reactive
RH2_51=4.40; RH2_52= RH2_51; %04:00 - 05:00 power values (kVAr), which
RH2_61=4.34; RH2_62= RH2_61; %05:00 - 06:00
RH2_71=4.29; RH2_72= RH2_71; %06:00 - 07:00
will then form the active
RH2_81=4.18; RH2_82= RH2_81; %07:00 - 08:00 power vector from House 2
RH2_91=4.08; RH2_92= RH2_91; %08:00 - 09:00
RH2_101=3.97; RH2_102=RH2_101; %09:00 - 10:00
RH2_111=2.87; RH2_112=RH2_111; %10:00 - 11:00
RH2_121=1.77; RH2_122=RH2_121; %11:00 - 12:00
RH2_131=1.43; RH2_132=RH2_131; %12:00 - 13:00
RH2_141=1.12; RH2_142=RH2_141; %13:00 - 14:00
RH2_151=2.67; RH2_152=RH2_151; %14:00 - 15:00
RH2_161=4.80; RH2_162=RH2_161; %15:00 - 16:00
RH2_171=6.32; RH2_172=RH2_171; %16:00 - 17:00
RH2_181=7.84; RH2_182=RH2_181; %17:00 - 18:00
RH2_191=7.84; RH2_192=RH2_191; %18:00 - 19:00
RH2_201=8.00; RH2_202=RH2_201; %19:00 - 20:00
RH2_211=8.00; RH2_212=RH2_211; %20:00 - 21:00
RH2_221=4.41; RH2_222=RH2_221; %21:00 - 22:00
RH2_231=4.41; RH2_232=RH2_231; %22:00 - 23:00
RH2_241=4.41; RH2_242=RH2_241; %23:00 - 24:00

%ACTIVE PHASE C H3
AH3_11=4.22; AH3_12= AH3_11; %00:00 - 01:00
AH3_21=4.22; AH3_22= AH3_21; %01:00 - 02:00
AH3_31=4.22; AH3_32= AH3_31; %02:00 - 03:00
AH3_41=4.22; AH3_42= AH3_41; %03:00 - 04:00
Creation of the variables
AH3_51=4.22; AH3_52= AH3_51; %04:00 - 05:00 containing the active
AH3_61=4.13; AH3_62= AH3_61; %05:00 - 06:00 power values (kW), which
AH3_71=4.04; AH3_72= AH3_71; %06:00 - 07:00 will then form the active
AH3_81=3.86; AH3_82= AH3_81; %07:00 - 08:00
power vector from House 3
AH3_91=0.10; AH3_92= AH3_91; %08:00 - 09:00
AH3_101=-1.19; AH3_102=AH3_101; %09:00 - 10:00
AH3_111=-1.70; AH3_112=AH3_111; %10:00 - 11:00
AH3_121=-2.21; AH3_122=AH3_121; %11:00 - 12:00
AH3_131=-3.23; AH3_132=AH3_131; %12:00 - 13:00
AH3_141=-2.46; AH3_142=AH3_141; %13:00 - 14:00
AH3_151=-2.70; AH3_152=AH3_151; %14:00 - 15:00
AH3_161=-2.66; AH3_162=AH3_161; %15:00 - 16:00
AH3_171=-1.39; AH3_172=AH3_171; %16:00 - 17:00
AH3_181=0.14; AH3_182=AH3_181; %17:00 - 18:00
AH3_191=1.38; AH3_192=AH3_191; %18:00 - 19:00
AH3_201=2.73; AH3_202=AH3_201; %19:00 - 20:00
AH3_211=3.03; AH3_212=AH3_211; %20:00 - 21:00
AH3_221=0.81; AH3_222=AH3_221; %21:00 - 22:00
AH3_231=0.81; AH3_232=AH3_231; %22:00 - 23:00
AH3_241=0.81; AH3_242=AH3_241; %23:00 - 24:00

191
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%REACTIVE PHASE C H3
RH3_11=7.47; RH3_12= RH3_11; %00:00 - 01:00
RH3_21=7.47; RH3_22= RH3_21; %01:00 - 02:00
RH3_31=7.47; RH3_32= RH3_31; %02:00 - 03:00 Creation of the variables
RH3_41=7.47; RH3_42= RH3_41; %03:00 - 04:00 containing the reactive
RH3_51=7.47; RH3_52= RH3_51; %04:00 - 05:00
RH3_61=7.47; RH3_62= RH3_61; %05:00 - 06:00
power values (kVAr), which
RH3_71=7.47; RH3_72= RH3_71; %06:00 - 07:00 will then form the active
RH3_81=7.47; RH3_82= RH3_81; %07:00 - 08:00 power vector from House 3
RH3_91=7.47; RH3_92= RH3_91; %08:00 - 09:00
RH3_101=7.47; RH3_102=RH3_101; %09:00 - 10:00
RH3_111=7.09; RH3_112=RH3_111; %10:00 - 11:00
RH3_121=6.71; RH3_122=RH3_121; %11:00 - 12:00
RH3_131=5.96; RH3_132=RH3_131; %12:00 - 13:00
RH3_141=5.96; RH3_142=RH3_141; %13:00 - 14:00
RH3_151=6.06; RH3_152=RH3_151; %14:00 - 15:00
RH3_161=6.33; RH3_162=RH3_161; %15:00 - 16:00
RH3_171=6.60; RH3_172=RH3_171; %16:00 - 17:00
RH3_181=7.14; RH3_182=RH3_181; %17:00 - 18:00
RH3_191=7.23; RH3_192=RH3_191; %18:00 - 19:00
RH3_201=7.33; RH3_202=RH3_201; %19:00 - 20:00
RH3_211=9.98; RH3_212=RH3_211; %20:00 - 21:00
RH3_221=9.98; RH3_222=RH3_221; %21:00 - 22:00
RH3_231=9.98; RH3_232=RH3_231; %22:00 - 23:00
RH3_241=9.98; RH3_242=RH3_241; %23:00 - 24:00

%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% COMB2 %%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%

%ACTIVE PHASE A H4
AH4_11=4.78; AH4_12= AH4_11; %00:00 - 01:00
AH4_21=4.78; AH4_22= AH4_21; %01:00 - 02:00
AH4_31=4.78; AH4_32= AH4_31; %02:00 - 03:00
Creation of the variables
AH4_41=4.78; AH4_42= AH4_41; %03:00 - 04:00
AH4_51=4.78; AH4_52= AH4_51; %04:00 - 05:00 containing the active
AH4_61=0.81; AH4_62= AH4_61; %05:00 - 06:00 power values (kW), which
AH4_71=0.81; AH4_72= AH4_71; %06:00 - 07:00 will then form the active
AH4_81=0.13; AH4_82= AH4_81; %07:00 - 08:00
power vector from House 4
AH4_91=-0.56; AH4_92= AH4_91; %08:00 - 09:00
AH4_101=-1.96; AH4_102=AH4_101; %09:00 - 10:00
AH4_111=-2.74; AH4_112=AH4_111; %10:00 - 11:00
AH4_121=-3.55; AH4_122=AH4_121; %11:00 - 12:00
AH4_131=-5.71; AH4_132=AH4_131; %12:00 - 13:00
AH4_141=-4.90; AH4_142=AH4_141; %13:00 - 14:00
AH4_151=-4.57; AH4_152=AH4_151; %14:00 - 15:00
AH4_161=-2.23; AH4_162=AH4_161; %15:00 - 16:00
AH4_171=-0.12; AH4_172=AH4_171; %16:00 - 17:00
AH4_181=1.94; AH4_182=AH4_181; %17:00 - 18:00
AH4_191=3.77; AH4_192=AH4_191; %18:00 - 19:00
AH4_201=4.60; AH4_202=AH4_201; %19:00 - 20:00
AH4_211=5.07; AH4_212=AH4_211; %20:00 - 21:00
AH4_221=5.53; AH4_222=AH4_221; %21:00 - 22:00
AH4_231=1.62; AH4_232=AH4_231; %22:00 - 23:00
AH4_241=0.32; AH4_242=AH4_241; %23:00 - 24:00

192
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

%REACTIVE PHASE A H4
RH4_11=7.47; RH4_12= RH4_11; %00:00 - 01:00
RH4_21=7.47; RH4_22= RH4_21; %01:00 - 02:00
RH4_31=7.47; RH4_32= RH4_31; %02:00 - 03:00 Creation of the variables
RH4_41=7.47; RH4_42= RH4_41; %03:00 - 04:00
RH4_51=7.47; RH4_52= RH4_51; %04:00 - 05:00
containing the reactive
RH4_61=7.47; RH4_62= RH4_61; %05:00 - 06:00 power values (kVAr), which
RH4_71=7.47; RH4_72= RH4_71; %06:00 - 07:00 will then form the active
RH4_81=7.25; RH4_82= RH4_81; %07:00 - 08:00 power vector from House 4
RH4_91=7.00; RH4_92= RH4_91; %08:00 - 09:00
RH4_101=6.50; RH4_102=RH4_101; %09:00 - 10:00
RH4_111=4.95; RH4_112=RH4_111; %10:00 - 11:00
RH4_121=3.40; RH4_122=RH4_121; %11:00 - 12:00
RH4_131=0.30; RH4_132=RH4_131; %12:00 - 13:00
RH4_141=0.30; RH4_142=RH4_141; %13:00 - 14:00
RH4_151=0.30; RH4_152=RH4_151; %14:00 - 15:00
RH4_161=1.99; RH4_162=RH4_161; %15:00 - 16:00
RH4_171=3.68; RH4_172=RH4_171; %16:00 - 17:00
RH4_181=7.06; RH4_182=RH4_181; %17:00 - 18:00
RH4_191=7.40; RH4_192=RH4_191; %18:00 - 19:00
RH4_201=7.40; RH4_202=RH4_201; %19:00 - 20:00
RH4_211=7.40; RH4_212=RH4_211; %20:00 - 21:00
RH4_221=7.40; RH4_222=RH4_221; %21:00 - 22:00
RH4_231=7.40; RH4_232=RH4_231; %22:00 - 23:00
RH4_241=7.40; RH4_242=RH4_241; %23:00 - 24:00

%ACTIVE PHASE B H5
AH5_11=4.66; AH5_12= AH5_11; %00:00 - 01:00
AH5_21=4.66; AH5_22= AH5_21; %01:00 - 02:00
AH5_31=4.66; AH5_32= AH5_31; %02:00 - 03:00
Creation of the variables
AH5_41=4.66; AH5_42= AH5_41; %03:00 - 04:00
AH5_51=4.66; AH5_52= AH5_51; %04:00 - 05:00 containing the active
AH5_61=0.66; AH5_62= AH5_61; %05:00 - 06:00 power values (kW), which
AH5_71=1.06; AH5_72= AH5_71; %06:00 - 07:00 will then form the active
AH5_81=1.13; AH5_82= AH5_81; %07:00 - 08:00
power vector from House 5
AH5_91=0.25; AH5_92= AH5_91; %08:00 - 09:00
AH5_101=-0.55; AH5_102=AH5_101; %09:00 - 10:00
AH5_111=-1.88; AH5_112=AH5_111; %10:00 - 11:00
AH5_121=-5.94; AH5_122=AH5_121; %11:00 - 12:00
AH5_131=-5.94; AH5_132=AH5_131; %12:00 - 13:00
AH5_141=-5.10; AH5_142=AH5_141; %13:00 - 14:00
AH5_151=-1.48; AH5_152=AH5_151; %14:00 - 15:00
AH5_161=-1.05; AH5_162=AH5_161; %15:00 - 16:00
AH5_171=-0.43; AH5_172=AH5_171; %16:00 - 17:00
AH5_181=0.20; AH5_182=AH5_181; %17:00 - 18:00
AH5_191=2.37; AH5_192=AH5_191; %18:00 - 19:00
AH5_201=4.55; AH5_202=AH5_201; %19:00 - 20:00
AH5_211=1.25; AH5_212=AH5_211; %20:00 - 21:00
AH5_221=2.11; AH5_222=AH5_221; %21:00 - 22:00
AH5_231=6.05; AH5_232=AH5_231; %22:00 - 23:00
AH5_241=3.85; AH5_242=AH5_241; %23:00 - 24:00

%REACTIVE PHASE B H5
RH5_11=4.49; RH5_12= RH5_11; %00:00 - 01:00 Creation of the variables
RH5_21=4.49; RH5_22= RH5_21; %01:00 - 02:00 containing the reactive
RH5_31=4.49; RH5_32= RH5_31; %02:00 - 03:00
RH5_41=4.49; RH5_42= RH5_41; %03:00 - 04:00
power values (kVAr), which
RH5_51=4.49; RH5_52= RH5_51; %04:00 - 05:00 will then form the active
RH5_61=4.49; RH5_62= RH5_61; %05:00 - 06:00 power vector from House 5

193
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

RH5_71=4.49; RH5_72= RH5_71; %06:00 - 07:00


RH5_81=4.36; RH5_82= RH5_81; %07:00 - 08:00
RH5_91=4.24; RH5_92= RH5_91; %08:00 - 09:00
RH5_101=3.98; RH5_102=RH5_101; %09:00 - 10:00
RH5_111=3.15; RH5_112=RH5_111; %10:00 - 11:00
RH5_121=2.32; RH5_122=RH5_121; %11:00 - 12:00
RH5_131=0.65; RH5_132=RH5_131; %12:00 - 13:00
RH5_141=0.65; RH5_142=RH5_141; %13:00 - 14:00
RH5_151=0.65; RH5_152=RH5_151; %14:00 - 15:00
RH5_161=1.56; RH5_162=RH5_161; %15:00 - 16:00
RH5_171=2.46; RH5_172=RH5_171; %16:00 - 17:00
RH5_181=4.28; RH5_182=RH5_181; %17:00 - 18:00
RH5_191=8.03; RH5_192=RH5_191; %18:00 - 19:00
RH5_201=8.03; RH5_202=RH5_201; %19:00 - 20:00
RH5_211=4.40; RH5_212=RH5_211; %20:00 - 21:00
RH5_221=4.40; RH5_222=RH5_221; %21:00 - 22:00
RH5_231=4.40; RH5_232=RH5_231; %22:00 - 23:00
RH5_241=4.40; RH5_242=RH5_241; %23:00 - 24:00

%ACTIVE PHASE C H6
AH6_11=8.58; AH6_12= AH6_11; %00:00 - 01:00
AH6_21=8.58; AH6_22= AH6_21; %01:00 - 02:00
AH6_31=8.58; AH6_32= AH6_31; %02:00 - 03:00 Creation of the variables
AH6_41=8.58; AH6_42= AH6_41; %03:00 - 04:00 containing the active
AH6_51=8.58; AH6_52= AH6_51; %04:00 - 05:00 power values (kW), which
AH6_61=8.58; AH6_62= AH6_61; %05:00 - 06:00
will then form the active
AH6_71=8.58; AH6_72= AH6_71; %06:00 - 07:00
AH6_81=1.24; AH6_82= AH6_81; %07:00 - 08:00 power vector from House
AH6_91=0.11; AH6_92= AH6_91; %08:00 - 09:00
AH6_101=-1.01; AH6_102=AH6_101; %09:00 - 10:00
AH6_111=-1.55; AH6_112=AH6_111; %10:00 - 11:00
AH6_121=-2.08; AH6_122=AH6_121; %11:00 - 12:00
AH6_131=-3.14; AH6_132=AH6_131; %12:00 - 13:00
AH6_141=-2.64; AH6_142=AH6_141; %13:00 - 14:00
AH6_151=-2.14; AH6_152=AH6_151; %14:00 - 15:00
AH6_161=-1.61; AH6_162=AH6_161; %15:00 - 16:00
AH6_171=-1.07; AH6_172=AH6_171; %16:00 - 17:00
AH6_181=0.00; AH6_182=AH6_181; %17:00 - 18:00
AH6_191=3.78; AH6_192=AH6_191; %18:00 - 19:00
AH6_201=5.29; AH6_202=AH6_201; %19:00 - 20:00
AH6_211=2.99; AH6_212=AH6_211; %20:00 - 21:00
AH6_221=3.25; AH6_222=AH6_221; %21:00 - 22:00
AH6_231=2.19; AH6_232=AH6_231; %22:00 - 23:00
AH6_241=1.13; AH6_242=AH6_241; %23:00 - 24:00

%REACTIVE PHASE C H6
RH6_11=5.63; RH6_12= RH6_11; %00:00 - 01:00 Creation of the variables
RH6_21=5.63; RH6_22= RH6_21; %01:00 - 02:00
containing the reactive
RH6_31=5.63; RH6_32= RH6_31; %02:00 - 03:00
RH6_41=5.63; RH6_42= RH6_41; %03:00 - 04:00 power values (kVAr), which
RH6_51=5.63; RH6_52= RH6_51; %04:00 - 05:00 will then form the active
RH6_61=5.63; RH6_62= RH6_61; %05:00 - 06:00 power vector from House 6
RH6_71=5.63; RH6_72= RH6_71; %06:00 - 07:00
RH6_81=12.44; RH6_82= RH6_81; %07:00 - 08:00
RH6_91=12.34; RH6_92= RH6_91; %08:00 - 09:00
RH6_101=12.24; RH6_102=RH6_101; %09:00 - 10:00
RH6_111=10.95; RH6_112=RH6_111; %10:00 - 11:00
RH6_121=9.67; RH6_122=RH6_121; %11:00 - 12:00
RH6_131=7.10; RH6_132=RH6_131; %12:00 - 13:00

194
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

RH6_141=7.10; RH6_142=RH6_141; %13:00 - 14:00


RH6_151=7.10; RH6_152=RH6_151; %14:00 - 15:00
RH6_161=8.47; RH6_162=RH6_161; %15:00 - 16:00
RH6_171=9.85; RH6_172=RH6_171; %16:00 - 17:00
RH6_181=12.60; RH6_182=RH6_181; %17:00 - 18:00
RH6_191=12.80; RH6_192=RH6_191; %18:00 - 19:00
RH6_201=5.62; RH6_202=RH6_201; %19:00 - 20:00
RH6_211=5.62; RH6_212=RH6_211; %20:00 - 21:00
RH6_221=11.81; RH6_222=RH6_221; %21:00 - 22:00
RH6_231=11.81; RH6_232=RH6_231; %22:00 - 23:00
RH6_241=11.81; RH6_242=RH6_241; %23:00 - 24:00

%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%
Creation of time vectors
%%%%%%%%%%%%%%%%%%%%%% COMB3 %%%%%%%%%%%%%%%%%%%%%% (common for all houses).
%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%% Creation of active and
. reactive power vectors for
. each house.
.
(Same structure for each combo and house)

%%%%%%%%%%%%%%%%% VECTORES %%%%%%%%%%%%%%%%%%%%%


sequence_TIME=[ t11 t12 t21 t22 t31 t32 t41 t42 t51 t52 t61
t62 t71 t72 t81 t82 t91 t92 t101 t102 t111 t112 t121 t122 t131
t132 t141 t142 t151 t152 t161 t162 t171 t172 t181 t182 t191 t192 t201
t202 t211 t212 t221 t222 t231 t232 t241 t242]*time_scale_factor;

SIGNO=1;
sequence_AC_H1=[ AH1_11 AH1_12 AH1_21 AH1_22 AH1_31 AH1_32 AH1_41 AH1_42
AH1_51 AH1_52 AH1_61 AH1_62 AH1_71 AH1_72 AH1_81 AH1_82 AH1_91 AH1_92
AH1_101 AH1_102 AH1_111 AH1_112 AH1_121 AH1_122 AH1_131 AH1_132 AH1_141 AH1_142
AH1_151 AH1_152 AH1_161 AH1_162 AH1_171 AH1_172 AH1_181 AH1_182 AH1_191 AH1_192
AH1_201 AH1_202 AH1_211 AH1_212 AH1_221 AH1_222 AH1_231 AH1_232 AH1_241
AH1_242]*nn*1000;
sequence_RE_H1=[ RH1_11 RH1_12 RH1_21 RH1_22 RH1_31 RH1_32 RH1_41 RH1_42
RH1_51 RH1_52 RH1_61 RH1_62 RH1_71 RH1_72 RH1_81 RH1_82 RH1_91 RH1_92
RH1_101 RH1_102 RH1_111 RH1_112 RH1_121 RH1_122 RH1_131 RH1_132 RH1_141 RH1_142
RH1_151 RH1_152 RH1_161 RH1_162 RH1_171 RH1_172 RH1_181 RH1_182 RH1_191 RH1_192
RH1_201 RH1_202 RH1_211 RH1_212 RH1_221 RH1_222 RH1_231 RH1_232 RH1_241
RH1_242]*nn*1000*SIGNO;

sequence_AC_H2=[ AH2_11 AH2_12 AH2_21 AH2_22 AH2_31 AH2_32 AH2_41 AH2_42


AH2_51 AH2_52 AH2_61 AH2_62 AH2_71 AH2_72 AH2_81 AH2_82 AH2_91 AH2_92
AH2_101 AH2_102 AH2_111 AH2_112 AH2_121 AH2_122 AH2_131 AH2_132 AH2_141 AH2_142
AH2_151 AH2_152 AH2_161 AH2_162 AH2_171 AH2_172 AH2_181 AH2_182 AH2_191 AH2_192
AH2_201 AH2_202 AH2_211 AH2_212 AH2_221 AH2_222 AH2_231 AH2_232 AH2_241
AH2_242]*nn*1000;
sequence_RE_H2=[ RH2_11 RH2_12 RH2_21 RH2_22 RH2_31 RH2_32 RH2_41 RH2_42
RH2_51 RH2_52 RH2_61 RH2_62 RH2_71 RH2_72 RH2_81 RH2_82 RH2_91 RH2_92
RH2_101 RH2_102 RH2_111 RH2_112 RH2_121 RH2_122 RH2_131 RH2_132 RH2_141 RH2_142
RH2_151 RH2_152 RH2_161 RH2_162 RH2_171 RH2_172 RH2_181 RH2_182 RH2_191 RH2_192
RH2_201 RH2_202 RH2_211 RH2_212 RH2_221 RH2_222 RH2_231 RH2_232 RH2_241
RH2_242]*nn*1000*SIGNO;

195
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

sequence_AC_H3=[ AH3_11 AH3_12 AH3_21 AH3_22 AH3_31 AH3_32 AH3_41 AH3_42


AH3_51 AH3_52 AH3_61 AH3_62 AH3_71 AH3_72 AH3_81 AH3_82 AH3_91 AH3_92
AH3_101 AH3_102 AH3_111 AH3_112 AH3_121 AH3_122 AH3_131 AH3_132 AH3_141 AH3_142
AH3_151 AH3_152 AH3_161 AH3_162 AH3_171 AH3_172 AH3_181 AH3_182 AH3_191 AH3_192
AH3_201 AH3_202 AH3_211 AH3_212 AH3_221 AH3_222 AH3_231 AH3_232 AH3_241
AH3_242]*nn*1000;
sequence_RE_H3=[ RH3_11 RH3_12 RH3_21 RH3_22 RH3_31 RH3_32 RH3_41 RH3_42
RH3_51 RH3_52 RH3_61 RH3_62 RH3_71 RH3_72 RH3_81 RH3_82 RH3_91 RH3_92
RH3_101 RH3_102 RH3_111 RH3_112 RH3_121 RH3_122 RH3_131 RH3_132 RH3_141 RH3_142
RH3_151 RH3_152 RH3_161 RH3_162 RH3_171 RH3_172 RH3_181 RH3_182 RH3_191 RH3_192
RH3_201 RH3_202 RH3_211 RH3_212 RH3_221 RH3_222 RH3_231 RH3_232 RH3_241
RH3_242]*nn*1000*SIGNO;

sequence_AC_H4=[ AH4_11 AH4_12 AH4_21 AH4_22 AH4_31 AH4_32 AH4_41 AH4_42


AH4_51 AH4_52 AH4_61 AH4_62 AH4_71 AH4_72 AH4_81 AH4_82 AH4_91 AH4_92
AH4_101 AH4_102 AH4_111 AH4_112 AH4_121 AH4_122 AH4_131 AH4_132 AH4_141 AH4_142
AH4_151 AH4_152 AH4_161 AH4_162 AH4_171 AH4_172 AH4_181 AH4_182 AH4_191 AH4_192
AH4_201 AH4_202 AH4_211 AH4_212 AH4_221 AH4_222 AH4_231 AH4_232 AH4_241
AH4_242]*nn*1000;
sequence_RE_H4=[ RH4_11 RH4_12 RH4_21 RH4_22 RH4_31 RH4_32 RH4_41 RH4_42
RH4_51 RH4_52 RH4_61 RH4_62 RH4_71 RH4_72 RH4_81 RH4_82 RH4_91 RH4_92
RH4_101 RH4_102 RH4_111 RH4_112 RH4_121 RH4_122 RH4_131 RH4_132 RH4_141 RH4_142
RH4_151 RH4_152 RH4_161 RH4_162 RH4_171 RH4_172 RH4_181 RH4_182 RH4_191 RH4_192
RH4_201 RH4_202 RH4_211 RH4_212 RH4_221 RH4_222 RH4_231 RH4_232 RH4_241
RH4_242]*nn*1000*SIGNO;

sequence_AC_H5=[ AH5_11 AH5_12 AH5_21 AH5_22 AH5_31 AH5_32 AH5_41 AH5_42


AH5_51 AH5_52 AH5_61 AH5_62 AH5_71 AH5_72 AH5_81 AH5_82 AH5_91 AH5_92
AH5_101 AH5_102 AH5_111 AH5_112 AH5_121 AH5_122 AH5_131 AH5_132 AH5_141 AH5_142
AH5_151 AH5_152 AH5_161 AH5_162 AH5_171 AH5_172 AH5_181 AH5_182 AH5_191 AH5_192
AH5_201 AH5_202 AH5_211 AH5_212 AH5_221 AH5_222 AH5_231 AH5_232 AH5_241
AH5_242]*nn*1000;
sequence_RE_H5=[ RH5_11 RH5_12 RH5_21 RH5_22 RH5_31 RH5_32 RH5_41 RH5_42
RH5_51 RH5_52 RH5_61 RH5_62 RH5_71 RH5_72 RH5_81 RH5_82 RH5_91 RH5_92
RH5_101 RH5_102 RH5_111 RH5_112 RH5_121 RH5_122 RH5_131 RH5_132 RH5_141 RH5_142
RH5_151 RH5_152 RH5_161 RH5_162 RH5_171 RH5_172 RH5_181 RH5_182 RH5_191 RH5_192
RH5_201 RH5_202 RH5_211 RH5_212 RH5_221 RH5_222 RH5_231 RH5_232 RH5_241
RH5_242]*nn*1000*SIGNO;

sequence_AC_H6=[ AH6_11 AH6_12 AH6_21 AH6_22 AH6_31 AH6_32 AH6_41 AH6_42


AH6_51 AH6_52 AH6_61 AH6_62 AH6_71 AH6_72 AH6_81 AH6_82 AH6_91 AH6_92
AH6_101 AH6_102 AH6_111 AH6_112 AH6_121 AH6_122 AH6_131 AH6_132 AH6_141 AH6_142
AH6_151 AH6_152 AH6_161 AH6_162 AH6_171 AH6_172 AH6_181 AH6_182 AH6_191 AH6_192
AH6_201 AH6_202 AH6_211 AH6_212 AH6_221 AH6_222 AH6_231 AH6_232 AH6_241
AH6_242]*nn*1000;
sequence_RE_H6=[ RH6_11 RH6_12 RH6_21 RH6_22 RH6_31 RH6_32 RH6_41 RH6_42
RH6_51 RH6_52 RH6_61 RH6_62 RH6_71 RH6_72 RH6_81 RH6_82 RH6_91 RH6_92
RH6_101 RH6_102 RH6_111 RH6_112 RH6_121 RH6_122 RH6_131 RH6_132 RH6_141 RH6_142
RH6_151 RH6_152 RH6_161 RH6_162 RH6_171 RH6_172 RH6_181 RH6_182 RH6_191 RH6_192
RH6_201 RH6_202 RH6_211 RH6_212 RH6_221 RH6_222 RH6_231 RH6_232 RH6_241
RH6_242]*nn*1000*SIGNO;

sequence_AC_H7=[ AH7_11 AH7_12 AH7_21 AH7_22 AH7_31 AH7_32 AH7_41 AH7_42


AH7_51 AH7_52 AH7_61 AH7_62 AH7_71 AH7_72 AH7_81 AH7_82 AH7_91 AH7_92
AH7_101 AH7_102 AH7_111 AH7_112 AH7_121 AH7_122 AH7_131 AH7_132 AH7_141 AH7_142
AH7_151 AH7_152 AH7_161 AH7_162 AH7_171 AH7_172 AH7_181 AH7_182 AH7_191 AH7_192
AH7_201 AH7_202 AH7_211 AH7_212 AH7_221 AH7_222 AH7_231 AH7_232 AH7_241
AH7_242]*nn*1000;

196
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

sequence_RE_H7=[ RH7_11 RH7_12 RH7_21 RH7_22 RH7_31 RH7_32 RH7_41 RH7_42


RH7_51 RH7_52 RH7_61 RH7_62 RH7_71 RH7_72 RH7_81 RH7_82 RH7_91 RH7_92
RH7_101 RH7_102 RH7_111 RH7_112 RH7_121 RH7_122 RH7_131 RH7_132 RH7_141 RH7_142
RH7_151 RH7_152 RH7_161 RH7_162 RH7_171 RH7_172 RH7_181 RH7_182 RH7_191 RH7_192
RH7_201 RH7_202 RH7_211 RH7_212 RH7_221 RH7_222 RH7_231 RH7_232 RH7_241
RH7_242]*nn*1000*SIGNO;

sequence_AC_H8=[ AH8_11 AH8_12 AH8_21 AH8_22 AH8_31 AH8_32 AH8_41 AH8_42


AH8_51 AH8_52 AH8_61 AH8_62 AH8_71 AH8_72 AH8_81 AH8_82 AH8_91 AH8_92
AH8_101 AH8_102 AH8_111 AH8_112 AH8_121 AH8_122 AH8_131 AH8_132 AH8_141 AH8_142
AH8_151 AH8_152 AH8_161 AH8_162 AH8_171 AH8_172 AH8_181 AH8_182 AH8_191 AH8_192
AH8_201 AH8_202 AH8_211 AH8_212 AH8_221 AH8_222 AH8_231 AH8_232 AH8_241
AH8_242]*nn*1000;
sequence_RE_H8=[ RH8_11 RH8_12 RH8_21 RH8_22 RH8_31 RH8_32 RH8_41 RH8_42
RH8_51 RH8_52 RH8_61 RH8_62 RH8_71 RH8_72 RH8_81 RH8_82 RH8_91 RH8_92
RH8_101 RH8_102 RH8_111 RH8_112 RH8_121 RH8_122 RH8_131 RH8_132 RH8_141 RH8_142
RH8_151 RH8_152 RH8_161 RH8_162 RH8_171 RH8_172 RH8_181 RH8_182 RH8_191 RH8_192
RH8_201 RH8_202 RH8_211 RH8_212 RH8_221 RH8_222 RH8_231 RH8_232 RH8_241
RH8_242]*nn*1000*SIGNO;

sequence_AC_H9=[ AH9_11 AH9_12 AH9_21 AH9_22 AH9_31 AH9_32 AH9_41 AH9_42


AH9_51 AH9_52 AH9_61 AH9_62 AH9_71 AH9_72 AH9_81 AH9_82 AH9_91 AH9_92
AH9_101 AH9_102 AH9_111 AH9_112 AH9_121 AH9_122 AH9_131 AH9_132 AH9_141 AH9_142
AH9_151 AH9_152 AH9_161 AH9_162 AH9_171 AH9_172 AH9_181 AH9_182 AH9_191 AH9_192
AH9_201 AH9_202 AH9_211 AH9_212 AH9_221 AH9_222 AH9_231 AH9_232 AH9_241
AH9_242]*nn*1000;
sequence_RE_H9=[ RH9_11 RH9_12 RH9_21 RH9_22 RH9_31 RH9_32 RH9_41 RH9_42
RH9_51 RH9_52 RH9_61 RH9_62 RH9_71 RH9_72 RH9_81 RH9_82 RH9_91 RH9_92
RH9_101 RH9_102 RH9_111 RH9_112 RH9_121 RH9_122 RH9_131 RH9_132 RH9_141 RH9_142
RH9_151 RH9_152 RH9_161 RH9_162 RH9_171 RH9_172 RH9_181 RH9_182 RH9_191 RH9_192
RH9_201 RH9_202 RH9_211 RH9_212 RH9_221 RH9_222 RH9_231 RH9_232 RH9_241
RH9_242]*nn*1000*SIGNO;

sequence_AC_H10=[ AH10_11 AH10_12 AH10_21 AH10_22 AH10_31 AH10_32 AH10_41


AH10_42 AH10_51 AH10_52 AH10_61 AH10_62 AH10_71 AH10_72 AH10_81 AH10_82
AH10_91 AH10_92 AH10_101 AH10_102 AH10_111 AH10_112 AH10_121 AH10_122 AH10_131
AH10_132 AH10_141 AH10_142 AH10_151 AH10_152 AH10_161 AH10_162 AH10_171 AH10_172
AH10_181 AH10_182 AH10_191 AH10_192 AH10_201 AH10_202 AH10_211 AH10_212 AH10_221
AH10_222 AH10_231 AH10_232 AH10_241 AH10_242]*nn*1000;
sequence_RE_H10=[ RH10_11 RH10_12 RH10_21 RH10_22 RH10_31 RH10_32 RH10_41
RH10_42 RH10_51 RH10_52 RH10_61 RH10_62 RH10_71 RH10_72 RH10_81 RH10_82
RH10_91 RH10_92 RH10_101 RH10_102 RH10_111 RH10_112 RH10_121 RH10_122 RH10_131
RH10_132 RH10_141 RH10_142 RH10_151 RH10_152 RH10_161 RH10_162 RH10_171 RH10_172
RH10_181 RH10_182 RH10_191 RH10_192 RH10_201 RH10_202 RH10_211 RH10_212 RH10_221
RH10_222 RH10_231 RH10_232 RH10_241 RH10_242]*nn*1000*SIGNO;

sequence_AC_H11=[ AH11_11 AH11_12 AH11_21 AH11_22 AH11_31 AH11_32 AH11_41


AH11_42 AH11_51 AH11_52 AH11_61 AH11_62 AH11_71 AH11_72 AH11_81 AH11_82
AH11_91 AH11_92 AH11_101 AH11_102 AH11_111 AH11_112 AH11_121 AH11_122 AH11_131
AH11_132 AH11_141 AH11_142 AH11_151 AH11_152 AH11_161 AH11_162 AH11_171 AH11_172
AH11_181 AH11_182 AH11_191 AH11_192 AH11_201 AH11_202 AH11_211 AH11_212 AH11_221
AH11_222 AH11_231 AH11_232 AH11_241 AH11_242]*nn*1000;
sequence_RE_H11=[ RH11_11 RH11_12 RH11_21 RH11_22 RH11_31 RH11_32 RH11_41
RH11_42 RH11_51 RH11_52 RH11_61 RH11_62 RH11_71 RH11_72 RH11_81 RH11_82
RH11_91 RH11_92 RH11_101 RH11_102 RH11_111 RH11_112 RH11_121 RH11_122 RH11_131
RH11_132 RH11_141 RH11_142 RH11_151 RH11_152 RH11_161 RH11_162 RH11_171 RH11_172
RH11_181 RH11_182 RH11_191 RH11_192 RH11_201 RH11_202 RH11_211 RH11_212 RH11_221
RH11_222 RH11_231 RH11_232 RH11_241 RH11_242]*nn*1000*SIGNO;

197
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

sequence_AC_H12=[ AH12_11 AH12_12 AH12_21 AH12_22 AH12_31 AH12_32 AH12_41


AH12_42 AH12_51 AH12_52 AH12_61 AH12_62 AH12_71 AH12_72 AH12_81 AH12_82
AH12_91 AH12_92 AH12_101 AH12_102 AH12_111 AH12_112 AH12_121 AH12_122 AH12_131
AH12_132 AH12_141 AH12_142 AH12_151 AH12_152 AH12_161 AH12_162 AH12_171 AH12_172
AH12_181 AH12_182 AH12_191 AH12_192 AH12_201 AH12_202 AH12_211 AH12_212 AH12_221
AH12_222 AH12_231 AH12_232 AH12_241 AH12_242]*nn*1000;
sequence_RE_H12=[ RH12_11 RH12_12 RH12_21 RH12_22 RH12_31 RH12_32 RH12_41
RH12_42 RH12_51 RH12_52 RH12_61 RH12_62 RH12_71 RH12_72 RH12_81 RH12_82
RH12_91 RH12_92 RH12_101 RH12_102 RH12_111 RH12_112 RH12_121 RH12_122 RH12_131
RH12_132 RH12_141 RH12_142 RH12_151 RH12_152 RH12_161 RH12_162 RH12_171 RH12_172
RH12_181 RH12_182 RH12_191 RH12_192 RH12_201 RH12_202 RH12_211 RH12_212 RH12_221
RH12_222 RH12_231 RH12_232 RH12_241 RH12_242]*nn*1000*SIGNO;

sequence_AC_H13=[ AH13_11 AH13_12 AH13_21 AH13_22 AH13_31 AH13_32 AH13_41


AH13_42 AH13_51 AH13_52 AH13_61 AH13_62 AH13_71 AH13_72 AH13_81 AH13_82
AH13_91 AH13_92 AH13_101 AH13_102 AH13_111 AH13_112 AH13_121 AH13_122 AH13_131
AH13_132 AH13_141 AH13_142 AH13_151 AH13_152 AH13_161 AH13_162 AH13_171 AH13_172
AH13_181 AH13_182 AH13_191 AH13_192 AH13_201 AH13_202 AH13_211 AH13_212 AH13_221
AH13_222 AH13_231 AH13_232 AH13_241 AH13_242]*nn*1000;
sequence_RE_H13=[ RH13_11 RH13_12 RH13_21 RH13_22 RH13_31 RH13_32 RH13_41
RH13_42 RH13_51 RH13_52 RH13_61 RH13_62 RH13_71 RH13_72 RH13_81 RH13_82
RH13_91 RH13_92 RH13_101 RH13_102 RH13_111 RH13_112 RH13_121 RH13_122 RH13_131
RH13_132 RH13_141 RH13_142 RH13_151 RH13_152 RH13_161 RH13_162 RH13_171 RH13_172
RH13_181 RH13_182 RH13_191 RH13_192 RH13_201 RH13_202 RH13_211 RH13_212 RH13_221
RH13_222 RH13_231 RH13_232 RH13_241 RH13_242]*nn*1000*SIGNO;

sequence_AC_H14=[ AH14_11 AH14_12 AH14_21 AH14_22 AH14_31 AH14_32 AH14_41


AH14_42 AH14_51 AH14_52 AH14_61 AH14_62 AH14_71 AH14_72 AH14_81 AH14_82
AH14_91 AH14_92 AH14_101 AH14_102 AH14_111 AH14_112 AH14_121 AH14_122 AH14_131
AH14_132 AH14_141 AH14_142 AH14_151 AH14_152 AH14_161 AH14_162 AH14_171 AH14_172
AH14_181 AH14_182 AH14_191 AH14_192 AH14_201 AH14_202 AH14_211 AH14_212 AH14_221
AH14_222 AH14_231 AH14_232 AH14_241 AH14_242]*nn*1000;
sequence_RE_H14=[ RH14_11 RH14_12 RH14_21 RH14_22 RH14_31 RH14_32 RH14_41
RH14_42 RH14_51 RH14_52 RH14_61 RH14_62 RH14_71 RH14_72 RH14_81 RH14_82
RH14_91 RH14_92 RH14_101 RH14_102 RH14_111 RH14_112 RH14_121 RH14_122 RH14_131
RH14_132 RH14_141 RH14_142 RH14_151 RH14_152 RH14_161 RH14_162 RH14_171 RH14_172
RH14_181 RH14_182 RH14_191 RH14_192 RH14_201 RH14_202 RH14_211 RH14_212 RH14_221
RH14_222 RH14_231 RH14_232 RH14_241 RH14_242]*nn*1000*SIGNO;

sequence_AC_H15=[ AH15_11 AH15_12 AH15_21 AH15_22 AH15_31 AH15_32 AH15_41


AH15_42 AH15_51 AH15_52 AH15_61 AH15_62 AH15_71 AH15_72 AH15_81 AH15_82
AH15_91 AH15_92 AH15_101 AH15_102 AH15_111 AH15_112 AH15_121 AH15_122 AH15_131
AH15_132 AH15_141 AH15_142 AH15_151 AH15_152 AH15_161 AH15_162 AH15_171 AH15_172
AH15_181 AH15_182 AH15_191 AH15_192 AH15_201 AH15_202 AH15_211 AH15_212 AH15_221
AH15_222 AH15_231 AH15_232 AH15_241 AH15_242]*nn*1000;
sequence_RE_H15=[ RH15_11 RH15_12 RH15_21 RH15_22 RH15_31 RH15_32 RH15_41
RH15_42 RH15_51 RH15_52 RH15_61 RH15_62 RH15_71 RH15_72 RH15_81 RH15_82
RH15_91 RH15_92 RH15_101 RH15_102 RH15_111 RH15_112 RH15_121 RH15_122 RH15_131
RH15_132 RH15_141 RH15_142 RH15_151 RH15_152 RH15_161 RH15_162 RH15_171 RH15_172
RH15_181 RH15_182 RH15_191 RH15_192 RH15_201 RH15_202 RH15_211 RH15_212 RH15_221
RH15_222 RH15_231 RH15_232 RH15_241 RH15_242]*nn*1000*SIGNO;

sequence_AC_H16=[ AH16_11 AH16_12 AH16_21 AH16_22 AH16_31 AH16_32 AH16_41


AH16_42 AH16_51 AH16_52 AH16_61 AH16_62 AH16_71 AH16_72 AH16_81 AH16_82
AH16_91 AH16_92 AH16_101 AH16_102 AH16_111 AH16_112 AH16_121 AH16_122 AH16_131
AH16_132 AH16_141 AH16_142 AH16_151 AH16_152 AH16_161 AH16_162 AH16_171 AH16_172
AH16_181 AH16_182 AH16_191 AH16_192 AH16_201 AH16_202 AH16_211 AH16_212 AH16_221
AH16_222 AH16_231 AH16_232 AH16_241 AH16_242]*nn*1000;

198
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

sequence_RE_H16=[ RH16_11 RH16_12 RH16_21 RH16_22 RH16_31 RH16_32 RH16_41


RH16_42 RH16_51 RH16_52 RH16_61 RH16_62 RH16_71 RH16_72 RH16_81 RH16_82
RH16_91 RH16_92 RH16_101 RH16_102 RH16_111 RH16_112 RH16_121 RH16_122 RH16_131
RH16_132 RH16_141 RH16_142 RH16_151 RH16_152 RH16_161 RH16_162 RH16_171 RH16_172
RH16_181 RH16_182 RH16_191 RH16_192 RH16_201 RH16_202 RH16_211 RH16_212 RH16_221
RH16_222 RH16_231 RH16_232 RH16_241 RH16_242]*nn*1000*SIGNO;

sequence_AC_H17=[ AH17_11 AH17_12 AH17_21 AH17_22 AH17_31 AH17_32 AH17_41


AH17_42 AH17_51 AH17_52 AH17_61 AH17_62 AH17_71 AH17_72 AH17_81 AH17_82
AH17_91 AH17_92 AH17_101 AH17_102 AH17_111 AH17_112 AH17_121 AH17_122 AH17_131
AH17_132 AH17_141 AH17_142 AH17_151 AH17_152 AH17_161 AH17_162 AH17_171 AH17_172
AH17_181 AH17_182 AH17_191 AH17_192 AH17_201 AH17_202 AH17_211 AH17_212 AH17_221
AH17_222 AH17_231 AH17_232 AH17_241 AH17_242]*nn*1000;
sequence_RE_H17=[ RH17_11 RH17_12 RH17_21 RH17_22 RH17_31 RH17_32 RH17_41
RH17_42 RH17_51 RH17_52 RH17_61 RH17_62 RH17_71 RH17_72 RH17_81 RH17_82
RH17_91 RH17_92 RH17_101 RH17_102 RH17_111 RH17_112 RH17_121 RH17_122 RH17_131
RH17_132 RH17_141 RH17_142 RH17_151 RH17_152 RH17_161 RH17_162 RH17_171 RH17_172
RH17_181 RH17_182 RH17_191 RH17_192 RH17_201 RH17_202 RH17_211 RH17_212 RH17_221
RH17_222 RH17_231 RH17_232 RH17_241 RH17_242]*nn*1000*SIGNO;

sequence_AC_H18=[ AH18_11 AH18_12 AH18_21 AH18_22 AH18_31 AH18_32 AH18_41


AH18_42 AH18_51 AH18_52 AH18_61 AH18_62 AH18_71 AH18_72 AH18_81 AH18_82
AH18_91 AH18_92 AH18_101 AH18_102 AH18_111 AH18_112 AH18_121 AH18_122 AH18_131
AH18_132 AH18_141 AH18_142 AH18_151 AH18_152 AH18_161 AH18_162 AH18_171 AH18_172
AH18_181 AH18_182 AH18_191 AH18_192 AH18_201 AH18_202 AH18_211 AH18_212 AH18_221
AH18_222 AH18_231 AH18_232 AH18_241 AH18_242]*nn*1000;
sequence_RE_H18=[ RH18_11 RH18_12 RH18_21 RH18_22 RH18_31 RH18_32 RH18_41
RH18_42 RH18_51 RH18_52 RH18_61 RH18_62 RH18_71 RH18_72 RH18_81 RH18_82
RH18_91 RH18_92 RH18_101 RH18_102 RH18_111 RH18_112 RH18_121 RH18_122 RH18_131
RH18_132 RH18_141 RH18_142 RH18_151 RH18_152 RH18_161 RH18_162 RH18_171 RH18_172
RH18_181 RH18_182 RH18_191 RH18_192 RH18_201 RH18_202 RH18_211 RH18_212 RH18_221
RH18_222 RH18_231 RH18_232 RH18_241 RH18_242]*nn*1000*SIGNO;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t_stop=t242*time_scale_factor;
t_simula=1e-5;
Time variables for simulation. Creation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
of DC voltage for three-phase inverter
Vdc_SOLAR=400;
Vdc_EV=Vdc_SOLAR;
control. Introduction of filter variables

%%%%%%%%%%%%%%%%%%%%%%%%%% FILTERS %%%%%%%%%%%%%%%%%%%%%%%%%%


wo=2*pi*50; Vnom=230*sqrt(2); num=[wo]; den=[1 wo]; Voref=1.03*Vnom;

%FILTER 1 P & Q
sysd1_h1_sol=c2d(tf(num,den),10e-6,'tustin');
[numLPF_h1_sol,denLPF_h1_sol]=tfdata(sysd1_h1_sol,'v');
[numLPF_h1_ev,denLPF_h1_ev]=tfdata(sysd1_h1_sol,'v');

% %FILTER 2 kq=1e-3; kp=0; ki=21600; num1=[kp ki]; den1=[1 0];


sysd2=c2d(tf(num1,den1),10e-6,'tustin');
[numQ_h1_sol,denQ_h1_sol]=tfdata(sysd2,'v');[numQ_h1_ev,denQ_h1_ev]=tfdata(sysd2,'v
');
%FILTER 2 ALFA BETA
kp_h1_sol=35; ki_h1_sol=300; shi_h1_sol=0.01; num_h1_sol=[ki_h1_sol*2*shi_h1_sol*wo
0]; den_h1_sol=[1 2*shi_h1_sol*wo wo^2];
sysd2_sol=c2d(tf(num_h1_sol,den_h1_sol),10e-6,'tustin');
[numz_h1_sol,denz_h1_sol]=tfdata(sysd2_sol,'v');

199
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

kp_h1_ev=35; ki_h1_ev=300; shi_h1_ev=0.01; num_h1_ev=[ki_h1_ev*2*shi_h1_ev*wo 0];


den_h1_ev=[1 2*shi_h1_ev*wo wo^2];
sysd2_ev=c2d(tf(num_h1_ev,den_h1_ev),10e-6,'tustin');
[numz_h1_ev,denz_h1_ev]=tfdata(sysd2_ev,'v');
%__________________________________________________________________________________

R_LINE=1e-6; L_LINE=1.0e-6;
sim('CASE_3_SIM_FINAL2');

200
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 9: Case 3 figures

H1

H2

H3

Figure A35: Active and Reactive power (left) and accumulated energy (right) of COMB 1 for the 3 scenarios - Case 3

201
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H1 H2 H3
[kVA]

[kVA]

[kVA]
Apparent
Power
[kVA]

Apparent
Energy
[kVA]

Figure A36: Apparent power and accumulated active energy of COMB 1 for the 3 scenarios - Case 3

202
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H4

H5

H6

Figure A37: Active and Reactive power (left) and accumulated energy (right) of COMB 2 for the 3 scenarios - Case 3

203
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H4 H5 H6

[kVA]

[kVA]
Apparent
[kVA]

Power
[kVA]

Apparent
Energy
[kVA]

Figure A38: Apparent power and accumulated active energy of COMB 2 for the 3 scenarios - Case 3

204
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H7

H8

H9

Figure A39: Active and Reactive power (left) and accumulated energy (right) of COMB 3 for the 3 scenarios - Case 3

205
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H7 H8 H9

[kVA]
Apparent

[kVA]
[kVA]
Power
[kVA]

Apparent
Energy
[kVA]

Figure A40: Apparent power and accumulated active energy of COMB 3 for the 3 scenarios - Case 3

206
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H10

H11

H12

Figure A41: Active and Reactive power (left) and accumulated energy (right) of COMB 4 for the 3 scenarios - Case 3

207
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H10 H11 H12

Apparent

[kVA]
[kVA]
[kVA]

Power
[kVA]

Apparent
Energy
[kVA]

Figure A42: Apparent power and accumulated active energy of COMB 4 for the 3 scenarios - Case 3

208
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H13

H14

H15

Figure A43: Active and Reactive power (left) and accumulated energy (right) of COMB 5 for the 3 scenarios - Case 3

209
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H13 H14 H15

Apparent

[kVA]
[kVA]

[kVA]
Power
[kVA]

Apparent
Energy
[kVA]

Figure A44: Apparent power and accumulated active energy of COMB 5 for the 3 scenarios - Case 3

210
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H16

H17

H18

Figure A45: Active and Reactive power (left) and accumulated energy (right) of COMB 6 for the 3 scenarios - Case 3

211
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

H16 H17 H18

Apparent

[kVA]

[kVA]
[kVA]

Power
[kVA]

Apparent
Energy
[kVA]

Figure A46: Apparent power and accumulated active energy of COMB 6 for the 3 scenarios - Case 3

212
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

213
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Annex 10: Case 3 figures and data for 18, 71 and 144 homes

Figure A47: Active and reactive power per phase (18 houses), Scenario 1 - Case 3

Figure A48: Active and reactive power per phase (72 houses), Scenario 1 - Case 3

214
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A49: Active and reactive power per phase (144 houses), Scenario 1 - Case 3

Figure A50: Active and reactive power per phase (18 houses), Scenario 2 - Case 3

215
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A51: Active and reactive power per phase (72 houses), Scenario 2 - Case 3

Figure A52: Active and reactive power per phase (144 houses), Scenario 2 - Case 3

216
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A53: Active and reactive power per phase (18 houses), Scenario 3 - Case 3

Figure A54: Active and reactive power per phase (72 houses), Scenario 3 - Case 3

217
Application of electric vehicles and solar panels to support the public grid through reactive power injection
Carles Bertran Pujol

Figure A55: Active and reactive power per phase (144 houses), Scenario 3 - Case 3

218

You might also like