const gateId = "8ab52d23-74a4-a96d-73c7-d4764600905a";
const drainId = "6e8f3c1d-1999-92ed-3aa8-7486fa7ad8cc";
const sourceId = "dd05fdee-0b43-3d74-bce6-427f356659b7";
const gateTerminal = flux.getNodeById(gateId, "elementTerminal");
const drainTerminal = flux.getNodeById(drainId, "elementTerminal");
const sourceTerminal = flux.getNodeById(sourceId, "elementTerminal");
const vgs = flux.createOutputNode("Vgate");
const vds = flux.createOutputNode("Vdrain");
const drainToSource = flux.createOutputNode("I");
const vs = flux.createOutputNode("Vsource");
//setup event
flux.on("setup", () => {
const threshold = Number(flux.properties.find((prop) => prop.name === "Threshold Voltage")?.value);
const beta = Number(flux.properties.find((prop) => prop.name === "Beta")?.value);
flux.simulationModel = simModel(beta, threshold);
});
// Property was changed event
flux.on("propertyChange", (event) => {