Interactive Science Simulation Documentation

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 24

INTERACTIVE SCIENCE SIMULATION USING JAVA

A Mid-term Project Report Submitted in partial fulfillment of the requirements for the Degree of Bachelor of Engineering Under Berhampur University

by

Suraj Behera Subhashree Dash

Roll # CSE200710261 Roll # CSE200750210

November - 2010 Under the guidance of

Mr. Debanand Kanhar

INTERACTIVE SCIENCE SIMULATION USING JAVA

NATIONAL INSTITUTE OF SCIENCE & TECHNOLOGY Palur Hills, Berhampur, Orissa - 761 008, India

INTERACTIVE SCIENCE SIMULATION USING JAVA

ABSTRACT
The project titled Interactive Science Simulation using Java provides an in-depth description about simulation web-based application. The whole project revolves around the extensive application of simulation in the field of scientific study. In computer science, simulation has some specialized meanings: Alan Turing used the term "simulation" to refer to what happens when a universal machine that executes a state transition table (in modern terminology, a computer runs a program) that describes the state transitions, inputs and outputs of a subject discrete-state machine. In general we can say that, with the help of computers we can design and code such programs that simulate the real-world phenomena in a virtual environment. Simulation helps us in understanding the concepts. It involves creating a virtual environment for the process and helps us realize the entire procedure imitating the real conditions. Simulation not only shows the effect but also checks the understanding of the concept through a similar kind of questions on the concept. It can be applied in the field of education and training ushering a new era of teaching methodology.

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

ACKNOWLEDGEMENT
We express our deep sense of gratitude to Mr. Debanand Kanhar, Advisor cum B.Tech. Project Coordinator for his valuable guidance and constant unfailing encouragement for completing this project report. We thank our examiners and for their suggestions and guidelines to make some improvements in the project. Finally we thank Mr. Sangram Mudali, for his continued drive for better quality in everything that happens at NIST. This report is a small contribution towards the greater goal.

Suraj Behera Subhashree Dash

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

TABLE OF CONTENTS

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

LIST OF FIGURES

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

1. INTRODUCTION

A computer simulation (or "sim") is an attempt to model a real-life or hypothetical situation on a computer so that it can be studied to see how the system works. By changing variables, predictions may be made about the behavior of the system. Computer simulation has become a useful part of modeling many natural systems in physics, chemistry and biology, and human systems in economics and social science (the computational sociology) as well as in engineering to gain insight into the operation of those systems. A good example of the usefulness of using computers to simulate can be found in the field of network traffic simulation. In such simulations, the model behavior will change each simulation according to the set of initial parameters assumed for the environment. Traditionally, the formal modeling of systems has been via a mathematical model, which attempts to find analytical solutions enabling the prediction of the behavior of the system from a set of parameters and initial conditions. In computer science, simulation has some specialized meanings: Alan Turing used the term "simulation" to refer to what happens when a universal machine executes a state transition table (in modern terminology, a computer runs a program) that describes the state transitions, inputs and outputs of a subject discrete-state machine. The computer simulates the subject machine. Accordingly, in theoretical computer science the term simulation is a relation between state transition systems, useful in the study of operational semantics.

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

Interactive Simulator for Science

The simulation project that is designed is an interactive one, in which the users can change the environment variables effecting changes in the process. With the help of the virtual reality enabled with the help of simulation we can control all the environment variables related to the particular phenomenon and change the variables as we wish to study the effects on the present condition. The various phenomena those are going to be simulated are Wave functions, transverse and longitudinal waves, Dopplers effect, Alpha decay, Nuclear fission, Projectile motion, Ohms law, Faradays law of electromagnetism etc. This project can be actively used by educational institutions for example to help students a better control to grasp and make connections between real-life phenomena and the underlying science, deepening their understanding and appreciation of the physical world. The students using this simulation can actually vary and control various controlling environment variables and see the consequent changes to deepening their grasp on the concepts involved.

1.2. Technologies to be used


