当前位置: 首页>>代码示例>>C#>>正文


C# Circuit.stampCurrentSource方法代码示例

本文整理汇总了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);
            }
        }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:30,代码来源:Diode.cs

示例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]);
 }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:6,代码来源:TappedTransformer.cs

示例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);
 }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:18,代码来源:TunnelDiode.cs

示例4: doStep

 public void doStep(Circuit sim, double voltdiff)
 {
     sim.stampCurrentSource(nodes[0], nodes[1], curSourceValue);
 }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:4,代码来源:Inductor.cs

示例5: step

 public override void step(Circuit sim)
 {
     double voltdiff = lead_volt[0] - lead_volt[1];
     sim.stampCurrentSource(nodes[0], nodes[1], curSourceValue);
 }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:5,代码来源:InductorElm.cs

示例6: stamp

 public override void stamp(Circuit sim)
 {
     sim.stampCurrentSource(lead_node[0], lead_node[1], sourceCurrent);
 }
开发者ID:DotNetSparky,项目名称:SharpCircuit,代码行数:4,代码来源:CurrentSource.cs


注:本文中的Circuit.stampCurrentSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。