|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.sip.ch04.Pendulum
public class Pendulum
Pendulum models the dynamics of a pendulum.
| Constructor Summary | |
|---|---|
Pendulum()
|
|
| Method Summary | |
|---|---|
void |
draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
Draws the pendulum. |
void |
getRate(double[] state,
double[] rate)
Gets the rate. |
double[] |
getState()
Gets the state. |
void |
setState(double theta,
double thetaDot)
Sets the state. |
void |
setStepSize(double dt)
Sets the ODESolver's time step. |
void |
step()
Steps (advances) the time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Pendulum()
| Method Detail |
|---|
public void setStepSize(double dt)
dt - doublepublic void step()
dt - the time step.
public void setState(double theta,
double thetaDot)
theta - dtheta/dt - public double[] getState()
getState in interface ODE
public void getRate(double[] state,
double[] rate)
getRate in interface ODEstate - double[] the staterate - double[] the computed rate
public void draw(DrawingPanel drawingPanel,
java.awt.Graphics g)
draw in interface DrawabledrawingPanel - g -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||