const cathodeTerminal = flux.getNodeById("9f73fc34-6b9b-eaf8-c98d-049abe2a9372"); // Common
const anodeTerminal = flux.getNodeById("3ac4014c-3319-49ba-7c0a-82faad65f4b2"); // Vin
const voltageReading = flux.createOutputNode("vmeasured");
flux.on("setup", (event) => {
// 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 = {
type: "resistor",
resistance: resistance,
map_input_to_terminal_uid: anodeTerminal?.uid,
map_output_to_terminal_uid: cathodeTerminal?.uid,
}
});
flux.on("beforeStep", (event) => {
const resistance = 10000000;
flux.simulationModel = {
resistance: resistance,