const vp1 = flux.getNodeById("cee473da-7bd3-5b1a-743f-26d31f3e88de"); //P1
const vp2 = flux.getNodeById("d6af6e84-6e89-7eb0-c793-388dd691029e"); //P2
const vp2Voltage = flux.createOutputNode("vout");
const vp1Voltage = flux.createOutputNode("vin");
const current = flux.createOutputNode("I");
// Setup Event
flux.on("setup", (event) => {
const capacitance = flux.properties.find((prop) => prop.name === "Capacitance")?.value || 0.000001;
flux.simulationModel = {
type: "capacitor",
capacitance: capacitance,
map_input_to_terminal_uid: vp1?.uid,
map_output_to_terminal_uid: vp2?.uid,
};
});
// Before Event
flux.on("beforeStep", (event) => {
const capacitance = flux.properties.find((prop) => prop.name === "Capacitance")?.value || 0.000001;
flux.simulationModel = {