org.opensourcephysics.sip.ch04
Class RC

java.lang.Object
  extended by org.opensourcephysics.sip.ch04.RC
All Implemented Interfaces:
ODE

public class RC
extends java.lang.Object
implements ODE

RC demonstrates how to implement the ODE interface for an RC circuit.


Constructor Summary
RC(double _r, double _c, double _omega)
          Construct an RC circuit with the given values.
 
Method Summary
 void getRate(double[] state, double[] rate)
          Get the rate array.
 double getSourceVoltage(double t)
          Get the source voltage at given time.
 double[] getState()
          Get state array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RC

public RC(double _r,
          double _c,
          double _omega)
Construct an RC circuit with the given values.

Method Detail

getState

public double[] getState()
Get state array. Implementation of ODE interface.

Specified by:
getState in interface ODE
Returns:
state array

getSourceVoltage

public double getSourceVoltage(double t)
Get the source voltage at given time.

Parameters:
t -
Returns:

getRate

public void getRate(double[] state,
                    double[] rate)
Get the rate array. Implementation of ODE interface. This method may be invoked many times with different intermediate states as an ODESolver is carrying out the solution.

Specified by:
getRate in interface ODE
Parameters:
state - the state array
rate - the rate array