FIX: setting voltage of pivot (zero per definition)
This commit is contained in:
parent
7f82cc6e57
commit
feb7ea9161
@ -16,6 +16,7 @@ export class Calculation {
|
|||||||
private potentials: number[] = [];
|
private potentials: number[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
readonly pivot: Junction,
|
||||||
readonly parts: Part[],
|
readonly parts: Part[],
|
||||||
readonly junctionsWithoutPivot: Junction[],
|
readonly junctionsWithoutPivot: Junction[],
|
||||||
readonly wires: Wire[]) {
|
readonly wires: Wire[]) {
|
||||||
@ -31,6 +32,9 @@ export class Calculation {
|
|||||||
junction.maxCircuitVoltage = maxCircuitVoltage;
|
junction.maxCircuitVoltage = maxCircuitVoltage;
|
||||||
junction.voltage = this.getPotential(junctionsWithoutPivot.indexOf(junction));
|
junction.voltage = this.getPotential(junctionsWithoutPivot.indexOf(junction));
|
||||||
});
|
});
|
||||||
|
pivot.minCircuitVoltage = minCircuitVoltage;
|
||||||
|
pivot.maxCircuitVoltage = maxCircuitVoltage;
|
||||||
|
pivot.voltage = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private matrixInit(size: number) {
|
private matrixInit(size: number) {
|
||||||
@ -152,6 +156,6 @@ export class Calculation {
|
|||||||
}
|
}
|
||||||
const junctionCountIncludingPivot = foundJunctions.length + 1;
|
const junctionCountIncludingPivot = foundJunctions.length + 1;
|
||||||
console.debug(` => Circuit #${circuitNumber} (${foundParts.length} parts, ${junctionCountIncludingPivot} junctions, ${foundWires.length} wires)`);
|
console.debug(` => Circuit #${circuitNumber} (${foundParts.length} parts, ${junctionCountIncludingPivot} junctions, ${foundWires.length} wires)`);
|
||||||
return new Calculation(foundParts, foundJunctions, foundWires);
|
return new Calculation(pivot, foundParts, foundJunctions, foundWires);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user