## 4 Simulation Model  
Model Structure  
To examine the effectiveness of the proposed energy management strategy, a simulation model of the prosumer installation connected to the distribution network was built in the PSCAD program environment [28] (Figure 3). The model consists of the following modules:  
* Distribution network (SUPPLYING NETWORK);
* Feeder breaker (MAIN BREAKER);
* Loads connected to the installation (PROSUMER LOADS);
* PV panels (PROSUMER PV INSTALLATION);
* Stationary energy storage system (ESS);
* Electric vehicle (EV);
* The external controller (MAIN CONTROLER). The description of the modules is provided below. The SUPPLYING NETWORK module consists of two blocks: The ideal three-phase voltage source of the nominal voltage 15 kV and the 15/0.4 kV distribution transformer supplying LV busbars. The prosumer installation modules are connected to the supplying network via the main breaker (MAIN BREAKER Module). The multimeter is used to measure the instantaneous exchange power (in the real installation the readouts from the smart meter could be used). The EV module consists of the following blocks: The EV motor block (EV DRIVE), the controllable bi-directional drive inverter together with its blocks (EV DRIVE INVERTER) and the battery block (BATTERY). The EV drive is represented by the synchronous machine with permanent magnets. The integral part imitates the car inertia brought to the machine shaft. The input of this block is the sum of torques: Electromagnetic driving Te dependent on the current generated by the inverter and provided to the vehicle engine and the mechanical torque braking the car's movement. The output is the value of the machine's angular velocity \(\omega\). It is assumed that the resistance to the movement and thus the mechanical torque are proportional to the angular velocity of the car. Figure 3: Schematic diagram of EV and home installation simulator model. The EV DRIVE INVERTER block represents the DC/AC motor inverter. The inverter is built as a 6T bridge of GTO thyristors. In the block of the EV DRIVE INVERTER CONTROLER, the firing pulses to thyristors are generated using the PWM technique. Hysteresis control is applied, in which the inverter AC current iF reproduces the reference current vector iref determined in the block of EV CONTROLER. The RLC elements are used to reduce the current harmonics of high frequencies resulting from the thyristor switches operation. The battery is represented by the DC voltage source complete with the elements used to model charging and discharging efficiency and the battery state of charge. The details and the potential applications of the motor inverter were presented in [29]. The prosumer load module is used to reproduce the load profile based on the real power measurements. The measurements were previously recorded and averaged for the group of consumers. The data file used in the simulation includes a one-day profile with 24 active power values. The PV installation module consists of three main parts: Photovoltaics panel, controllers, and the PV inverter (the 6T bridge of GTO thyristors). The irradiance from real measurements was used as an input for the PV model. The irradiance may change (due to the cloud cover forecast) so different weather conditions can be analyzed. The ESS design is similar to the EV module. Obviously, it does not include the drive block. Furthermore, the battery capacity and the system power are significantly smaller. Since the ESS is permanently available, it is possible to plan its operation based only on tariff prices: Battery charging is conducted during the low-price tariff and discharging during the high prices.