simulations.experiments
Class BaseExperiment

java.lang.Object
  extended bysimulations.experiments.BaseExperiment
Direct Known Subclasses:
ChargeInFieldExperiment, CirculatingFlowExperiment, ColorTestExperiment, DataInputExperiment, EddyCurrentsDipoleExperiment, EddyCurrentsMonopoleExperiment, ElectricAntennaExperiment, FallingRingExperiment, HeliosphereFlowExperiment, MovingRecedingImagePotentialExperiment, MovingReceedingImageExperiment, OscillatingDipoleExperiment, RecedingImageExperiment, TeachSpinExperiment, TwoChargesExperiment, TwoPlanesExperiment

public abstract class BaseExperiment
extends java.lang.Object

This is the abstract parent class that all actual experiments should extend. When creating an experiment subclass, you must provide an implementation for the five functions declared here: ConstructEMSource(), getEMSource(), Evolve(), getHue(), and getFlowSpeed() The content of those functions can be whatever you want (and you can have additional functions or sub-classes, such as the Motion class used for calling RungeKuttaIntegration), but they must all be defined in some way. FieldType and FieldMotionType should also be set on a case by case basis, as the renderer uses these values to decide which type of field to draw and what type of motion field to evolve that field. If you end up with no image, or just "static", it may means that the DLIC is trying to draw the electric field of a magnetostatic experiment, or vice versa, and these two variables are the first thing to check.

Version:
1.0
Author:
Michael Danziger, John Belcher
See Also:
FallingRingExperiment.ConstructEMSource()

Field Summary
 double eps
          If the experiment uses a RungeKuttaIntegration scheme which calculates an internal fractional error estimate to evolve the Motion equations (not implemented at present in 1.0), then eps is the allowed fractional error for the step from t to t+dt for a requested time step dt.
 int FieldMotionType
          type of motion field for this experiment, where zero is NOT a valid field motion type.
 int FieldType
          type of field for this experiment, where zero is NOT a valid field type.
 double FluidFlowSpeed
          the overall speed multiplier if we are showing fluid flow, in pixels per second
 double Fnorm
          the normalization for the field if we are showing fluid flow
 double Fpower
          the power dependence on the magnitude of the field is we are showing fluid flow
 int numberSmallSteps
          The number of Runge Kutta steps taken to get from t to t + dt.
 
Constructor Summary
BaseExperiment()
           
 
Method Summary
abstract  void ConstructEMSource()
          constructs the EM source consisting of a number of BaseObjects and adds them to the EMCollection for this experiment
abstract  void Evolve(double dt)
          Evolves the properties of the collection of BaseObjects in the experiment with time
abstract  BaseObject getEMSource()
          returns the collecton of BaseObjects constructed in ConstructEMSource()
abstract  double getFlowSpeed(Vec3 r, Vec RegionFlow)
           
abstract  double getHue(double TargetHue, Vec3 r, Vec RegionColor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FieldType

public int FieldType
type of field for this experiment, where zero is NOT a valid field type. "FieldType" must be correctly set in the experiment that extends BaseExperiment.


FieldMotionType

public int FieldMotionType
type of motion field for this experiment, where zero is NOT a valid field motion type. "FieldMotionType" must be correctly set in the experiment that extends BaseExperiment.


Fnorm

public double Fnorm
the normalization for the field if we are showing fluid flow


FluidFlowSpeed

public double FluidFlowSpeed
the overall speed multiplier if we are showing fluid flow, in pixels per second


Fpower

public double Fpower
the power dependence on the magnitude of the field is we are showing fluid flow


numberSmallSteps

public int numberSmallSteps
The number of Runge Kutta steps taken to get from t to t + dt. If an experiment needs an integrator, most experiments use a simple RungeKuttaIntegration scheme to evolve the Motion equations, with no error estimate. Since it takes almost no time to integrate compared to the computationally demanding FLIC image processing, we routinely take many many small steps to go from t to t +dt as a way ensure accuracy. The parameter numberSmallSteps is the number of steps we take between t and t + dt, set to 5 for the default. NOTE THAT NOT ALL experiments need an integrator, since sometimes the evolution of the system is given by analytic expressions, and we do not need to integrate a system of ODEs to find the evolution.


eps

public double eps
If the experiment uses a RungeKuttaIntegration scheme which calculates an internal fractional error estimate to evolve the Motion equations (not implemented at present in 1.0), then eps is the allowed fractional error for the step from t to t+dt for a requested time step dt.

Constructor Detail

BaseExperiment

public BaseExperiment()
Method Detail

ConstructEMSource

public abstract void ConstructEMSource()
constructs the EM source consisting of a number of BaseObjects and adds them to the EMCollection for this experiment


getEMSource

public abstract BaseObject getEMSource()
returns the collecton of BaseObjects constructed in ConstructEMSource()


Evolve

public abstract void Evolve(double dt)
Evolves the properties of the collection of BaseObjects in the experiment with time


getHue

public abstract double getHue(double TargetHue,
                              Vec3 r,
                              Vec RegionColor)

getFlowSpeed

public abstract double getFlowSpeed(Vec3 r,
                                    Vec RegionFlow)