Home : Map : Chapter 9 : Java : Tech : Physics :
Experiment Analysis
Course Map
Chapter 9

Console I/O
  Text Output 
     Demo 1

     Demo 2

  Tex 2t Input
     Demo 3

Demo 4
File Class
  File I/O
  File Output-Text
     Demo 5

  Formatter to File
     Demo 6

  File Input - Text
    Demo 7

  Scanner - Files
     Demo 8

  File I/O - Binary
     Demo 9
   Demo 10
File Chooser Dialog
  Demo 11

Character Codes
  Demo 12
Object I/O
Types to Bytes
Stream Filters
Other I/O Topics

     About JavaTech
     Codes List
     Topic Index
     Course Guide
     What's New

The typical development of an analysis system for an experiment goes as follows:

  1. A simulation is created and it is checked thoroughly to insure that it is performing correctly.

  2. The simulation is used to decide on the best way to design the real experiment.

  3. The experimental data is compared to that from the simulation to look for inconsistencies that could indicate problems either in the experiment or in the simulation.

  4. A simulation may need to provide correction factors to the data, such as corrections for acceptance losses due to dead spots in a detector.

  5. The simulation can help to estimate systematic errors.

Statistical errors are proportional to the amount of data taken and are usually determined in a straight-forward manner. Systematic errors, on the other hand, are less clear cut and can be difficult to determine in a rigorous manner. A simulation can help by showing, for example, the effects on the results due to faulty performance of the instruments, mis-calibrations, different assumptions about the performance of the instruments, etc. For example, suppose by mistake one of the the sensors in our gravitational acceleration experiment was far from its expected position due to faulty installation. We can vary this in our simulation to see what effect it has on the final results.

The Analysis Program

Ideally, the analysis program should treat simulated and experimental data identically. This helps to find errors in the analysis code, prevent inconsistensies in treatment of simulated and real data, and it can also highlight problems with the analysis. For example, the analysis of simulated data of particle collisions in an accelerator experiment should return the same cross section used to produce the simulated data originally.

Typically, the simulation would produce an output data file very similar to that from the actual experiment. It might even simulate "raw" data before any calibration corrections. For example, values from an ADC (Analog to Digital Converter) typically requred subtraction of pedestals (constant offsets) and slope corrections in the input voltage to digital values. The simulated raw data could include similar pedestals and slope variances.

In the dropped mass experiment program, the analysis consisted of the histogram and a method to calculate the acceleration. We can make this more modular by creating an analysis class to which collected data is passed. The analysis code can then be modified independently of the simulation code and could also work on the real data.

In the following simulation we will use the least squares fitting classes developed in Chapter 8: Physics to create our analysis code. We could have written the simulation data to a file and then run the analysis separately. But for convenience here we will keep combine the simulation and analysis in the same applet/app.

Last update: Jan.28.04

Histogram I/O
Hist I/O - Get/Set
  Demo 1
Hist I/O - Objects
  Demo 2
  Demo 3
Filtering Data
  Demo 4

Physics Model
Simulation Design
Physics Simulator
  Demo 1
Experiment Design
Experiment Sim.
  Demo 2
Expt. + Analysis
  Demo 3

  Part I Part II Part III
Java Core 1  2  3  4  5  6  7  8  9  10  11  12 13 14 15 16 17
18 19 20
22 23 24

1  2  3  4  5  6  7  8  9  10  11  12

Tech 1  2  3  4  5  6  7  8  9  10  11  12
Physics 1  2  3  4  5  6  7  8  9  10  11  12

Java is a trademark of Sun Microsystems, Inc.