JAVA (J2SE): Java Platform, Standard Edition or Java SE is a widely used platform for programming in the Java language. It is the Java Platform used to deploy portable applications for general use. In practical terms, Java SE consists of a virtual machine, which must be used to run Java programs, together with a set of libraries (or "packages") needed to allow the use of file systems, networks, graphical interfaces, and so on, from within those programs. Applet: In computing, an applet is any small application that performs one specific task, sometimes running within the context of a larger program, perhaps as a plug-in. However, the term typically also refers to Java applets, i.e., programs written in the Java programming language that are included in a web page.
0

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

1.3. User Characteristics:

The User is expected to be Internet as well as application literate. The main screen of the applet contains the links to the other modules and containers associated with the various scientific phenomena. The User is expected to be Windows literate and to be able to use button, pull-down menus, and similar tools.

1.4. Constraints:

Attribute Software Hardware Network

Detail and Boundary Constraint Windows XP and above, IE 6.0 and above, Java 2 Platform Standard Edition(J2SE) JDK 5.0 later P-IV, 512 MB RAM, 40 GB HDD Client-Server, Internet

1.5. Overview of Document

The next section, the Functional Description section, of this document gives an overview of the functionality of the product and various aspects of the modules in it. It describes the functional requirements and is used to establish a context for the technical specification.

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

2. FUNCTIONAL DESCRIPTION
2.1. Dopplers Effect Simulation:
The Doppler effect (or Doppler shift), named after Austrian physicist Christian Doppler who proposed it in 1842, is the change in frequency of a wave for an observer moving relative to the source of the wave. It is commonly heard when a vehicle sounding a siren or horn approaches, passes, and recedes from an observer. The received frequency is higher (compared to the emitted frequency) during the approach, it is identical at the instant of passing by, and it is lower during the recession. For waves that propagate in a medium, such as sound waves, the velocity of the observer and of the source is relative to the medium in which the waves are transmitted. The total Doppler Effect may therefore result from motion of the source, motion of the observer, or motion of the medium. In classical physics, where the speeds of source and the receiver relative to the medium are lower than the velocity of waves in the medium, the relationship between observed frequency f and emitted frequency f0 is given by:

Where Is the velocity of waves in the medium Is the velocity of the receiver relative to the medium; positive if the receiver is moving towards the source. Is the velocity of the source relative to the medium; positive if the source is moving away from the receiver. The frequency is decreased if either is moving away from the other.

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

2.1.1. Software Interface:

Figure 1: Dopplers Effect simulator

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

2.1.2. Use Case Diagram:

Figure 2: Dopplers Effect Use Case Dig.

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

2.1.3. Use Case Reports: Use Case #1 DOPPLER_EFFECT

Module #/Name Actors Purpose Overview Type

Interactive Science Simulator. Users. This module simulates the Dopplers Effect with all its simulation controlling parameters. User should set the respective parameters to simulate. Primary.

Typical Course of Action Scenario #1.1(normal) START Use Case #1DOPPLER_EFFECT Actor Action Click on the Start button System Response The simulator will simulate the Object moving at the set speed and the effect on Sound Waves. Alternate course of action: If the speed characteristics are not set then there will be no simulation .

Scenario #1.2(normal)

STOP Use Case #1DOPPLER_EFFECT

Actor Action Click on the Stop button

The

System Response simulator will stop

any

currently running simulation.

Scenario #1.3(normal)

STEP FORWARD Use Case #1DOPPLER_EFFECT ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

1 3

Actor Action The user clicks on the Step foreword button. Click on the Start button

2 4

System Response The mic moves closer towards the moving object. The simulator will simulate

resulting sound waves. Alternate course of action: If the moving objects initial speed is not set then there will be no simulation.

Scenario #1.4(normal)

STEP BACK Use Case #1DOPPLER_EFFECT

1 3

Actor Action The user clicks on the Step back button. Click on the Start button

2 4

System Response It moves the mic away from the moving objects initial position. The simulator will simulate the resulting simulation.

Alternate course of action: If the moving objects initial speed is not set then there will be no simulation.

Scenario #1.5(normal)

RESUME Use Case #1DOPPLER_EFFECT

Actor Action The user clicks the Resume button. ii

System Response The simulator will resume with the

INTERACTIVE SCIENCE SIMULATION USING JAVA

pending simulation.

Scenario #1.6(normal)

