const cathodeTerminal = flux.getNodeById("9f73fc34-6b9b-eaf8-c98d-049abe2a9372", "elementTerminal")!; // Common
const anodeTerminal = flux.getNodeById("3ac4014c-3319-49ba-7c0a-82faad65f4b2", "elementTerminal")!; // Vin
const voltageReading = flux.createOutputNode("vmeasured");
voltageReading.name = "Measured";
voltageReading.unit = "V";
voltageReading.displayInline = true;
const maxVoltageOutput = flux.createOutputNode("vmax");
maxVoltageOutput.name = "Max";
maxVoltageOutput.unit = "V";
const minVoltageOutput = flux.createOutputNode("vmin");
minVoltageOutput.name = "Min";
minVoltageOutput.unit = "V";
const historyLength = Number(flux.properties.find((prop) => prop.name === "History Length")?.value ?? 30);
flux.on("setup", () => {
// The resistance of virtually every digital voltmeter is standardized at 10 megohms.
// The idea is the circuit should not "see" the meter. Almost no current flows through the meter.
const resistance = 10000000;
flux.simulationModel = {