simulations.experiments.electrostatics
Class TwoChargesExperiment

java.lang.Object
  extended bysimulations.experiments.BaseExperiment
      extended bysimulations.experiments.electrostatics.TwoChargesExperiment

public class TwoChargesExperiment
extends BaseExperiment

Electro-quasi-statics exeriment with one moving charge and one stationary charge.

Version:
1.0
Author:
Michael Danziger

Nested Class Summary
private  class TwoChargesExperiment.Motion
          The equation of motion governing the evolution of the system
 
Field Summary
private  MovingPointCharge charge
          The first charge, which moves
private  PointCharge charge1
          The second charge, which does not move
private  EMCollection collection
          The sum of these two charges
private  TwoChargesExperiment.Motion equations
          The equation of motion for the system (just Coulomb repulsion)
private  RungeKuttaIntegration integrator
          The integrator used to evolve the system
private  double q
          The charge of the first charge, which moves
private  double q1
          The charge of the second charge
private  double t
          The time t
private  double v
          The speed of charge one along the z axis
private  double z
          The position of charge one along the z axis
private  double z1
          The position of the second charge along the z axis
 
Fields inherited from class simulations.experiments.BaseExperiment
eps, FieldMotionType, FieldType, FluidFlowSpeed, Fnorm, Fpower, numberSmallSteps
 
Constructor Summary
TwoChargesExperiment(double q, double m, double z0, double v0, double q1, double z1)
          Constructs the two charges with their initial positions
 
Method Summary
 void ConstructEMSource()
          Construct the EMColletion object which is the sum of the two charges
 void Evolve(double dt)
          Evolves the experiment by a time step "dt" using an RK4 integrator by taking numberSmallSteps between t and t + dt, for accuracy.
 void Evolve(double dt, double maxStep)
          Evolves the experiment a time step dt
 BaseObject getEMSource()
          Returns the BaseObject that is the collection of the two point charges
 double getFlowSpeed(Vec3 r, Vec RegionFlow)
          Method to find the flow speed in a given region when we are determining that speed according to region.
 double getHue(double TargetHue, Vec3 r, Vec RegionColor)
          Method to find the hue in a given region when we are coloring according to region (Color Mode 4).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

q

private double q
The charge of the first charge, which moves


z

private double z
The position of charge one along the z axis


v

private double v
The speed of charge one along the z axis


q1

private double q1
The charge of the second charge


z1

private double z1
The position of the second charge along the z axis


t

private double t
The time t


charge

private MovingPointCharge charge
The first charge, which moves


charge1

private PointCharge charge1
The second charge, which does not move


collection

private EMCollection collection
The sum of these two charges


equations

private TwoChargesExperiment.Motion equations
The equation of motion for the system (just Coulomb repulsion)


integrator

private RungeKuttaIntegration integrator
The integrator used to evolve the system

Constructor Detail

TwoChargesExperiment

public TwoChargesExperiment(double q,
                            double m,
                            double z0,
                            double v0,
                            double q1,
                            double z1)
Constructs the two charges with their initial positions

Parameters:
q - the charge of the first charge
m - the mass of the first charge
z0 - the position of the first charge along the z axis
v0 - the speed of the first charge along the z axis
q1 - the charge of the second stationary charge
z1 - the position of the second charge
Method Detail

ConstructEMSource

public void ConstructEMSource()
Construct the EMColletion object which is the sum of the two charges

Specified by:
ConstructEMSource in class BaseExperiment

getEMSource

public BaseObject getEMSource()
Returns the BaseObject that is the collection of the two point charges

Specified by:
getEMSource in class BaseExperiment

Evolve

public void Evolve(double dt,
                   double maxStep)
Evolves the experiment a time step dt


Evolve

public void Evolve(double dt)
Evolves the experiment by a time step "dt" using an RK4 integrator by taking numberSmallSteps between t and t + dt, for accuracy.

Specified by:
Evolve in class BaseExperiment

getHue

public double getHue(double TargetHue,
                     Vec3 r,
                     Vec RegionColor)
Method to find the hue in a given region when we are coloring according to region (Color Mode 4).

Specified by:
getHue in class BaseExperiment
Parameters:
TargetHue - This is the target hue from the renderer.
r - This is the vector postion of the point in the image.
RegionColor - This is the varous hues for the regions.
Returns:
The hue for the part of the image map at r.

getFlowSpeed

public double getFlowSpeed(Vec3 r,
                           Vec RegionFlow)
Method to find the flow speed in a given region when we are determining that speed according to region. This method is used when we have set experiment.FieldMotionType to one of either Constants.FIELD_MOTION_VREFIELD or Constants.FIELD_MOTION_VRBFIELD.

Specified by:
getFlowSpeed in class BaseExperiment
Parameters:
r - This is the vector postion of the point in the image.
RegionFlow - This is the flow speeds for the regions.
Returns:
The flow speed for the part of the image map at r.