Class Resistor
java.lang.Object
org.episteme.natural.physics.classical.waves.electromagnetism.circuit.CircuitElement
org.episteme.natural.physics.classical.waves.electromagnetism.components.Resistor
- All Implemented Interfaces:
CircuitComponent
Represents an ideal Resistor.
- 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.getCurrent(Real voltage, Real dt) Calculates the current flowing through the component given the voltage across it.voidstamp()Stamps the element's contribution into the circuit matrix.Methods inherited from class CircuitElement
allocNodes, doStep, getCircuit, getConnection, getCurrent, getInternalNodeCount, getNode, getPostCount, getPostPosition, getPower, getVoltageDiff, getVoltageSource, getVoltageSourceCount, hasGroundConnection, nonLinear, reset, setCircuit, setCoordinates, setCurrent, setNode, setNodeVoltage, setVoltageSource, startIteration
-
Constructor Details
-
Resistor
public Resistor(double resistanceOhms) -
Resistor
-
-
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)
-
getResistance
-
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
-
calculateCurrent
public void calculateCurrent()Description copied from class:CircuitElementCalculates the current through this element. Called after node voltages are updated.- Overrides:
calculateCurrentin classCircuitElement
-