const p1Terminal = flux.getNodeById("404d6419-22e0-26f8-d5e7-3b09e0426cd5");
const p2Terminal = flux.getNodeById("9fe76e36-e72b-f727-47c0-1430960f5d15");
const p1VoltageNode = flux.createOutputNode("va");
const p2VoltageNode = flux.createOutputNode("vb");
const amperageOutputNode = flux.createOutputNode("current");
const voltageDrop = flux.createOutputNode("vdrop");
// Setup Event
flux.on("setup", (event) => {
const inductance = flux.properties.find((prop) => prop.name === "Inductance")?.value || 2.2;
flux.simulationModel = {
type: "inductor",
inductance: inductance,
map_input_to_terminal_uid: p1Terminal?.uid,
map_output_to_terminal_uid: p2Terminal?.uid,
};
});
// Before Event
flux.on("beforeStep", (event) => {
const inductance = flux.properties.find((prop) => prop.name === "Inductance")?.value || 2.2;
flux.simulationModel = {