simulations.experiments.radiation
Class OscillatingDipoleExperiment

java.lang.Object
  extended bysimulations.experiments.BaseExperiment
      extended bysimulations.experiments.radiation.OscillatingDipoleExperiment

public class OscillatingDipoleExperiment
extends BaseExperiment

Fields of an oscillating electric dipole. This class computes the evolution of the experiment in which a electric dipole is oscillating, creating waves that flow out from the dipole at the speed of light. We include near zone, intermediate zone, and far zone terms in the expressions for the electric field.

Version:
1.0
Author:
Andreas Sundquist

Field Summary
private  ElectricOscillatingDipole dipole
           
private  double omega
          The angular frequency of the oscillating dipole
private  double p0
          The constant part of the dipole moment of the oscillating dipole
private  double p1
          The sinusoidal part of the dipole moment of the oscillating dipole
private  double phase
          The phase shift in the sinusoidal time depedence of the oscillating dipole
 
Fields inherited from class simulations.experiments.BaseExperiment
eps, FieldMotionType, FieldType, FluidFlowSpeed, Fnorm, Fpower, numberSmallSteps
 
Constructor Summary
OscillatingDipoleExperiment(double p0, double p1, double omega, double phase)
          Constructs an instance of the experiment where the dipole has a constant moment "p0" added to an oscillation of amplitude "p1" at a frequency "omega".
 
Method Summary
 void ConstructEMSource()
          Creates the EMSource that represents the experiment and can be used to compute the E&M fields
 void Evolve(double dt)
          Evolves the experiment by a time step "dt".
 BaseObject getEMSource()
          Returns: an EMSource that represents the current experimental state.
 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

p0

private double p0
The constant part of the dipole moment of the oscillating dipole


p1

private double p1
The sinusoidal part of the dipole moment of the oscillating dipole


omega

private double omega
The angular frequency of the oscillating dipole


phase

private double phase
The phase shift in the sinusoidal time depedence of the oscillating dipole


dipole

private ElectricOscillatingDipole dipole
Constructor Detail

OscillatingDipoleExperiment

public OscillatingDipoleExperiment(double p0,
                                   double p1,
                                   double omega,
                                   double phase)
Constructs an instance of the experiment where the dipole has a constant moment "p0" added to an oscillation of amplitude "p1" at a frequency "omega".

Method Detail

ConstructEMSource

public void ConstructEMSource()
Creates the EMSource that represents the experiment and can be used to compute the E&M fields

Specified by:
ConstructEMSource in class BaseExperiment

getEMSource

public BaseObject getEMSource()
Returns: an EMSource that represents the current experimental state. It can be used to compute the E&M fields. The dipole is centered at the origin, and its direction is along the z-axis.

Specified by:
getEMSource in class BaseExperiment

Evolve

public void Evolve(double dt)
Evolves the experiment by a time step "dt".

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.