const aTerminalId = "07c3726b-5f3b-ba5e-1005-d10e69c8fbd7";
const bTerminalId = "a7f388fa-29f0-9d68-7eed-a728188c2df7";
const qTerminalId = "9e33bfd2-8be9-c43a-7e84-fb1bb18b559f";
const aTerminal = flux.getNodeById(aTerminalId, "elementTerminal");
const bTerminal = flux.getNodeById(bTerminalId, "elementTerminal");
const qTerminal = flux.getNodeById(qTerminalId, "elementTerminal");
const aVoltage = flux.createOutputNode("a-voltage");
const bVoltage = flux.createOutputNode("b-voltage");
const qVoltage = flux.createOutputNode("q-voltage");
flux.on("setup", () => {
flux.simulationModel = simModel();
});
flux.on("beforeStep", () => {
flux.simulationModel = simModel();
});
flux.on("afterStep", (event) => {
aVoltage.name = "A";
aVoltage.value = Number(aTerminal?.voltage);
aVoltage.unit = "V";
bVoltage.name = "B";
bVoltage.value = Number(bTerminal?.voltage);
bVoltage.unit = "V";