// Howdy 👋.
// If you are new to writing code in Flux make sure to check out our get started docs: https://docs.flux.ai/reference/introduction
// We also have a Flux Slack Community in case you need help: https://join.slack.com/t/fluxcommunity/shared_invite/zt-p48n941f-wzQ06kGmuFJ2HXnGYT1JkA
// To infinity and beyond 🚀
const p1TerminalId = "b768ec21-c56b-dbb5-cb30-f29d59675d9b"; //P1
const p2TerminalId = "31c6f0d0-50f6-960d-170d-c511f55a9b68"; //P2
const p1Terminal = flux.getNodeById(p1TerminalId, "elementTerminal");
const p2Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const current = flux.createOutputNode("I");
//setup event
flux.on("setup", () => {
const inductance = Number(flux.properties.find((prop) => prop.name === "Inductance")?.value || 0.000001);
flux.simulationModel = simModel(inductance);
});
// Property was changed event