本文整理匯總了C#中Circuit.stampCurrentSource方法的典型用法代碼示例。如果您正苦於以下問題:C# Circuit.stampCurrentSource方法的具體用法?C# Circuit.stampCurrentSource怎麽用?C# Circuit.stampCurrentSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Circuit
的用法示例。
在下文中一共展示了Circuit.stampCurrentSource方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: doStep
public void doStep(Circuit sim, double voltdiff)
{
// used to have .1 here, but needed .01 for peak detector
if(Math.Abs(voltdiff - lastvoltdiff) > 0.01)
sim.converged = false;
voltdiff = limitStep(sim, voltdiff, lastvoltdiff);
lastvoltdiff = voltdiff;
if(voltdiff >= 0 || zvoltage == 0) {
// regular diode or forward-biased zener
double eval = Math.Exp(voltdiff * vdcoef);
// make diode linear with negative voltages; aids convergence
if(voltdiff < 0)
eval = 1;
double geq = vdcoef * leakage * eval;
double nc = (eval - 1) * leakage - geq * voltdiff;
sim.stampConductance(nodes[0], nodes[1], geq);
sim.stampCurrentSource(nodes[0], nodes[1], nc);
} else {
// Zener diode
// I(Vd) = Is * (exp[Vd*C] - exp[(-Vd-Vz)*C] - 1 )
// geq is I'(Vd) nc is I(Vd) + I'(Vd)*(-Vd)
double geq = leakage * vdcoef * (Math.Exp(voltdiff * vdcoef) + Math.Exp((-voltdiff - zoffset) * vdcoef));
double nc = leakage * (Math.Exp(voltdiff * vdcoef) - Math.Exp((-voltdiff - zoffset) * vdcoef) - 1) + geq * (-voltdiff);
sim.stampConductance(nodes[0], nodes[1], geq);
sim.stampCurrentSource(nodes[0], nodes[1], nc);
}
}
示例2: step
public override void step(Circuit sim)
{
sim.stampCurrentSource(lead_node[0], lead_node[1], curSourceValue[0]);
sim.stampCurrentSource(lead_node[2], lead_node[3], curSourceValue[1]);
sim.stampCurrentSource(lead_node[3], lead_node[4], curSourceValue[2]);
}
示例3: step
public override void step(Circuit sim)
{
double voltdiff = lead_volt[0] - lead_volt[1];
if(Math.Abs(voltdiff - lastvoltdiff) > 0.01)
sim.converged = false;
voltdiff = limitStep(voltdiff, lastvoltdiff);
lastvoltdiff = voltdiff;
double i = pip * Math.Exp(-pvpp / pvt) * (Math.Exp(voltdiff / pvt) - 1)
+ pip * (voltdiff / pvp) * Math.Exp(1 - voltdiff / pvp) + piv
* Math.Exp(voltdiff - pvv);
double geq = pip * Math.Exp(-pvpp / pvt) * Math.Exp(voltdiff / pvt)
/ pvt + pip * Math.Exp(1 - voltdiff / pvp) / pvp
- Math.Exp(1 - voltdiff / pvp) * pip * voltdiff / (pvp * pvp)
+ Math.Exp(voltdiff - pvv) * piv;
double nc = i - geq * voltdiff;
sim.stampConductance(lead_node[0], lead_node[1], geq);
sim.stampCurrentSource(lead_node[0], lead_node[1], nc);
}
示例4: doStep
public void doStep(Circuit sim, double voltdiff)
{
sim.stampCurrentSource(nodes[0], nodes[1], curSourceValue);
}
示例5: step
public override void step(Circuit sim)
{
double voltdiff = lead_volt[0] - lead_volt[1];
sim.stampCurrentSource(nodes[0], nodes[1], curSourceValue);
}
示例6: stamp
public override void stamp(Circuit sim)
{
sim.stampCurrentSource(lead_node[0], lead_node[1], sourceCurrent);
}