Class Capacitor
java.lang.Object
org.episteme.natural.physics.classical.waves.electromagnetism.circuit.CircuitElement
org.episteme.natural.physics.classical.waves.electromagnetism.components.Capacitor
- All Implemented Interfaces:
CircuitComponent
Represents an ideal Capacitor.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
Fields inherited from class CircuitElement
circuit, current, nodes, volts, voltSource, x, x2, y, y2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalculates the current through this element.voiddoStep()Performs one simulation step for this element.getCurrent(Real voltage, Real dt) Calculates the current flowing through the component given the voltage across it.voidreset()Resets the element to initial state.voidstamp()Stamps the element's contribution into the circuit matrix.voidCalled at the start of each simulation iteration.Methods inherited from class CircuitElement
allocNodes, getCircuit, getConnection, getCurrent, getInternalNodeCount, getNode, getPostCount, getPostPosition, getPower, getVoltageDiff, getVoltageSource, getVoltageSourceCount, hasGroundConnection, nonLinear, setCircuit, setCoordinates, setCurrent, setNode, setNodeVoltage, setVoltageSource
-
Constructor Details
-
Capacitor
public Capacitor(double capacitanceFarads) -
Capacitor
-
-
Method Details
-
getCurrent
Description copied from interface:CircuitComponentCalculates the current flowing through the component given the voltage across it.- Specified by:
getCurrentin interfaceCircuitComponent- Parameters:
voltage- Voltage across the component (Volts)dt- Time step (Seconds) - used for dynamic components- Returns:
- Current (Amperes)
-
getCapacitance
-
reset
public void reset()Description copied from class:CircuitElementResets the element to initial state.- Overrides:
resetin classCircuitElement
-
startIteration
public void startIteration()Description copied from class:CircuitElementCalled at the start of each simulation iteration. Used for time-dependent elements to update their state.- Overrides:
startIterationin classCircuitElement
-
stamp
public void stamp()Description copied from class:CircuitElementStamps the element's contribution into the circuit matrix. This is called once during circuit analysis to build the MNA matrix. Linear elements stamp constant coefficients; nonlinear elements stamp initial guesses that will be updated inCircuitElement.doStep().- Specified by:
stampin classCircuitElement
-
doStep
public void doStep()Description copied from class:CircuitElementPerforms one simulation step for this element. Called during each iteration of the solver. Nonlinear elements update their matrix contributions here.- Overrides:
doStepin classCircuitElement
-
calculateCurrent
public void calculateCurrent()Description copied from class:CircuitElementCalculates the current through this element. Called after node voltages are updated.- Overrides:
calculateCurrentin classCircuitElement
-