net.jimmc.spelsim
Class Cable

java.lang.Object
  extended by net.jimmc.spelsim.Cable

public class Cable
extends java.lang.Object

The cable and attached masses.


Field Summary
protected static double FWD_CIRCLE_FRACTION
           
 
Constructor Summary
Cable()
          Create a cable.
 
Method Summary
protected  void calculateAccelerations(int whichDyn, double simOffset, double cwDerating, double groundDrag)
          Calculate the acceleration on each element.
protected  void calculatePositions(double simInterval, int fromDyn, int toDyn, int whichAccel, double dampingFactor)
          Caculate the new position of each element.
protected  void calculateStresses(int whichDyn, double simOffset)
          Calcuate the stress on each element.
 void draw(java.awt.Graphics2D g, double scale)
          Draw the cable.
 void dumpSelectedElements(double time, int algorithm)
          For debugging, dump the first and last cable elements.
 DVector[] getAccelerationDrifts()
          Get the acceleration drift vectors for all elements.
 DVector[] getAccelerations()
          Get the acceleration vectors for all elements.
 double getBaseArea()
          Get the base area of the cable.
 java.awt.geom.Rectangle2D getBoundingBox()
          Get the bounding box containing all of the cable elements.
 double getBoundingRadius()
          Get the maximum radius value for all cable elements.
 boolean[] getBroken()
          Get the broken flag for all elements.
static Cable getCable(java.lang.String name)
          Get a cable with preset values.
static java.lang.String[] getCableNames()
          Get the list of known cable names.
 double getCapacity()
          Get the capacity of the cable.
 double getCenterOfCentrifugalAltitude()
          Get the altitude of the center of centrifugal of the cable.
 double getCenterOfGravityAltitude()
          Get the altitude of the center of gravity of the cable.
 double getCenterOfMassAltitude()
          Get the altitude of the center of mass of the cable.
 double getCounterweightMass()
          Get the mass of the counterweight.
 net.jimmc.spelsim.CableElement[] getElements()
          Get the current list of elements.
 DVector[] getIdealAccelerations()
          Get the ideal acceleration vectors for all elements.
 DVector[] getIdealPositions()
          Get the ideal position vectors for all elements.
 DVector[] getIdealVelocities()
          Get the ideal velocity vectors for all elements.
 double getLength()
          Get the length of the cable.
 double getMass()
          Get the total mass of the cable.
 Material getMaterial()
          Get the material of the cable.
 net.jimmc.spelsim.CableElement[] getMaxPositionDrifts(int count)
          Get the elements with the largest amount of position drift.
 int getNumBrokenElements()
           
 int getNumElements()
          Get the number of elements used for the cable calculations and simulation.
 int getNumGroundedElements()
           
 Planet getPlanet()
          Get the planet aound which the cable orbits.
 DVector[] getPositionDrifts()
          Get the position drift vectors for all elements.
 DVector[] getPositions()
          Get the position vectors for all elements.
 double getSafetyFactor()
          Get the safety factor of the cable.
 double[] getStresses()
          Get the stresses for all elements.
 double getTaper()
          Get the cable taper factor.
 DVector[] getVelocities()
          Get the velocity vectors for all elements.
 DVector[] getVelocityDrifts()
          Get the velocity drift vectors for all elements.
 boolean isDebugOutputEnabled()
           
 void printMaxPositionDrifts(int count)
          Print the maximum drift values.
 void recalculateElements()
          Recalculate the elements.
protected  void resetSimulation()
          Reset the simulation of our cable.
 void setCapacity(double capacity)
          Set the capacity of the cable.
 void setDebugOutputEnabled(boolean enabled)
           
 void setElementBroken(int elementNumber)
           
 void setLength(double length)
          Set the length of the cable.
 void setMaterial(Material material)
          Set the material of the cable.
 void setNumElements(int numElements)
          Set the number of elements in the cable calculations.
 void setPlanet(Planet planet)
          Set the planet around which the cable orbits.
 void setSafetyFactor(double safetyFactor)
          Set the safety factor of the cable.
protected  void simulateOneStep(double simInterval, int algorithm, double dampingFactor, double cwDerating, double groundDrag)
          Simulate the motion of our cable in the indicated amount of time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FWD_CIRCLE_FRACTION

protected static final double FWD_CIRCLE_FRACTION
See Also:
Constant Field Values
Constructor Detail

Cable

public Cable()
Create a cable.

Method Detail

getCable

public static Cable getCable(java.lang.String name)
Get a cable with preset values.


getCableNames

public static java.lang.String[] getCableNames()
Get the list of known cable names.


setDebugOutputEnabled

public void setDebugOutputEnabled(boolean enabled)

isDebugOutputEnabled

public boolean isDebugOutputEnabled()

setLength

public void setLength(double length)
Set the length of the cable.

Parameters:
length - The length of the cable in meters.

getLength

public double getLength()
Get the length of the cable.

Returns:
The length of the cable in meters.

setCapacity

public void setCapacity(double capacity)
Set the capacity of the cable.

Parameters:
capacity - The capacity of the cable in Newtons.

getCapacity

public double getCapacity()
Get the capacity of the cable.

Returns:
The capacity of the cable in Newtons.

setSafetyFactor

public void setSafetyFactor(double safetyFactor)
Set the safety factor of the cable.

