|
|||||||||
| 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
org.opensourcephysics.cabrillo.tracker.DynamicParticlePolar
org.opensourcephysics.cabrillo.tracker.DynamicSystem
public class DynamicSystem
This models a system of 2 particles that interact via internal forces.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.opensourcephysics.cabrillo.tracker.TTrack |
|---|
TTrack.StepArray |
| Field Summary | |
|---|---|
protected ParticleModel[] |
models
|
protected TTrack.StepArray |
noSteps
|
protected java.lang.String[] |
particleNames
|
protected DynamicParticle[] |
particles
|
protected double[] |
particleState
|
protected TTrack.StepArray |
realSteps
|
protected java.util.TreeMap<java.lang.Integer,double[]> |
relativeStates
|
protected DynamicSystemInspector |
systemInspector
|
protected javax.swing.JMenuItem |
systemInspectorItem
|
protected int |
systemInspectorX
|
protected int |
systemInspectorY
|
| Fields inherited from class org.opensourcephysics.cabrillo.tracker.DynamicParticle |
|---|
frameStates, initialState, iterationsPerStep, points, solver, state, 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 | |
|---|---|
DynamicSystem()
No-arg constructor. |
|
DynamicSystem(DynamicParticle[] parts)
Constructor with particles. |
|
| Method Summary | |
|---|---|
boolean |
addParticle(DynamicParticle particle)
Adds a particle to this system. |
protected void |
cleanup()
Cleans up associated resources when this track is deleted or cleared. |
void |
delete()
Deletes this system. |
void |
draw(DrawingPanel panel,
java.awt.Graphics _g)
Overrides DynamicParticle draw method. |
java.lang.String |
getDisplayName()
Gets a display name for this model. |
double[] |
getInitialState()
Gets the initial state. |
double[] |
getInitialValues()
Gets the initial values. |
static XML.ObjectLoader |
getLoader()
Returns an ObjectLoader to save and load data for this class. |
double |
getMass()
Gets the mass. |
javax.swing.JMenu |
getMenu(TrackerPanel trackerPanel)
Returns a menu with items that control this track. |
protected ParticleModel[] |
getModels()
Gets the particle models associated with this model. |
void |
getRate(double[] state,
double[] rate)
Gets the rate based on a specified state. |
protected double[] |
getRelativePolarState(double[] state)
Converts a two-body cartesian state {x1, vx1, y1, vy1, x2, vx2, y2, vy2, t} to a relative polar state {r, vr, theta, omega, t}. |
protected double[] |
getState(DynamicParticle particle)
Gets the current state of the specified particle. |
DynamicSystemInspector |
getSystemInspector()
Gets the system inspector. |
protected double[] |
getSystemState(double[] state)
Gets the state of this system based on the states of its particles. |
java.util.ArrayList<java.awt.Component> |
getToolbarTrackComponents(TrackerPanel trackerPanel)
Overrides TTrack getToolbarTrackComponents method. |
protected void |
initializeFunctionPanel()
Creates and initializes the ModelFunctionPanel. |
boolean |
isDependent()
Overrides TTrack isDependent method to return true. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. |
protected void |
refreshData(DatasetManager data,
TrackerPanel trackerPanel)
Refreshes the data. |
protected void |
refreshInitialTime()
Refreshes initial time parameter for this model. |
protected void |
refreshSystemParameters()
Refreshes the initial positions, velocities and particle masses based on the values for the particles in this system. |
boolean |
removeParticle(DynamicParticle particle)
Removes a particle from this system. |
boolean |
setParticles(DynamicParticle[] newParticles)
Sets the particles in this system. |
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.DynamicParticlePolar |
|---|
getPolarState, getXYForces, initializeInitEditor |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.DynamicParticle |
|---|
getEndFrame, getNextTracePositions, getStartFrame, getState, refreshSteps, reset, resetState, restoreState, saveState, setEndFrame, setSolver, setStartFrame |
| Methods inherited from class org.opensourcephysics.cabrillo.tracker.ParticleModel |
|---|
createMassAndTimeParameters, drawMe, findInteractive, getFunctionEditor, getInitEditor, getInspector, getParamEditor, getToolbarPointComponents, isAutoTrackable, isModelsVisible, isStepComplete, refreshDerivsIfNeeded, 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 DynamicParticle[] particles
protected ParticleModel[] models
protected double[] particleState
protected DynamicSystemInspector systemInspector
protected javax.swing.JMenuItem systemInspectorItem
protected java.lang.String[] particleNames
protected TTrack.StepArray realSteps
protected TTrack.StepArray noSteps
protected int systemInspectorX
protected int systemInspectorY
protected java.util.TreeMap<java.lang.Integer,double[]> relativeStates
| Constructor Detail |
|---|
public DynamicSystem()
public DynamicSystem(DynamicParticle[] parts)
parts - an array of up to two dynamic particles| Method Detail |
|---|
public void draw(DrawingPanel panel,
java.awt.Graphics _g)
draw in interface Drawabledraw in class DynamicParticlepanel - the drawing panel requesting the drawing_g - the graphics context on which to drawpublic java.lang.String getDisplayName()
getDisplayName in class DynamicParticlepublic javax.swing.JMenu getMenu(TrackerPanel trackerPanel)
getMenu in class ParticleModeltrackerPanel - the tracker panel
public java.util.ArrayList<java.awt.Component> getToolbarTrackComponents(TrackerPanel trackerPanel)
getToolbarTrackComponents in class PointMasstrackerPanel - the tracker panel
public double getMass()
getMass in class ParticleModelpublic boolean isDependent()
isDependent in class ParticleModeltrue if this track is dependentpublic boolean addParticle(DynamicParticle particle)
particle - the particle to add
public boolean removeParticle(DynamicParticle particle)
particle - the particle to remove
public boolean setParticles(DynamicParticle[] newParticles)
newParticles - an array of zero to two dynamic particles
public void delete()
delete in class DynamicParticle
public void getRate(double[] state,
double[] rate)
getRate in interface ODEgetRate in class DynamicParticlestate - the staterate - the rate of change of the statepublic double[] getInitialValues()
getInitialValues in class ParticleModelpublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class ParticleModele - the property change eventpublic DynamicSystemInspector getSystemInspector()
public double[] getInitialState()
getInitialState in class DynamicParticlePolar
protected void refreshData(DatasetManager data,
TrackerPanel trackerPanel)
refreshData in class PointMassdata - the DatasetManagertrackerPanel - the tracker panelprotected void cleanup()
cleanup in class ParticleModelprotected void refreshInitialTime()
refreshInitialTime in class ParticleModelprotected void refreshSystemParameters()
protected void setTracePositions(double[] state)
setTracePositions in class DynamicParticlestate - the stateprotected void initializeFunctionPanel()
initializeFunctionPanel in class DynamicParticlePolarprotected double[] getSystemState(double[] state)
state - the particle state {x1, vx1, y1, vy1, x2, vx2, y2, vy2, t}
protected double[] getState(DynamicParticle particle)
particle - the particle
protected ParticleModel[] getModels()
getModels in class ParticleModelprotected double[] getRelativePolarState(double[] state)
state - the cartesian state of both particles
public static XML.ObjectLoader getLoader()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||