Nuclear Power Plant Applet Description
Henrik Eriksson
Dept. of Computer and Information Science
Linköping University
S-581 83 Linköping, Sweden
Power Plant Model
This applet provides a (very rough) simulation of a nuclear power
plant. This power plant consists of three major components: the
reactor, turbine, and condenser. Furthermore, there
are three pumps, four valves, and one
turbine. The reactor boils the water and the steam generated
drives the turbine. After the turbine, the condenser cools the
steam. In turn, external cooling water cools the condenser. The
cooling pumps transport the water from the condenser tank back to the
reactor tank.
The simulator calculates values for reactor-tank pressure,
condenser-tank pressure, water levels, and so on, and displays them
graphically. When components fail, the simulator calculates and
displays the consequences for the running power-plant system. For
instance, if a cooling pump fails and the corresponding valve is not
closed, water may flow backwards from the reactor tank to the
condenser tank. This process will then drain the reactor tank and
expose the reactor core.
User Interaction
The user can start several simulation sequences where components of
the power plant fail. In Sequence 1, the turbine fails, and the state
of the power plant changes accordingly. In Sequences 2 and 3, cooling
water pump 1 fails, and the external-cooling water pump fails,
respectively. (You may have to resize the browser window to see the
external-cooling water pump, because it is located to the left of the
condenser.) The randomize button invokes a sequence where two random
components fail. For instance, the turbine may fail and then a few
seconds later a cooling pump may fail.
The simulator allows user interaction with certain components when a
simulation sequence is running. The user can open and close valves by
clicking on them, and can start and stop pumps by clicking on
them. Moreover, the user can change the position of the moderator rods
by dragging them with the mouse. The simulator disables user
interaction with components immediately after a sequence is completed.
Applet Description
The applet implementation consists of two major parts: (1) the
graphical user interface and (2) the power-plant
simulator. In the version of the applet you seen on the
demonstration WWW page, the simulator component is implemented in
Java-compatible and run together with the graphical-user interface in
your Java browser (e.g., HotJava and Netscape 2.0). Although this
Java-based simulator is now running locally in you browser, it can be
configured to communicate with a remote simulator server that
receives user input and transmits simulation output data to the
browser client (through a TCP/IP stream).
Learning Rule-Based Programming in CLIPS
This applet is designed primarily to teach students expert systems and
rule-based programming by adding safety rules to the power-plant
control system. The expert-system shell we are using to perform this
task is CLIPS. Because
simulator servers running remotely can be implemented in other
languages than Java, students can implement (or modify existing)
simulators in CLIPS. (In our
approach, we use Java-to-Java communication over the TCP/IP stream and,
we integrate Java and CLIPS through the C-based API on the server side.)
For instance, it is possible to develop a relatively small rule base
that will take appropriate actions automatically when components
fail. This safety knowledge base can then be tested against random
sequences, to ensure that the rules work properly.
Our goal is to use this applet as a tool in teaching students basic
knowledge-engineering skills, such as rule-based
programming. Currently, we are working on a document that defines the
student assignment, and provides the information required to complete
the exercise. We shall fine-tune the applet and the program skeleton
to work with the documentation during the fall of 1995. The
expert-system course starts in January 1996, and we expect to have the
course material ready by then. The current version of the CLIPS program
skeleton is available here.
Applet Documentation and Source Code
Class documentation (generated by javadoc) and Java source
code are available.
- Class documentation
- Source code - main simulator, contains several class definitions
- Other interesting source code: Remote simulation and CLIPS (not part of this version of the applet)
Bugs
The graphics could be cooler. In the 1.0Alpha3 version, the sequence
control buttons are sometimes not redrawn correctly when the user
scrolls the page in HotJava. The applet was developed using the
Solaris version of HotJava. It works with the Windows 95/NT version
(1.0Alpha3 or later), but there are still some rough edges on the
Windows platform, such as font-geometry, color, and crash problems.
Historical Background and Acknowledgments
The approach of
power-plant simulation (in this context) was originally a laboratory
assignment to teach computer-science students at Linköping University
rule-based programming. In 1986, Anders Nyberg and Mikael Svensson
developed the original version in the expert-system shell Epitool
running on Xerox D-machines. The Epitool code handled the simulation,
and the Interlisp-D code displayed the simulation graphically. A few years
later, the D-machines became obsolete, and where replaced by Medley
running on Sun SPARCstations. Because, Epitool was no longer available for
the Medley platform, the laboratory assignment had to be removed from
the expert-system course.
For several years, we were frustrated we could not run the power-plant
simulator. In early 1995, it was time to revise the assignments for
the expert-system course. We needed a new and cool assignment to teach
students rule-based programming in CLIPS. Since Java
and HotJava was available, we decided to resurrect the power-plant
simulation, and to use Java as the user-interface front end to CLIPS. During
summer 1995, Henrik Eriksson implemented a new user interface in Java
and translated the old Epitool simulator code to CLIPS. The first
part of this implementation process was to create a stand-alone (i.e.,
complete) simulator in Java to test the Java user interface. Eva
L. Ragnemalm rewrote the assignment documentation for the new
power-plant simulator.
Copyright © 1995 Linköping
University, Linköping, Sweden.
Maintained by Henrik Eriksson <her@ida.liu.se>