Professional Documents
Culture Documents
Francisco Esquembre
Universidad de Murcia. Spain
Abstract. We introduce in this paper Easy Java Simulations, a tool that we have
created to help Physics teachers and students create their own interactive simulations
of physical phenomena. The tool honors its name in that it tries to turn this process
into an easy task, providing specialized editors and ready-to-use graphics
components that help the user complete the high-level tasks of describing the model
of the phenomenon under study and the design of the interface of the simulation. The
tool is based in Java and automatically creates all that is needed to publish the
generated simulation on the Internet.
On the one hand, computers can help us create learning environments that extend the
possibilities of traditional teaching tools (blackboard, books, laboratories,…). But, on
the other, they also offer brand-new possibilities, not accessible before: [1]
• Develop their understanding about the phenomena and physical laws through a
process of hypothesis-making and idea-testing.
• Isolate and manipulate parameters and therefore help students to develop an
understanding of the relationships between physical concepts, variables and
phenomena.
• Employ a variety of representations (images, animations, graphs, numerical
data) that are helpful in understanding the underlying concepts, relations and
processes.
• Investigate phenomena that would not be possible to experience in a classroom
or laboratory.
Simulations help us reach a deeper level of conceptual learning, which usually also
helps uncover students difficulties of a more subtle nature.
1
Using computer simulations can be very useful for the teacher if (and only if) he or she
uses them in a pedagogically sound way. In this context, we like to cite the following
list of recommended behaviors (extracted from [5], which list them in a more general
setting) considered best-practices to facilitate learning through engaging students in
explorations that reflect real science:
2
a) The classical resistance to change, which, as to any other human, also affects to
Science teachers.
b) Simple ignorance of the results of Physics Education Research.
c) A particular resistance of science educators and researchers to accept solutions
coming from other people.
d) A certain reluctancy to use a technology they, the teachers, don’t fully
understand or control.
e) The fact that existing simulations don’t quite fill the needs of the teacher or of
his or her students.
Since there is a great potential of creative teachers that can contribute to make the use of
computers in our classrooms more ubiquitous, all of the reasons above compel us to
think that a new set of tools is required. Tools that are open, reconfigurable, and multi-
purposed. Tools that will: [4]
With the objective to address this need, we introduce Easy Java Simulations.
The user needs to provide his/her knowledge of the scientific process and decide on
what type of graphical interface is required for the desired pedagogical goal, and the
computer helps (and it helps a lot!) by taking care of all the computer-specific tasks.
This helps the science teacher or student concentrate on Science, not on the computer.
As Figure 1 shows, Ejs has a very simple user interface (the simplicity of it was actually
a design principle), and structures the simulation into Model and View, to which it adds
a first introductory part. Each part has a dedicated editor that helps the user build it.
3
Figure 1. Interface of Easy Java Simulations
The Introduction
For the introduction of the simulation, the textual part that introduces what the
simulation does and how to interoperate with it, the tool provides a WYSIWYG editor
of HTML pages for the simulation. Each of the introduction pages created with this
editor will turn into a real HTML page when the simulation is generated. This set of
pages will be completed with another HTML page that will contain the simulation itself
in form of Java applet.
4
The Model
The interface for the model provides up to five dedicated editors. Obviously, this part of
the simulation is where the user needs to contribute more. However, the tool provides a
simple left-to-right procedure where the user needs to complete a short sequence of
descriptions of the model which the system uses to generate the final computer model.
This sequence includes defining the variables of the model, initializing these variables,
specifying how they evolve in time, making explicit internal relationships between the
variables (which we call constraints) and creating (if necessary) custom functions or
routines that will be used in other parts of the model. Each of these task is assisted by a
dedicated editor that simplifies the process as much as possible.
Figure 3 shows the editor for the declaration of variables of a given simulation. It takes
the form of a table of variables where the user specifies the name, type, and initial value
for the variables.
Some models completely initialize their variables using this table. Others may require
additional computations to completely determine the initial state of the system. In these
cases, the user needs to write additional pages of Java code in the editor provided for
the initialization of the model, displayed in Figure 4.
Yes, this means that the user needs to learn to specify his or her algorithms in terms of
expressions and sentences of Java language. This is not exactly learning to program in
Java, it is actually much simpler than this. Our experience is that even teachers without
much programming experience can reach this level after a few introductory sessions.
The editors for the constraints and custom parts of the model are very similar to the
editor for the initialization and we will not display them here.
5
Figure 4. The code editor for e initialization of the model
Of particular interest is the editor for the evolution of the model. This actually takes
two forms. The first one is, again, a plain code editor for the situations in which the user
needs or wants to provide directly the algorithms that describe the model. A second,
much more advanced, editor is provided for the cases in which the evolution of the
model can be specified by means of a system of ordinary differential equations (ODE).
This editor is displayed in Figure 5.
The equation displayed in Figure 5 corresponds to free-fall motion and illustrates how
easy and natural it is to write a differential equation using this editor. After typing the
equation, the editor will automatically generate (when required) all the Java code
needed to numerically solve the equation using one of the most popular algorithms for
solving ODE, such as the Mid-Point, Runge-Kutta or Adaptive Runge-Kutta algorithms.
6
But this editor offers much more, since it is able to edit and solve equations where the
term differentiated is a one-dimensional array (or vector, as we would call them), and
can also handle state events. A state event is a situation where the system is asked to
automatically detect that a given expression of the state variables reaches a certain value
and then apply a correcting action. In the example displayed in Figure 6, the free-fall
equations of motion are completed with a state event that detects when the falling object
reaches the ground and applies the effect of an inelastic rebound.
The View
Creating the graphical interface (or view) of a simulation is usually the most technical
part of the process. One that can require previous expertise in computer graphics and
also intensive use of the set of graphic libraries provided by the computer language.
7
Figure 8. Graphical user interface corresponding to the tree of Figure 7
Thus, the user is only required to design how the visualization will take place and what
interfacing mechanisms he or she wants to supply the student with. Once this is decided,
the user selects and adds the required view elements from the set offered in a simple
click-and-create procedure. (Of course, the user needs some training in order to get
acquainted with the different types of view elements offered and what each of the types
can do.)
The behavior of the view elements is greatly determined by their type. However,
elements can be customized editing their so-called properties. Properties are internal
values that specify how the element looks and behaves. Properties can be set to constant
values but, more interestingly, they can also be associated to model variables.
This way, as the model evolves, the visualization changes dynamically according to the
association between model variables and properties of view elements. And viceversa, if
the user interacts with any view element changing any of its properties, the model
variable associated to this property will also be affected. This creates a two-way
communication mechanism between model and view that turns the simulation into a
real dynamic, interactive visualization.
This ensures easy distribution of the generated application and is where Java shows to
be most useful. The final user, most likely a student, has three ways of using the
simulation. He or she can run it as an application distributed on a CD, download it from
a Web server embedded in HTML pages, or (recommended) use Ejs itself to run the
simulation, but also to inspect it, thus learning from the code created by his or her
instructor, which adds a new level of instruction of evident pedagogical interest.
Conclusion
Easy Java Simulation is a software tool specifically designed to help teachers and
students with not much knowledge of programming create their own simulations. This
makes the use of simulations a more interesting and user-friendly technology for the
educational process because:
8
• Teachers feel they control the lecture because they understand what the
computer is doing.
• Students are motivated because of the pleasure of the creation process.
• Students are motivated by the possibility to publish their work (serious work) on
the internet.
Ejs is certainly a tool that helps students play a more creative role in front of a computer
and can therefore be used to create learning environments that use the recommended
best practices cited above.
The software and its documentation can be downloaded for free from the Web server at
http://fem.um.es/Ejs. Examples of simulations created with Easy Java Simulations can
also be found in this server.
Acknowledgements
We would like to thank the organizers of the MPTL meeting held in Graz in the summer
of 2004 for their kind invitation to give a plenary lecture and for the wonderful
organization of the meeting.
Easy Java Simulations is part of the Open Source Physics project (see
http://www.opensourcephysics.org).
References
[1] Brandsford et al. “How People Learn”. National Academy Press (2000)
[2] Jimoyiannis, Komis. “Computer simulations in physics teaching and learning”.
Comp. Educ. 36 (2001)
[3] Lederman. “American Renaissance in Science Education”. FERMILAB-TM-
2051 (1998)
[4] Di Sessa, “Changing minds”. MIT Press (2000)