DRAG SCROLL BAR Use Case #1DOPPLER_EFFECT

1 2

Actor Action The user drags the scroll bar to a position. Click on the Start button 3

System Response

The simulator will simulate waves at the set speed in the scroll bar.

2.2. Wave Functions Simulation:


The mathematical concept of a function expresses the intuitive idea that one quantity (the argument of the function, also known as the input) completely determines another quantity (the value, or the output). A function assigns exactly one value to each input ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

of a specified type. The argument and the value may be real numbers, but they can also be elements from any given sets: the domain and the co-domain of the function. An example of a function with the real numbers as both its domain and co-domain is the function f(x) = 2x, which assigns to every real number the real number with twice its value. In this case, it is written that f(5) = 10. In mathematics, the sine function is a function of an angle. In a right triangle, sine gives the ratio of the length of the side opposite an angle to the length of the hypotenuse. Sine is usually listed first amongst the trigonometric functions. The sine function is commonly used to model periodic function phenomena such as sound and light waves, the position and velocity of harmonic oscillators, sunlight intensity and day length, and average temperature variations through the year.

2.2.1. Software interface:

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

Figure 3:Wave Function Simulator


2.2.2. Use Case Diagram:

Figure 4:Wave Function Use Case Diag.

2.2.3. Use Case Reports: Use Case #2 WAVE FUNCTIONS

Module #/Name

Interactive Science Simulator. ii

INTERACTIVE SCIENCE SIMULATION USING JAVA Actors Users. Purpose This module simulates Overview Type

the various wave functions from

mathematical model. User should set the respective parameters to simulate. Primary.

Typical Course of Action Scenario #2.1(normal) START Use Case #2WAVE FUNCTIONS Actor Action The user starts the applet. System Response The simulator will simulate the Sine wave with default frequency parameters. Alternate course of action: If frequency is not set on the slider there will be no simulation.

Scenario #2.2(normal)

MOVE SLIDER Use Case #2WAVE FUNCTIONS

Actor Action The user moves the slider position.

System Response The simulator will simulate the Sine wave with the changed frequency parameters.

2.3. Architecture Design:

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

Figure 5 - System Environment

2.3. Class Diagrams:


2.3.1. Dopplers Effect class diagram:

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

Figure 6:Dopplers Effect Class Diag.

2.3.2. Wave Function class diagram:

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

Figure 7: Wave Function Class Diag.

3. FUTURE WORK

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

The entire simulation web-application package consists of the several modules simulating various general, physical and chemical phenomena. They include as transverse and longitudinal waves, Dopplers effect, Alpha decay, Nuclear fission, Projectile motion, Ohms law, Faradays law of electromagnetism etc. All this modules have their individual simulation applets extending the simulation functionalities. To incorporate all this into one single package a central module will be develop which will provide the user with access to all the simulations in the whole application at once. The user will be able to run any applet simulation as per the requirement from the main module. The application is to be designed so as to be ready to be hosted on a web-server. In order to be able to do that the applets combined into a single module have to be server ready for instant hosting.

4. GLOSSARY
Term ii Definition

INTERACTIVE SCIENCE SIMULATION USING JAVA

Applet

An applet is any small application that performs one specific task, sometimes running within the context of a larger program. Application or an app, is computer software designed to help the user to perform singular or multiple related specific tasks. Semantics typically focuses on the relation between signifiers, such as words, phrases, signs and symbols, and what they stand for, their denotata. A document that completely describes all of the functions of a proposed system and the constraints under which it must operate. For example, this document. The end-person who will use the application. A use case in software engineering and systems engineering is a description of a systems behaviour as it responds to a request that originates from outside of that system

Application

Semantics

Software Requirements Specification User

Use Case

REFERENCES
[1] Pilone, Dan and Pitman, Neil: UML in a Nutshell: OReilly Media Publications: June 2004.a

ii

INTERACTIVE SCIENCE SIMULATION USING JAVA

[2] [3]

Geary David M. : Java 2: Mastering the JFC : Swing, Volume 2 (Sun Microsystems Press Java Series), 3rd Edition , 1999. Verma H.C : Concepts of Physics: Part I, Part II: Bharti Bhawan Pulications,2007.

ii

You might also like