|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.cabrillo.tracker.TTrack
org.opensourcephysics.cabrillo.tracker.PointMass
org.opensourcephysics.cabrillo.tracker.ParticleModel
org.opensourcephysics.cabrillo.tracker.DynamicParticle
public class DynamicParticle
DynamicParticle models a particle using Newton'w 2nd law.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack |
|---|
TTrack.StepArray |
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.Integer,double[]> |
frameStates
|
protected double[] |
initialState
|
protected int |
iterationsPerStep
|
protected java.awt.geom.Point2D[] |
points
|
protected ODESolver |
solver
|
protected double[] |
state
|
protected DynamicSystem |
system
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.ParticleModel |
|---|
dt, endFrame, functionEditor, functionPanel, inspector, inspectorH, inspectorX, inspectorY, invalidWarningShown, lastValidFrame, loading, nan, prevX, prevY, refreshDerivsLater, refreshing, refreshStepsLater, showInspector, startFrame, startFrameUndefined, t0, time, timeFormat, tracePt, tracePtsPerStep, traceX, traceY, xLimit, yLimit |
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.PointMass |
|---|
aAtOrigin, accelerationMenu, accelFootprintMenu, aDeriv, aDerivSpill, aFootprint, aFootprints, aMap, aTailsToOriginItem, aTailsToPositionItem, autotrackItem, aVisibleItem, aVisibleOnAll, aVisMap, dataDescriptions, derivData, mass, massField, massLabel, mSeparator, params, positionFootprintMenu, trace, traceStroke, traceVisible, validData, vAtOrigin, vDeriv, vDerivSpill, velocFootprintMenu, velocityMenu, vFootprint, vFootprints, vMap, vTailsToOriginItem, vTailsToPositionItem, vVisibleItem, vVisibleOnAll, vVisMap, xData, xVisibleOnAll, xVisMap, yData |
| Constructor Summary | |
|---|---|
DynamicParticle()
Constructor |
|
| Method Summary | |
|---|---|
void |
delete()
Deletes this particle. |
void |
draw(DrawingPanel panel,
java.awt.Graphics _g)
Overrides ParticleModel draw method. |
java.lang.String |
getDisplayName()
Gets a display name for this model. |
int |
getEndFrame()
Gets the end frame for this model. |
double[] |
getInitialState()
Gets the initial state {x, vx, y, vy, t}. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
protected java.awt.geom.Point2D[] |
getNextTracePositions()
Gets the next trace positions. |
void |
getRate(double[] state,
double[] rate)
Gets the rate {vx, ax, vy, ay, 1} based on a specified state {x, vx, y, vy, t}. |
int |
getStartFrame()
Gets the start frame for this model. |
double[] |
getState()
Gets the current state {x, vx, y, vy, t}. |
protected double[] |
getXYForces(double[] cartesianState)
Gets the x- and y-forces based on a specified cartesian state {x, vx, y, vy, t}. |
protected void |
initializeFunctionPanel()
Creates and initializes the ModelFunctionPanel. |
protected void |
initializeInitEditor()
Creates the initial position and velocity parameters. |
protected void |
refreshSteps()
Refreshes step positions. |
void |
reset()
Resets parameters, initializes solver and sets position(s) for start frame or first clip frame following. |
protected void |
resetState()
Resets the state variables {x, vx, y, vy, t}. |
protected boolean |
restoreState(int frameNumber)
Restores the state to a previously saved state, if any. |
protected void |
saveState(int frameNumber)
Saves the current state. |
void |
setEndFrame(int n)
Sets the end frame for this model. |
void |
setSolver(java.lang.Class<?> solverClass)
Sets the ODESolver type. |
void |
setStartFrame(int n)
Sets the start frame for this model. |
protected void |
setTracePositions(double[] state)
Sets the positions of the trace points based on a specified state. |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.ParticleModel |
|---|
cleanup, createMassAndTimeParameters, drawMe, findInteractive, getFunctionEditor, getInitEditor, getInitialValues, getInspector, getMass, getMenu, getModels, getParamEditor, getToolbarPointComponents, isAutoTrackable, isDependent, isModelsVisible, isStepComplete, propertyChange, refreshDerivsIfNeeded, refreshInitialTime, setAnglesInRadians, setLocked, setMass, setName, setTrackerPanel, trimSteps |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] state
protected double[] initialState
protected ODESolver solver
protected int iterationsPerStep
protected DynamicSystem system
protected java.awt.geom.Point2D[] points
protected java.util.HashMap<java.lang.Integer,double[]> frameStates
| Constructor Detail |
|---|
public DynamicParticle()
| Method Detail |
|---|
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in interface Drawabledraw in class ParticleModelpanel - the drawing panel requesting the drawing_g - the graphics context on which to drawpublic java.lang.String getDisplayName()
getDisplayName in class ParticleModelpublic void delete()
delete in class ParticleModelprotected void refreshSteps()
refreshSteps in class ParticleModelpublic void reset()
reset in class ParticleModelpublic double[] getState()
getState in interface ODEprotected void saveState(int frameNumber)
saveState in class ParticleModelframeNumber - the frame numberprotected boolean restoreState(int frameNumber)
restoreState in class ParticleModelframeNumber - the frame number
public void getRate(double[] state,
double[] rate)
getRate in interface ODEstate - the staterate - the rate of change of the statepublic void setSolver(java.lang.Class<?> solverClass)
solverClass - the solver classpublic double[] getInitialState()
public int getStartFrame()
getStartFrame in class ParticleModelpublic void setStartFrame(int n)
setStartFrame in class ParticleModeln - the desired start framepublic int getEndFrame()
getEndFrame in class ParticleModelpublic void setEndFrame(int n)
setEndFrame in class ParticleModeln - the desired end frameprotected double[] getXYForces(double[] cartesianState)
cartesianState - the state
protected void resetState()
protected void initializeInitEditor()
protected void initializeFunctionPanel()
initializeFunctionPanel in class ParticleModelprotected java.awt.geom.Point2D[] getNextTracePositions()
protected void setTracePositions(double[] state)
state - the statepublic static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||