const p1Terminal = flux.getNodeById("7ecc7675-fb09-ac45-fc14-89255ecb55e7"); //P1
const p2Terminal = flux.getNodeById("732644bc-8d92-e2a3-a30a-8b12205fbe56"); //P2
const p1Voltage = flux.createOutputNode("v1");
const p2Voltage = flux.createOutputNode("v2");
const amperageOutputNode = flux.createOutputNode("current");
const powerOutputNode = flux.createOutputNode("power");
const voltageDrop = flux.createOutputNode("vdrop");
// Setup Event
flux.on("setup", (event) => {
const resistance = flux.properties.find((prop) => prop.name === "Resistance")?.value || 500;
flux.simulationModel = {
type: "resistor",
resistance: resistance,
map_input_to_terminal_uid: p1Terminal?.uid,
map_output_to_terminal_uid: p2Terminal?.uid
};
});
// Before Event
flux.on("beforeStep", (event) => {