EJS CSM Textbook Chapter 1: Introduction to modeling Documents

Main Document

We introduce the Easy Java Simulations (EJS) edition of An Introduction to Computer Simulation Methods and discuss the importance of computers in physics and the nature of computer simulation. Various computer languages are considered and we show how the EJS modeling and authoring tool allows us to separate the model into logical parts and to separate the model from the view. Students learn the logic of computer modeling using loops and control structures as they study algorithms used in professional practice. Students are also introduced to object-oriented programming concepts by using object properties and methods when they create user interfaces. However, little user-interface coding is required because the user interface is created automatically by EJS.

Easy Java Simulations is built using the Open Source Physics code library and produces XML-based source code. The use of XML is important because it enables users to describe and store the model at a high level of abstraction, thereby leaving the Java implementation to EJS. A tutorial at the end of Chapter 1 describes this process.

Supplemental Documents

The ready-to-run Mass and Spring model shows the motion of a mass m situated at the end of a spring of length L and negligible mass. The motion is restricted to the horizontal dimension with a coordinate system in the plane with origin at the fixed end of the spring and with the X-axis along the direction of the spring.