const inputTerminalElement = flux.getNodeById("d8dd6f46-a97d-be12-d59a-b9f63e6fc8ac"); //a terminal
const outputTerminalElement = flux.getNodeById("ccfe8ec4-eae5-582b-77a5-c90792cc0660"); //b terminal
const voltageInputNode = flux.createOutputNode("va");
const voltageOutputNode = 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 || 1.5;
flux.simulationModel = {
type: "inductor",
inductance: inductance,
map_input_to_terminal_uid: inputTerminalElement?.uid,
map_output_to_terminal_uid: outputTerminalElement?.uid,
};
});
// Before Event
flux.on("beforeStep", (event) => {
const inductance = flux.properties.find((prop) => prop.name === "Inductance")?.value || 1.5;
flux.simulationModel = {