當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。