const anodeTerminal = flux.getNodeById("d727c28d-8dc3-54a3-dbd6-c7b78c0f1164");
const cathodeTerminal = flux.getNodeById("189822c2-307d-3ef1-984d-6a157f530d3a");
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const voltageDrop = flux.createOutputNode("vDrop");
const current = flux.createOutputNode("I");
// Setup Event
flux.on("setup", (event) => {
const voltage = flux.properties.find((prop) => prop.name === "Voltage")?.value || 5.00;
flux.simulationModel = {
type: "voltageSource",
voltage: voltage,
map_anode_to_terminal_uid: anodeTerminal?.uid,
map_cathode_to_terminal_uid: cathodeTerminal?.uid
};
});
// before Event
flux.on("beforeStep", (event) => {