// 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 = "5237503d-4662-b83a-7859-31969858b9c0"; //P1
const p2TerminalId = "e5e04a27-c5c4-f2e6-5799-708eb3f01464"; //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");
const partTypeProperty : any = flux.properties.find((prop) => prop.name === "Part Type");
//setup event
flux.on("setup", () => {
const capacitance = Number(flux.properties.find((prop) => prop.name === "Capacitance")?.value || 0.000001);
flux.simulationModel = simModel(capacitance);
if (partTypeProperty) {