Research on the Improvement of the RTLAB Simulation Efficiency in DG

RTLAB is a new simulation tool in the research fields of distributed power and micro-grid simulation. The simulation speed is essential to the research efficiency. In order to improve the simulation speed of the RTLAB, research on the simulation data uploading process has been studied in this paper. Using the FTP data uploading functions to achieve the lower computer data was succeeded. By comparing the experimental results, it shows that the speed is significantly upgraded by using FTP data transmission method to upload the data.


INTRODUCTION
RT-LAB is a new application design platform based on engineering model for real-time simulation.When using this platform, the first step is using MATLAB / Simulink or MATRIXx / SystemBuild to build mathematical models of dynamic systems in need.Next, the model is loaded into the RT-LAB simulation platform, and then the half of physical hardware in the loop simulation for real-time simulation is realized.
Currently, the platform has been widely used in fields of power systems, distributed power and micro-grid simulation.During the simulation study, the simulation speed is essential to carry out research work that has direct impacts on research progress in efficiency.In order to improve the RTLAB simulation efficiency, a better method to achieve the lower computer data was found, that is using FTP data to upload functions.The experimental results show that the FTP method is effective to upgrade the uploading rate.

EXISTING DATA UPLOADS METHOD IN RTLAB SIMULATION
The main processes of RTLAB simulation include editing model, simulation settings, compiled code simulation, download the code to the next crew, execution and reset [1] .If the simulation aspects of the packet are set to upload option automatically, the packet would be automatically uploaded from the next crew to the PC in the simulation reset link.Then the operator analyzes and processes the data in the PC [2] .Because the editing, compiling, building and loading are unrelated to upload data, these three aspects can be ignored in order to facilitate the discussion at first, then the crew packets uploading efficiency issues.
However, the packet upload option is set before the simulation, and the need for uploading the data pack-ets are generally determined after executing the simulation program.Due to the existence of this contradiction, following questions would be raised: 1) If you choose the automatically upload mode before simulation, large amounts of useless data will be uploaded while more time will be wasted and more RAM of the host computer will be taken up.
2) However, if you forget to choose the automatically upload mode, the simulation will be probably repeated again for the lack of data.For some large-scale simulation, the completion time may take several hours or even a few days that greatly increased the simulation workload.
3) What's more, if you choose the automatically upload mode, the time of the resetting process will be increased remarkably, which is usually10 times more than the non-automatic mode.formats.However, there are three methods of data transmission at present [3] : 1) Socket method Socket method is a typical C / S -interactive mode, which is an easy interactive including a client and a server.Server accesses are through the IP address and port to provide services, while clients are connected to the specified port of server for message exchange.
2) FTP / file sharing server mode This kind of interactive mode is suitable for large amounts of data interaction.System A and system B determine file server addresses, file naming, file content format content, then upload files to the file server for data exchange.
3) Database shared data mode System A and system B are connected to the same table of the database server for data exchange.When the system A requests system B to process data, the A insert a data which the B follows to deal with.

4) Message mode
System A and System B are exchanging the data via a message server.System A sends a message to the server and the server pushes the message to B when the message format is accepted.
Comparing the several transmission methods, the FTP method is found to have the function to copy the file from the client to the server.FTP client can release commands to the server to download files, upload files, create or change the direction on the server.And it has a graphical interface software.The FTP transmission method is easy to serve the general public with no authentication.Therefore, the FTP mode will be used to explore the data transmission efficiency in this paper.

FTP application to RTLAB data transmission
From the main features of the FTP, we know that it allows the user to connect a remote computer running FTP server program to view the files.Then the file is copied from the local computer on a remote computer or the local computer files is sent to a remote computer [4] .It is shown as follows: As it is at the time to upload data from the next crew, there is a need to install and run the FTP server in the control panel and lower machine first.The path of the data stored in the next crew should be con-firmed after executing the simulation and reset.Read the next crew machine data on the operations master through FTP mode, and optionally upload the available data.After using the new method, the simulation data packets do not need to be performed, and the efficiency and flexibility of the next crew data uploading can be effectively improved.The main flow of the proposed optimization of the RT-LAB simulation is shown in the Figure 4.

Comparison of the FTP mode and the original
In order to verify whether the transfer rate is improved by using the FTP mode, three kinds of different complex levels of model were chosen to be verified.The models were shown in figure 5.
Verification testing process is shown as follows: Simulate the same model in different lengths of time, and respectively record the time of the automatically uploading and the FTP model.And the recorded time was shown in the following chart.
(1)The time recording of the data uploaded by simulating model 1.
The recorded time was plot as figure 6.
(2)The time recording of the data uploaded by simulating model 2: The recorded time was plot as figure 7.
(    The recorded time was plot as figure 8.The above chart shows simulation of the same model in different lengths of time.When using FTP mode to read the next crew machine data to avoid waiting for uploading the burdensome data packets that does not require, the speed was significantly faster that reading the data from the next crew were less than 20s. (4)Then the different complex models were simulated in the same length of time, and the next crew data were uploaded by using the two models.The different time was recorded and plotted as follows:   This figure shows that, using the FTP mode can improve the upload speed, especially simulate the complexity model that the time-consuming problem in the simulation process was effectively improved and RT-LAB simulation efficiency was increased.

CONCLUSION
(1)When reading data using FTP mode, uploading the data package by using the RT-LAB automatic data upload process for long time was effectively avoided.The time of uploading the data from the next crew was shortened.The RT-LAB -loop simulation speed was effectively improved.The simulation speed problem of complex distributed power system by using the software was effectively improved.
(2)By the selection of the FTP server path, the data can be targeted uploaded from the next crew.Thus the effective data to be used next would be saved only in the host computer that saving memory space.What's more, the operator can take the initiative to use the lower machine data, eliminate the need to wait the data uploading process passively.

Figure 5 .
Figure 5. Model figure for the simulation test

Figure 7 .
Figure 7. Upload time record of model 2

Figure 8 .
Figure 8. Upload time record of model 3

Table 1 .
Upload time sheets of model 1 (units/s)

Table 2 .
Upload time sheets of model 2 (units/s)

Table 3 .
Upload time sheets of model 3 (units/s)