const baseTerminal = flux.getNodeById("4e85df69-5195-904b-c1f9-b12a266f8e08");
const emitterTerminal = flux.getNodeById("d5427e59-9ef4-94df-ac0e-144492c6aa97");
const collectorTerminal = flux.getNodeById("279c5fd9-1a10-8cf4-1b4d-493208874d2e");
const baseVoltage = flux.createOutputNode("base-voltage");
const emitterVoltage = flux.createOutputNode("emitter-voltage");
const collectorVoltage = flux.createOutputNode("collector-voltage");
const baseCurrent = flux.createOutputNode("base-current");
const emitterCurrent = flux.createOutputNode("emitter-current");
const collectorCurrent = flux.createOutputNode("collector-current");
// Setup Event
flux.on("setup", (event) => {
const beta = flux.properties.find((prop) => prop.name === "Beta / hFe")?.value || 100;
const leakage = flux.properties.find((prop) => prop.name === "Leakage Current")?.value || 1e-13;
flux.simulationModel = {
type: "transistor",
pnp: true,
map_base_to_terminal_uid: baseTerminal?.uid,
map_emitter_to_terminal_uid: emitterTerminal?.uid,
map_collector_to_terminal_uid: collectorTerminal?.uid,