Parameters:
safetyFactor - The safety factor of the cable.

getSafetyFactor

public double getSafetyFactor()
Get the safety factor of the cable.

Returns:
The safety factor of the cable.

setMaterial

public void setMaterial(Material material)
Set the material of the cable.

Parameters:
material - The material from which the cable is made.

getMaterial

public Material getMaterial()
Get the material of the cable.

Returns:
The material from which the cable is made.

setNumElements

public void setNumElements(int numElements)
Set the number of elements in the cable calculations.

Parameters:
numElements - The number of elements to use in calculations and simulation of the cable.

getNumElements

public int getNumElements()
Get the number of elements used for the cable calculations and simulation.

Returns:
The number of elements used for the cable.

getNumBrokenElements

public int getNumBrokenElements()

getNumGroundedElements

public int getNumGroundedElements()

setElementBroken

public void setElementBroken(int elementNumber)

getElements

public net.jimmc.spelsim.CableElement[] getElements()
Get the current list of elements.


getBoundingBox

public java.awt.geom.Rectangle2D getBoundingBox()
Get the bounding box containing all of the cable elements.


getBoundingRadius

public double getBoundingRadius()
Get the maximum radius value for all cable elements.


setPlanet

public void setPlanet(Planet planet)
Set the planet around which the cable orbits.

Parameters:
planet - The planet around which the cable orbits.

getPlanet

public Planet getPlanet()
Get the planet aound which the cable orbits.

Returns:
The planet aound which the cable orbits.

getBaseArea

public double getBaseArea()
Get the base area of the cable.


getMass

public double getMass()
Get the total mass of the cable.


getCounterweightMass

public double getCounterweightMass()
Get the mass of the counterweight.


getTaper

public double getTaper()
Get the cable taper factor. The thickest part of the cable is at synchronous orbit. The taper is the ratio of that thickness to the thickness at the base of the cable.


getCenterOfMassAltitude

public double getCenterOfMassAltitude()
Get the altitude of the center of mass of the cable.

Returns:
The altitude of the center of mass over the planet surface in meters.

getCenterOfGravityAltitude

public double getCenterOfGravityAltitude()
Get the altitude of the center of gravity of the cable.

Returns:
The altitude of the center of gravity over the planet surface in meters.

getCenterOfCentrifugalAltitude

public double getCenterOfCentrifugalAltitude()
Get the altitude of the center of centrifugal of the cable.

Returns:
The altitude of the center of centrifugal over the planet surface in meters.

recalculateElements

public void recalculateElements()
Recalculate the elements.


resetSimulation

protected void resetSimulation()
Reset the simulation of our cable.


simulateOneStep

protected void simulateOneStep(double simInterval,
                               int algorithm,
                               double dampingFactor,
                               double cwDerating,
                               double groundDrag)
Simulate the motion of our cable in the indicated amount of time.

Parameters:
simInterval - The step size to simulate.
algorithm - The algorithm to use, one of SpelCanvas.ALG_*.

calculateStresses

protected void calculateStresses(int whichDyn,
                                 double simOffset)
Calcuate the stress on each element. The stress is based on the separation between the element and the one below it as compared to the unloaded length of the element. If the stress exceeds the strength of the material, the element is marked as broken.


calculateAccelerations

protected void calculateAccelerations(int whichDyn,
                                      double simOffset,
                                      double cwDerating,
                                      double groundDrag)
Calculate the acceleration on each element. The acceleration for each element is the vector sum of the contributions from the connections to the elements above and below, and gravity.


calculatePositions

protected void calculatePositions(double simInterval,
                                  int fromDyn,
                                  int toDyn,
                                  int whichAccel,
                                  double dampingFactor)
Caculate the new position of each element. The velocity is updated based on the acceleration, and the position is updated based on the velocity.


draw

public void draw(java.awt.Graphics2D g,
                 double scale)
Draw the cable.


getPositions

public DVector[] getPositions()
Get the position vectors for all elements.


getVelocities

public DVector[] getVelocities()
Get the velocity vectors for all elements.


getAccelerations

public DVector[] getAccelerations()
Get the acceleration vectors for all elements.


getIdealPositions

public DVector[] getIdealPositions()
Get the ideal position vectors for all elements.


getIdealVelocities

public DVector[] getIdealVelocities()
Get the ideal velocity vectors for all elements.


getIdealAccelerations

public DVector[] getIdealAccelerations()
Get the ideal acceleration vectors for all elements.


getPositionDrifts

public DVector[] getPositionDrifts()
Get the position drift vectors for all elements.


getVelocityDrifts

public DVector[] getVelocityDrifts()
Get the velocity drift vectors for all elements.


getAccelerationDrifts

public DVector[] getAccelerationDrifts()
Get the acceleration drift vectors for all elements.


getStresses

public double[] getStresses()
Get the stresses for all elements.


getBroken

public boolean[] getBroken()
Get the broken flag for all elements.


getMaxPositionDrifts

public net.jimmc.spelsim.CableElement[] getMaxPositionDrifts(int count)
Get the elements with the largest amount of position drift.

Parameters:
count - The number of elements to return.

printMaxPositionDrifts

public void printMaxPositionDrifts(int count)
Print the maximum drift values.


dumpSelectedElements

public void dumpSelectedElements(double time,
                                 int algorithm)
For debugging, dump the first and last cable elements.