org.opensourcephysics.sip.ch04
Class RCApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch04.RCApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation

public class RCApp
extends AbstractSimulation

RCApp solves and plots the voltage across a capacitor in an RC circuit driven by a sinusoidal driving voltage. This application demonstrates:

  1. how to use the ODE interface.
  2. how to use the ODESolver interface.
  3. how to use the Animation control to run and single-step a differential equation.
  4. how to display the ODE solution in a graph.
Students should test other ODESolvers in the Numerics package.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
RCApp()
          Constructs the RCApp
 
Method Summary
 void doStep()
          Does an animation step
 void initialize()
          Initializes the simulation.
static void main(java.lang.String[] args)
          Start Java application
 void reset()
          Resets animation to a predefined state
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getLoader, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startRunning, startSimulation, stepAnimation, stop, stopAnimation, stopRunning, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

RCApp

public RCApp()
Constructs the RCApp

Method Detail

initialize

public void initialize()
Description copied from class: AbstractSimulation
Initializes the simulation. Override this method to initialize a concrete simulation.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Does an animation step

Specified by:
doStep in class AbstractAnimation

reset

public void reset()
Resets animation to a predefined state

Overrides:
reset in class AbstractSimulation

main

public static void main(java.lang.String[] args)
Start Java application

Parameters:
args - command line parameters