|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--TPhysCalcs
Class that does all the physical simulations and caries all the physical objects.
Field Summary | |
boolean |
Active
Activity flag |
double |
ALPHA0
Initial angle of the first pendulum in radians |
TArc3D |
Arc3D1
Arc between LinePendul1 and the first pendulum |
TArc3D |
Arc3D2
Arc between LinePendul2 and the second pendulum |
double |
BETA0
Initial angle of the second pendulum in radians |
double |
C
Distance between suspension point of the pendulum and suspension point of the spring ON the pendulum |
double |
CM2AXIS
Distance between center of mass and suspension point of the pendula |
double |
DEPTHPENDUL
Depth of the pendula |
double |
e_max
Maximum error in the simulation |
double |
G
Gravitational constant |
double |
h_maxinit
Initial maximum stepsize (for use in adaptive stepsize) |
double |
HEIGHTPENDUL
Initial Height of the pendula |
double |
K
Initial spring constant K |
TLine3D |
LinePendul1
Line going through the first pendulum when it is at rest. |
TLine3D |
LinePendul2
Line going through the second pendulum when it is at rest. |
double |
MASS
Initial mass of the pendula |
int |
NOTIMES
Initial number of steps the simulation does between two frames |
(package private) TOscilloscope |
Oscilloscope
Oscilloscope canvas. |
TPendulum |
Pendul1
First pendulum |
int |
Pendul1DataStream
Datastream index of the first pendulum, used to identify the data for the first pendulum in the oscilloscope |
TPendulum |
Pendul2
Second pendulum |
int |
Pendul2DataStream
Datastream index of the second pendulum, used to identify the data for the second pendulum in the oscilloscope |
double |
perframe
Number of seconds per frame |
(package private) TPhysCanvas |
PhysCanvas
Canvas onto which all the physical objects are drawn. |
TSphere3D |
Sphere1
Sphere at the top of the first pendulum (suspension point) |
TSphere3D |
Sphere2
Sphere at the top of the second pendulum (suspension point) |
TSpiral3D |
Spiral
Spring between the two pendula |
double |
t
Time of the simulation (in milliseconds |
protected java.lang.Thread |
timerThread
Thread used for calculating and predrawing the physics of the simulation. |
double |
VPendul1
Angular velocity of the first pendulum |
double |
VPendul2
Angular velocity of the second pendulum |
double |
WIDTHPENDUL
Width of the pendula |
Constructor Summary | |
(package private) |
TPhysCalcs()
The constructor of the class. |
Method Summary | |
double |
Accel(double _a)
Angular acceleration of a single pendulum |
double |
Accel(double _a,
double _b)
Angular acceleration off the pendula. |
void |
activateChanges()
After a parameter is changed this routine is called. |
double |
atan(double _alpha)
Java's arctangens is only defined in a certain range of points, this is a work around for angles > 0.5 PI |
void |
estimateStepsize()
Use adaptive stepsize velocity verlet on 1 period of simulation of a single pendulum. |
double |
Inertia()
The Inertia of the pendula |
void |
initGraphics()
Call the initGraphics of both canvases. |
void |
run()
This routine is called when a thread is started for this class. |
void |
setActive()
Set Active true |
void |
setInactive()
Set Active false |
void |
start()
start the simulation by setting both canvases to active, and opening a new thread that calls the run method. |
void |
stop()
stop the simulation by setting both canvases to inactive, and shutting down the thread. |
void |
switchActive()
When called this routine switches the state of the simulation. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public TPendulum Pendul1
public TPendulum Pendul2
public TSpiral3D Spiral
public TArc3D Arc3D1
public TArc3D Arc3D2
public TSphere3D Sphere1
public TSphere3D Sphere2
public TLine3D LinePendul1
public TLine3D LinePendul2
TPhysCanvas PhysCanvas
TOscilloscope Oscilloscope
protected java.lang.Thread timerThread
public int Pendul1DataStream
public int Pendul2DataStream
public double t
public double VPendul1
public double VPendul2
public double e_max
public double h_maxinit
public double perframe
public int NOTIMES
public double MASS
public double ALPHA0
public double BETA0
public double K
public double HEIGHTPENDUL
public double WIDTHPENDUL
public double DEPTHPENDUL
public double CM2AXIS
public double G
public double C
public boolean Active
Constructor Detail |
TPhysCalcs()
Method Detail |
public double atan(double _alpha)
_alpha
- The angle in radians for which the arctangens should be calculatedpublic void activateChanges()
public void switchActive()
public void initGraphics()
public void start()
public void stop()
public void run()
public double Accel(double _a, double _b)
_a
- the deviation from the equilibrium position of the pendulum for which the acceleration should be calculated_b
- the deviation from the equilibrium position of the other pendulumpublic double Accel(double _a)
_a
- the deviation from the equilibrium position of the pendulumpublic void setActive()
public void setInactive()
public double Inertia()
public void estimateStepsize()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |