const p1Terminal = flux.getNodeById("d3225f26-c2d8-52c5-5d14-6b013dae47a0");
const p2Terminal = flux.getNodeById("f8d345d6-7d01-1c5b-7b7e-de80ac95111d");
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 = {