// 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 = "dff57d78-487b-f832-db06-4405c23ce37c"; //P1
const p2TerminalId = "880f28ef-cf41-0acc-4a98-ce0afa37b0c2"; //P2
const p1Terminal = flux.getNodeById(p1TerminalId, "elementTerminal");
const p2Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
const voltageInputNode = flux.createOutputNode("v1");
const voltageOutputNode = flux.createOutputNode("v2");
const voltageDrop = flux.createOutputNode("vdrop");
const powerOutputNode = flux.createOutputNode("power");
const amperageOutputNode = flux.createOutputNode("current");
//setup event
flux.on("setup", () => {
const resistance = Number(flux.properties.find((prop) => prop.name === "Resistance")?.value || 500);
flux.simulationModel = simModel(resistance);
});