|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectIntegrator
RK4
SolarIntegrator
SolarIntegrator is a subclass of the abstract RK4 class. It implements a function method which represents the mathematical representation of my simplified solar system. (about 90 coupled differential equations :)
Field Summary |
Fields inherited from class Integrator |
steps, x, x0, x1, y, y0 |
Constructor Summary | |
SolarIntegrator(SpaceObject[] o,
double t0,
double t1,
PointN startPoint,
int steps)
Constructs a SolarIntegrator for performing numerical integration. |
Method Summary | |
Point |
function(double time,
Point n)
represents the mathematical behaviour of my simplified solar system. |
double |
getDistance(SpaceObject s,
double x,
double y,
double z)
calculates the distance of a SpaceObject s from a certain position in 3D. |
Point |
integrate()
Method for numerical integration. |
java.lang.String |
toString()
This method is NOT USED!!! |
Methods inherited from class Integrator |
getIV, getLocation, run, setEnd, setSteps |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SolarIntegrator(SpaceObject[] o, double t0, double t1, PointN startPoint, int steps)
SolarIntegrator
for performing numerical integration.
o
- arry of SpaceObjects in the system.t0
- start time of integration (in seconds as I only use SI units).t1
- stop time of integration.startPoint
- has to be a huge list where the first three entries are the sun coordinates,
the next three the sun velocities, and then it is repeating this patter with all planets,
following the order: sun -> outwards until Neptun.steps
- number of integration steps between start and stop timeMethod Detail |
public Point integrate()
integrate
in class RK4
Point
object which contains the new (after the integration)
position and velocities of all space objects. Starting with the sun's positions
and velocities, then mercury's and so on until neptuns positions and velocities.public Point function(double time, Point n)
SpaceObject
.
(i.e. differentiating with respect to time)
function
in class Integrator
time
- a time step.n
- a Point
object holding current positions and velocities.
Point
object which contains the velocieties and accelerations
of all space objects. Starting with the sun's velocities and accelerations, then
mercury's and so on until neptun's.public double getDistance(SpaceObject s, double x, double y, double z)
SpaceObject
s from a certain position in 3D.
s
- a SpaceObject
.x
- cartesian x coordinate of a point in 3D.y
- cartesian y coordinate of a point in 3D.z
- cartesian z coordinate of a point in 3D.
SpaceObject
s and the point in 3D.public java.lang.String toString()
toString
in class Integrator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |