public override void step(Circuit sim) { double vac = lead_volt[anode] - lead_volt[cnode]; // typically negative double vag = lead_volt[anode] - lead_volt[gnode]; // typically positive if (Math.Abs(vac - lastvac) > 0.01 || Math.Abs(vag - lastvag) > .01) { sim.converged = false; } lastvac = vac; lastvag = vag; diode.doStep(sim, lead_volt[inode] - lead_volt[gnode]); double icmult = 1 / triggerI; double iamult = 1 / holdingI - icmult; aresistance = (-icmult * ic + ia * iamult > 1) ? 0.0105 : 10E5; sim.stampResistor(lead_node[anode], lead_node[inode], aresistance); }
public override void step(Circuit sim) { diode.doStep(sim, lead_volt[0] - lead_volt[1]); }