A PHP Application Library for Web-Based Power Systems Analysis

INTRODUCTION The delivery of power systems analysis software via the internet is a topic that has been explored previously in various works [1]–[6]. There have also been various implementations ranging from industry standard commercial packages such as NEPLAN having online versions [7] to free open source packages that may be used on the web [8], [9]. Byrne, Heavey and Byrne cover webbased simulation in detail [1] and define web-based simulation as the use of resources and technologies offered by the world-wide-web (WWW) for interaction with client (web browser) and server (remote computer) modelling and simulation tools. The definition goes further to emphasize the active role of the web browser (Microsoft Internet Explorer™, Mozilla Firefox™, Google Chrome™, etc. for example) in the modelling or simulation process, either as a graphical interface or, additionally, as a container for the simulation numerical engine. This is the definition used to provide the context for web-based simulation in this paper, and it excludes simulation packages that are downloaded from a web server to a local computer and executed independent of the web browser. Such software packages are also categorised as Software as a service (SaaS) because their tools are accessed remotely as services [1]. The application architecture of web-based power systems analysis software (WBPSA) usually consists of 3 tiers as shown in Figure 1; One tier consists of the remote simulation server which runs a software that simulates a model of the network and performs calculations, the second tier is the web server that handles communication between the other tiers, and the third tier is the web browser for input of parameters and displaying results. The methodologies for WBPSA in previous research work usually adapt this pattern. Active Server Pages (ASP) and ASP.NET are used to process requests and responses in [5], [10], [11] between the simulation server running C# programs and the web browser. Java Server Pages (JSP) are used in [3] to connect a legacy simulation application based on Fortran to Java applets running in the web browser. The same architecture is applied in commercial and open source software. NEPLAN 360 [12] is the leader in this category and provides a robust application via the web interface which has all the key features of the desktop version along with an Application Programming Interface for third party access. The legacy application runs on the simulation server and is served through a cloud computing interface to a Microsoft Silverlight™ plugin in the web browser. There is no indication that the actual simulation is done via a web server script and therefore it also has 3- tier architecture. MATLAB power systems solvers such as MATPOWER [13] may also be accessed on the web by running them on an application server with MATLAB installed and then using an intermediate scripting language such as ASP.NET to communicate with the web browser [14]. Another web-based cloud application is InterPSS [15] which is based on Google Drive ™ spread sheets for data input and results output, and a Google Apps™ script communicates with a Java based simulation engine. The 3-tier architecture is implemented for practical reasons. One reason is that the simulation software packages which are not ready for internet modelling use a web server as an interface. The only requirement for web access will now be an upgrade of communication and data transfer protocols not the simulation methods. Another practical reason for the 3-tier architecture is that the programming languages used for building websites are not as powerful or as purposeful for computation as those used for building simulation software.

Web servers typically run scripts written in ASP, ASP.NET, JSP, Perl, PHP, etc. [16] which are designed primarily for text-based communication using Hypertext Transfer Protocols (HTTP) while simulation packages are built using more powerful languages such as C, C++, C#, Java, etc. [1], [9] because they have a wider range of tools to perform the mathematical analysis required and produce results in a relatively short amount of time. However more recent versions of the web server languages have been upgraded to provide tools for more complex computation such as Object Oriented Programming [17]. Independent third party libraries and extensions are also increasingly available for providing additional mathematical and analytical capabilities on web servers. The implication is that some of the computation that has been handled completely by the dedicated simulation tier may now be performed on the web server tier. Newer versions of more powerful scripting languages such as Python which were not originally designed for internet use may now be deployed on the web also thereby providing more opportunities for web server power systems computation. Python scripting has indeed been used for Power systems computation in [18], however in that instance it wasn’t deployed on a web server. It may be observed from the preceding review that the web programming languages used to interface simulation software for internet modelling are usually ASP.NET and JSP. These are likely choices because they are strongly linked to Visual Basic (VB) and Java respectively, as they were created by the same vendors; Microsoft [19] and Oracle [20] respectively. Therefore the models in the simulation software written in VB and Java, which are popular choices [1], can be accessed more easily in those web scripting languages. PHP [21] is the most used web server scripting language [22] but WBPSA is currently not being implemented using it. There are several possible reasons for this including the ease of interfacing existing simulation software using ASP.NET to VB and JSP to Java, and the computational limitations of PHP as a programming language for modelling and simulation. PHP has gradually transformed into a general purpose programming language [17], [21] as web applications have become more complex and the language has been updated. Recent versions of PHP include additional features to make it easier to build complex web applications using PHP. Apart from the additional core features that make PHP more capable of general purpose programming, it also benefits from having several extensions and third party libraries to further extend its capabilities. This paper covers the development of a PHP application library for power systems analysis. The result is a 2-tier application architecture in which the simulation modelling is performed on the web server as shown in Figure 2. The benefit of this approach is a slimmer framework that requires less computational resources. It also means that websites that have been built using PHP can include power systems models for various purposes by utilizing the library. For example, a network model operating an experimental algorithm may be published directly to a PHP website and actively operated by peer reviewers to view how conditions of the network are affected by changing parameters. This will represent an improvement in dynamic results presentation as there won’t be only static defined sets of results for defined sets of parameters. To achieve this in the present form of WBPSA will require licensing fees for the commercial packages, significant programming skills and more cloud computing resources for the simulation server.

The PHP application library discussed has key functions primarily for power flow and line flows which are fundamental studies for power systems analysis. The model requirements for these studies are reviewed to define the specifications for the PHP application. The methodology for using PHP to perform these studies is covered and finally the performance of the library is measured and discussed.