const negTerminal = flux.getNodeById("cce2512c-9662-0805-165e-e6626dc8d49b"); // -
const posiTerminal = flux.getNodeById("d258ecff-3f2a-2ad6-cd5e-3c760023d6a9"); // +
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const voltageDrop = flux.createOutputNode("vDrop");
const current = flux.createOutputNode("I");
// Setup Event
flux.on("setup", (event) => {
const voltage = flux.properties.find((prop) => prop.name === "Voltage")?.value || 3.00;
flux.simulationModel = {
type: "voltageSource",
voltage: voltage,
map_neg_to_terminal_uid: negTerminal?.uid,
map_posi_to_terminal_uid: posiTerminal?.uid
};
});
// before Event
flux.on("beforeStep", (event) => {