本文整理汇总了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);
}