1 Web-based Transaction Operational Feasibility Analysis in Electricity Markets H. Chen, Student Member, IEEE, C. A. Cañizares, Senior Member, IEEE¸ and A. Singh, Member, IEEE Abstract Transaction Operational Feasibility (TOF) analysis is important in electricity markets to ensure reliable and secure operation of power systems. This paper presents a web-based design and implementation of TOF analysis, based on three-tier client/server architecture and up to date web technologies, so that the TOF analysis can be easily and effectively accessed by all market participants for competitive decision making. The proposed TOF analysis is based on approximate ATC computations for efficient real-time market operation. A 3-area system example is given for illustration purposes. Index Terms Electricity markets, Capability (ATC), Web computing, client/server architecture. Available Transfer Java programming, I. INTRODUCTION B ECAUSE of overriding power system security requirements, the transfer capabilities of transmission systems are limited. In electricity markets, transactions proposed by the market forces are hence limited by these security requirements. Thus, transactions are operationally feasible only when they are within the transmission system transfer capability, i.e. these are dispatched only when transmission security limits are not violated. After bidmatching, potential transactions need to be checked by market/system operators for their operational feasibility [1], [2]; market participants can also use the feasibility analysis to estimate the possibilities of the acceptances of their bids for strategically bidding in the markets to achieve higher profits. Since market participants are geographically widely distributed and have different software and hardware platforms, implementing Transaction Operational Feasibility (TOF) analysis in a web-based platform would allow them to easily and widely carry out these types of analysis through heterogeneous hardware and software platforms without any configuration, installation or update operation. With the evolution and widespread deployment of the World Wide Web (WWW), accelerated by the rapid adoption of web browsers, web-based applications have been developed for a variety of applications in electricity markets. Most of these applications use web techniques for information access This work was partially supported by NSERC, Canada, and the Department of Electrical and Computer Engineering at the University of Waterloo. All the authors are with the Department of Electrical and Computer Engineering at the University of Waterloo, 200 University Av. W., Waterloo, ON, Canada, N2L-3G1, c.canizares@ece.uwaterloo.ca and exchange. For example, in [3], Internet-based client/server concepts are used to monitor transmission substations; in [4], the authors introduce an Internet-based energy trading system which allows buyers and sellers of energy to freely engage in trading activities over a wide range of energy sources, products and geographical regions. With the help of high performance CPU and fast network communications, more sophisticated applications have also been built on the web, using it as a widely distributed environment to share data and resources for parallel computing application [5]. Other examples of web-based computing in power systems are [6] to [11]. The authors in [6] apply Java for the interactive learning of power system stability on the web. In [7] and [8], remote power flows are introduced as a simulation environment for power system analysis and for educational purposes via the Internet. The design of a web-based system to support Electronic Commerce solutions for deregulated electricity markets by reengineering legacy EMS software is introduced in [9]. The authors in [10] implement a web-based SCADA display system. Finally, in [11], a web-based electricity market simulator that can be used as a decision-making tool for market participants is described. In most of these cases, Java is used for the implementation. In this paper, the prototype Java implementation of a threetier client/server design for a web-based TOF analysis is presented. The underlying TOF analysis procedure is based on approximate ATC computations, as suggested in [12]. The paper is structured as follows: In Section II, the supporting web technologies used in the implementation are briefly reviewed. The TOF analysis is discussed in Section III. In Section IV, the web-based architecture design and prototype implementation of the TOF analysis are presented. Section V discusses the application of the developed prototype to a 3area system example. The main contributions of this paper and future research directions are presented in Section VI. II. SUPPORTING WEB TECHNOLOGIES A. The Web The web is not only used as a medium to share data, information, and knowledge, but also used as general distributed computing environment for complicated business applications. Web environment offers common user interface (the browser), richer interaction possibilities, and platform independent features. The typical data communications in the web are based on a 2 client-server model, which involves three basic components: client (browser), server and network. The communication between web clients and servers is always in the form of request-response pairs. Thus, the user initiates a request for information or action through the client software. This request then travels over the network to the server, which interprets the requests and takes some desired action. The results of the requested transaction are then sent back to the client and displayed [13]. Web browsers and web servers communicate by using the Hypertext Transfer Protocol (HTTP), this way objects are addressed using a special form of universal resource identifier, i.e. the Universal Resource Locator (URL). On the client's side, the central part is the web browser, such as Netscape's Communicator, Microsoft's Internet Explorer, etc., for displaying Hypertext Markup Language (HTML)-content. B. Java Java is a general-purpose, high-level programming language and a powerful software platform [14]. It is object-oriented, robust, secure, architecture neutral, portable, and multithreaded. Its executable code (called bytecode) runs on any hardware and software platforms, provided that a Java runtime system called Java Virtual Machine (JVM) is present. Hence, Java becomes a good platform for writing client/server web-based applications. 1) Servlet Servlets can provide secure protocol- and platformindependent, server-side web-enabled software components, written in Java [15]. They provide a general framework for services built using the request-response paradigm. The Java Servlet API provides the way to build JavaServer technology in networked applications. Instead of serving only static web pages, a servlet-enabled web server can invoke servlet methods to dynamically generate content at runtime. A servlet instance goes through a simple life cycle, initialized once, requested multiple times, and then finally destroyed. Servlets remain alive between requests. Servlets offer an efficient platform-independent replacement for Common Gateway Interface (CGI) scripts. It has less startup cost, executes more efficiently, and can be used on any platform that supports Java. Servlet instances can persist across client requests, whereas, for CGI scripts, web servers need to throw a separate process for processing each request received, thus when requests increase, servers are loaded with too many simultaneous processes and hence system performance deteriorates. 2) Java Database Connection (JDBC) JDBC is the Java standard specification for accessing and manipulating relational databases [15]. It allows programming to proceed quickly and design software interface easily. JDBC consists of a set of classes and interfaces written in the Java programming language that provide a standard API for database developers, making it possible to write database applications using a pure Java API. Through JDBC, it is possible to establish a connection with a database, send SQL statements, and receive results. JDBC has two layers: The JDBC API that provides a Java interface to a relational database, and the JDBC driver API that executes/implements this interface. The basic function of a JDBC driver is to provide certain mechanism to make Java applications able to talk to a Database Management System (DBMS) that is usually not written in Java. JDBC is a cross-platform, non-database specific approach for database access from Java programs, and can be used for database manipulation in the web. III. TRANSACTION OPERATIONAL FEASIBILITY ANALYSIS TOF analysis consists of checking if the dispatching of transactions violates system security limits, which essentially consists on checking if transactions are within the Available Transfer Capability (ATC) of transmission systems. The acceptance, rejection and/or adjustment of transactions is then based on this particular analysis. A. Available Transfer Capability (ATC) ATC, as defined by NERC, is “a measure of the transfer capability remaining in the physical transmission network for further commercial activity over and above already committed uses” [16]. It is expressed as: ATC = TTC -TRM – ETC where TTC stands for the Total Transfer Capability of the network, and ETC, which includes the Capacity Benefit Margin (CBM), represents the Existing Transmission Commitments. The Transmission Reliability Margin (TRM) and CBM are included to account for uncertainties in system operation. Accurate and speedy ATC computation is very important for real-time electricity market operation, since both system operators and market participants need to know the network's capability to transfer power reliably and securely, while making the most out of the existing transmission network. Different methods have been used for on-line and off-line ATC calculation. Among them, the bifurcation-based Continuation Power Flow (CPF) methods can be used for adequate estimation of ATC [12]; therefore, this technique is used here for ATC computation. B. Analysis Procedure A TOF analysis procedure based on a CPF-based ATC computation is shown in Fig. 1. The main steps are: 1. The base system conditions, which includes projected customer demand or base load, generation dispatch pattern, system configuration and base scheduled transfer, determine the base power flow condition, which are modeled as the already committed transmission usage, i.e. ETC. 2. The load and generation increase patterns determine the power increase above the base power flow, and are defined by potential transactions obtained from bid matching, i.e. matching offers with bids and forecasted loads. 3. The ATC computation is the core part of the TOF analysis, and it is performed by a CPF method, taking into account thermal limits, voltage limits and voltage stability 3 load affecting factors historical Load Client (GUI) Web Browser HTML document Load Forecasting forecasted load HTTP Presentation Tier Internet Bids Offers Application Server Bid system generation configuration pattern base load Matching HTTP server Servlet container Servlets potential Middle Tier JDBC transactions SQL Load & Generation Increasing pattern TRM power increase Base condition Modeling Internet Database Server base power flow DBMS Backend Tier ATC Computation Fig. 2. Three-tier client/server architecture. ATC ATC >= transactions N Infeasible Y Feasible Fig. 1. TOF analysis procedure. limits [12]. The value of TRM is assumed known in this case. Thus, the ATC is calculated from the load and generation patterns and base system conditions, and it basically consists on determining the maximum power transfer for the power system, considering all credible contingencies. 4. If potential transactions are within the calculated ATC, they are considered as feasible transactions and can be accepted; otherwise, they are deemed infeasible and hence need to be adjusted. Techniques for properly adjusting these proposed transactions will be included in the next prototype. IV. WEB-BASED DESIGN AND IMPLEMENTATION A. Architecture The web-based TOF is designed using a 3-tier client/server architecture, as shown in Fig. 2. The application logic is separated from the Graphic User Interface (GUI) and the backend database, so that changing any one of the layers can be done without the need to change other layers. The top layer is the presentation layer, where the client machine is located. Data is presented by a thin client solution, using a web browser and the HTML standard file format. It is the GUI of the application. The parameters of the application are controlled by the client side using HTML forms. The user sets the parameters and then activates the process on the server side via the network. All the client sees is an abstract operation request which takes input and output parameters. Since web browsers are available for almost all platforms, using them as GUI eliminates the need for designing different application interfaces across different platforms, and also allows to adequately present the application to the user without too much coding effort. The middle layer is the application server, which implements the application logic to process data requests. An HTTP web server is running on the machine to receive HTTP request from clients, and send HTTP response back to clients. A servlet container and servlet API must be installed to allow the servlets to run. JDBC API and JDBC driver associated with the database should be installed to communicate with DBMS by SQL statements. The main control logic is encapsulated at the server side through Java servlets, which represent different modules of the application. Using modular design enables modifications and enhanced features to be added easily to the system to properly respond to specific user requirements. The backend layer is the Database Server, which uses a typical relational database that stores and manipulates the data at the backend. The connectivity to the database from the middle layer is through the JDBC drivers, this allows the application logic to be written with little dependency on the type of database used. The way the system works is as follows: The user fills in a HTML form and clicks the Submit button, which posts the request to a Java servlet. The servlet reads the input parameters and performs the business logic, and the same time uses JDBC to communicate with a database to obtain the content; the dynamic response is then generated and given back to the client for display, depending on the user inputs. B. Implementation A prototype of the web-based TOF was implemented on Sun machines, using the Solaris 2.6 operating system. A Sun Enterprise 450 machine is used in the middle tier as application server and web server, whereas a Sun Ultra 10 machine is used in the backend tier as database server. The client can be any machine which has a web browser installed and has the access to the Internet. The prototype was tested using a PC running Windows 2000 with both Internet Explorer and Netscape as a client. In the middle tier, Apache HTTP Server 1.2.6 was installed as the web server. JavaServerTM Web Development Kit (JSWDK) 1.0.1 is installed for the support of the Java servlet 4 Public class basecon extends HTTPServlet { ... Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out=response.getWriter( ); response.setContentType(“text/html”); ... //parse the parameters of HTML form and //save the uploaded file //encapsulate UWPFLOW to generate base //power flow using Java Runtime.exec( ) Public class atc extends HTTPServlet { ... Public void doPost(HttpServletRequest request, HttpServletResponse response} throws ServletException, IOException { PrintWriter out=response.getWriter( ); response.setContentType(“text/html”); ... //Database Interface: retrieve data from tables //use UWPFLOW to calculate loading margins //under normal condition and N-1 contingencies //Database Interface: update tables //Database Interface: update tables //generate response web page } //generate response web page } } } Fig. 3. Pseudocode of basecon servlet. Fig. 5. Pseudocode of atc servlet. Public class direction extends HTTPServlet { ... Public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out=response.getWriter( ); response.setContentType(“text/html”); ... //parse the parameters of HTML form and //save the uploaded file //Database Interface //update tables //generate response web page } } Fig. 4. Pseudocode of direction servlet. //loading driver try{ class.forName(“org.gjt.mm.mysql.Driver”); }catch(ClassNotFoundException e){ System.err.print(“ClassNotFoundException:”); System.err.println(e.getMessage( )); } try{ //making the connection Connection con=DriverManager.getConnection( Dburl, “login”, “password”); //creating JDBC statements Statement stmt=con.createStatement( ); //create or update database stmt.executeUpdate(“....”); //retrieve information from database ResultSet rs=stmt.executeQuery(“...”); //retrieve values from ResultSet while(rs.next( )){ float p=rs.getFloat(“Pg”); ... } }catch(SQLException e){ System.err.println(“SQLException:”+e.getMessage( )); } Fig. 6. Database interface. API. Java JDK-1.2.2 is installed as the Java runtime environment. An MM JDBC Driver (mm.mysql) is used to access MySQL relational database. MySQL resides on the backend tier. Three main modules, implemented as three servlets, run on the application server. These are: 1. basecon (Fig. 3): Receives base system conditions from the client and calculates the base power flow. 2. direction (Fig. 4): Receives load and generation increase patterns from the client. 3. atc (Fig. 5): Calculates the ATC value based on the loading margin computations for normal conditions and contingencies. UWPFLOW [17], a robust CPF program, is used as the computing engine for base power flow and loading margin calculations. It is treated as legacy software and was not changed, thus avoiding extra programming costs and errors; this way, the engine used for ATC calculation can be readily changed. This package is thus encapsulated in servlets basecon and atc, using Java Runtime.exec, as shown in Figs. 3 and 5. A database interface is included in each module to retrieve and update information from the database. Its main code is shown in Fig. 6. V. EXAMPLE The 3-area system shown in Fig. 7 is used here to illustrate the web-based TOF analysis prototype. Each area has its own generation and demand; transmission losses are not considered here; buses 2 and 3 are modeled as PQ buses. Market participants, who are assumed here to be represented by suppliers G1, G2 and G3, and buyers L2 and L3, send pricequantity bids to the market operator (see Fig. 8). If there is no demand–side bidding, i.e. no buying bids, the quantity of the load is then determined by load forecasting, which corresponds to the cases of inelastic load. 5 G1 150MW G2 L1 150MW+j80MVar V1=1.02 100MW L2 150MW+j70MVar 0 V2 80MVar X =0.12p.u. 12 X =0.12p.u. X =0.12p.u. 23 13 V3 100MW G3 50MVar L3 50MW+j30MW Fig. 7. A 3-area test system. Fig. 9. Part of the input GUI. Fig. 8. High-low bid matching with demand-side bidding. The TRM may be assumed differently for different systems using either a fix amount or a fix percentage of the maximum load. In this example, the TRM is assumed to be zero. Part of the input GUI is depicted in Fig. 9. There are 3 more input forms presented to the client to provide the server with all the required data. These are just quickly developed GUIs, with not much attention given to the presentation format. A. Case 1: Demand-side Bidding If the “standard” high-low method is employed for bid matching, which consists of matching the highest buying bids with the lowest selling offers, as shown in Fig. 8, then the potential transactions in this case are: G1 sells 150 MW, L2 buys 50 MW and L3 buys 100 MW, and the uniform market clearing price is 30 $/MWh. These potential transactions define the load and generation increase “direction” for the ATC computations. The loading margin results for normal conditions and for each possible contingency are shown in the GUI generated by the prototype, as depicted in Fig. 10. In this case, the outage of line 1-2 is the critical contingency, which yields an ATC value of 101.38 MW, and hence the transactions are not feasible. Fig. 10. Demand side bidding results. B. Inelastic Load Assuming that L2 and L3 are inelastic loads and determined by load forecasting to be 100 MW each, the resulting high-low bid matching is then shown in Fig. 11. The potential transactions are: G1 sells 150 MW and G3 sells 50 MW to satisfy the total load of 200MW, and the uniform market clearing price is 32 $/MWh. The loading margin results in this case are shown in Fig. 12, with the resulting ATC of 95.35 MW. Once more, the proposed transactions are not feasible, and hence need to be adjusted. VI. CONCLUSIONS A web-based TOF analysis prototype, based on a 3-tier client/server architecture and up to date web technologies, is proposed and discussed in detail in this paper. The underlying TOF analysis is based on adequate ATC calculation, which uses a CPF program as the computational engine. A 3-area system example is used to demonstrate the presented prototype. 6 [7] [8] [9] [10] [11] Fig. 11. High-low bid matching for inelastic load. [12] [13] [14] [15] [16] [17] T. Ueda, “Remote Power Flow Analysis,” Kitami Institute of Technology, Japan, 1999. Available: http://power.elec.kitamiit.ac.jp/~ueda/java/pf/ Y. S. Ong and H. B. Gooi, “A Web-based Power Flow Simulator for Power Engineering Education,” in Porc. IEEE-PES Summer Meeting, Seattle, vol. 2, pp. 1002-1007, 1999. Q. Zhao, G. Huang, X. Luo, and X. Wu, “A Software Architecture Style for Deregulated Power Markets,” in Proc. IEEE-PES Winter Meeting, Columbus, pp. 1497-1502, January 2001. B. Qiu and H. B. Gooi, “Web-based SCADA Display Systems (WSDS) for Access via Internet,” IEEE Trans. Power Systems, vol. 15, no. 2, pp. 681-686, May 2000. M. Marmiroli and H. Suzuki, “ Web-based Framework for Electricity Market,” in Proc. International Conference on Electric Utility Deregulation and Restructuring and Power Technologies, London, pp. 471-475, April 2000. C. A. Cañizares, H. Chen, and W. Rosehart, “Pricing System Security in Electricity Markets,” in Proc. Bulk Power Systems Dynamics and Control-V, August 2001, IREP, Onomichi, Japan. A. Berson, Client/Server Architecture, McGraw Hill Companies, Inc, 1996. “The Java Tutorial,” http://www.javasoft.com/docs/books/tutorial G. Seshadri, Enterprise Java Computing Applications and Architectures, Cambridge University Press. “Available Transfer Capability Definitions and Determination,” NERC, USA, 1996. C. A. Cañizares, “UWPFLOW,” University of Waterloo, November 2001. Available: http://www.power.uwaterloo.ca Hong Chen received her Bachelors (1992) and Masters (1995) degree in Electrical Engineering from Southeast University in China. She worked in NARI (Nanjing Automation Research Institute, P.R.China) from 1995 to 1998, and was engaged in developing EMS power application software. She is currently a Ph.D. candidate in the Department of Electrical & Computer Engineering at the University of Waterloo, pursuing research on electricity markets and computer applications in power systems. Fig. 12. Inelastic load results. The proposed web-based implementation of the TOF analysis can be easily and effectively used by market/system operators to determine feasible transactions, and also by market participants to make profitable market decisions. New functions, such as transaction security cost analysis to allow for transaction adjustment, will be added in the future using a similar modularized design. VII. REFERENCES [1] [2] [3] [4] [5] [6] J. Flory and T. Caramanis, “Electricity Transactions in an Open Access Market,” IEEE Power Engineering Review, vol. 16, no. 1, pp. 15-18, January 1996. D. T. Y. Cheng, “Economic Analysis of the Electricity Market in England and Wales,” IEEE Power Engineering Review, vol. 19, no. 4, pp. 57-59, April 1999. W. L. Chan, A. T. P. So, and L. L. Lai, “Internet Based Transmission Substation Monitoring,” IEEE Trans. Power Systems, vol. 14, no. 1, pp. 293-298, February 1999. I. Slutsker, K. Nodehi, S. Mokhtari, K. Burns, D. Szymanski, and P. Clapp, “Market Participants Gain Energy Trading Tools,” IEEE Computer Applications in Power, vol. 11, no. 2, pp. 47-52, April 1998. H. Chen, C. A. Cañizares, and A. Singh, “Web-based Computing for Power System Applications,” in Proc. North American Power Symposium (NAPS), pp. 302-306, October 1999. F. Shahzad and A. Z. Khan, “An Application of Java for Power System Stability,” IEEE Power Engineering Review, vol. 18, no. 4, pp. 45-46, April 1998. Claudio A. Cañizares (S’86, M’92, SM’00) received in April 1984 the Electrical Engineer Diploma from the Escuela Politécnica Nacional (EPN), Quito-Ecuador, where he held different teaching and administrative positions from 1983 to 1993. His MS (1988) and PhD (1991) degrees in Electrical Engineering are from the University of Wisconsin-Madison. Dr. Cañizares is currently an Associate Professor at the University of Waterloo, E&CE Department, and his research activities concentrate mostly in studying stability, modeling and computational issues in ac/dc/FACTS systems. Ajit Singh completed his B.Sc. degree in Electronics and Communication Engineering (1979) at BIT, India, and M.Sc. (1986) and Ph.D. (1991) degrees in Computing Science at University of Alberta, Canada. From 1980 to 1983, he worked at the R & D department of Operations Research Group, the representative company for Sperry Univac Computers in India. From 1990 to 1992, he was involved with the design of telecommunication systems at BellNorthern Research, Ottawa. He is currently an Associate Professor at Department of Electrical and Computer Engineering, University of Waterloo. Dr. Singh has published several research papers in the areas of software engineering, network computing, database systems, and artificial intelligence.