當前位置: 首頁>>代碼示例>>C#>>正文


C# Circuit.stampVoltageSource方法代碼示例

本文整理匯總了C#中Circuit.stampVoltageSource方法的典型用法代碼示例。如果您正苦於以下問題:C# Circuit.stampVoltageSource方法的具體用法?C# Circuit.stampVoltageSource怎麽用?C# Circuit.stampVoltageSource使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Circuit的用法示例。


在下文中一共展示了Circuit.stampVoltageSource方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: stamp

 public override void stamp(Circuit sim)
 {
     if (waveform == WaveType.DC) {
         sim.stampVoltageSource(0, lead_node[0], voltSource, getVoltage(sim));
     } else {
         sim.stampVoltageSource(0, lead_node[0], voltSource);
     }
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:8,代碼來源:VoltageInput.cs

示例2: stamp

 public override void stamp(Circuit sim)
 {
     // output pin
     sim.stampVoltageSource(0, lead_node[1], pins[1].voltSource);
     // attach Vi to R1 pin so its current is proportional to Vi
     sim.stampVoltageSource(lead_node[0], lead_node[4], pins[4].voltSource, 0);
     // attach 5V to R2 pin so we get a current going
     sim.stampVoltageSource(0, lead_node[5], pins[5].voltSource, 5);
     // put resistor across cap pins to give current somewhere to go
     // in case cap is not connected
     sim.stampResistor(lead_node[2], lead_node[3], cResistance);
     sim.stampNonLinear(lead_node[2]);
     sim.stampNonLinear(lead_node[3]);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:14,代碼來源:VCOElm.cs

示例3: getVoltageText

 /*public override void getInfo(String[] arr) {
     arr[0] = (gain == 1) ? "CCII+" : "CCII-";
     arr[1] = "X,Y = " + getVoltageText(lead_volt[0]);
     arr[2] = "Z = " + getVoltageText(lead_volt[2]);
     arr[3] = "I = " + getCurrentText(pins[0].current);
 }*/
 // boolean nonLinear() { return true; }
 public override void stamp(Circuit sim)
 {
     // X voltage = Y voltage
     sim.stampVoltageSource(0, lead_node[0], pins[0].voltSource);
     sim.stampVCVS(0, lead_node[1], 1, pins[0].voltSource);
     // Z current = gain * X current
     sim.stampCCCS(0, lead_node[2], pins[0].voltSource, gain);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:15,代碼來源:CC2Elm.cs

示例4: step

 public override void step(Circuit sim)
 {
     bool v1 = lead_volt[0] > 2.5;
     bool v2 = lead_volt[1] > 2.5;
     if(v1 && !pins[0].value)
         ff1 = true;
     if(v2 && !pins[1].value)
         ff2 = true;
     if(ff1 && ff2)
         ff1 = ff2 = false;
     double @out = (ff1) ? 5 : (ff2) ? 0 : -1;
     // System.out.println(out + " " + v1 + " " + v2);
     if(@out != -1) {
         sim.stampVoltageSource(0, lead_node[2], pins[2].voltSource, @out);
     } else {
         // tie current through output pin to 0
         int vn = sim.nodeCount + pins[2].voltSource;
         sim.stampMatrix(vn, vn, 1);
     }
     pins[0].value = v1;
     pins[1].value = v2;
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:22,代碼來源:PhaseCompElm.cs

示例5: stamp

 public override void stamp(Circuit sim)
 {
     sim.stampVoltageSource(0, lead_node[inputCount], voltSource);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:4,代碼來源:LogicGate.cs

示例6: stamp

 public override void stamp(Circuit sim)
 {
     // stamp voltage divider to put ctl pin at 2/3 V
     sim.stampResistor(lead_node[N_VIN], lead_node[N_CTL], 5000);
     sim.stampResistor(lead_node[N_CTL], 0, 10000);
     // output pin
     sim.stampVoltageSource(0, lead_node[N_OUT], pins[N_OUT].voltSource);
     // discharge pin
     sim.stampNonLinear(lead_node[N_DIS]);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:10,代碼來源:TimerElm.cs

示例7: stamp

 public override void stamp(Circuit sim)
 {
     sim.stampVoltageSource(0, lead_node[3], voltSource);
     sim.stampNonLinear(lead_node[3]);
     sim.stampNonLinear(lead_node[1]);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:6,代碼來源:TriStateBuffer.cs

示例8: stamp

 public override void stamp(Circuit sim)
 {
     if(position == 0)
         sim.stampVoltageSource(lead_node[0], lead_node[1], voltSource, 0);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:5,代碼來源:SwitchSPST.cs

示例9: stamp

 public override void stamp(Circuit sim)
 {
     for(int i = 0; i != getLeadCount(); i++) {
         Pin p = pins[i];
         if(p.output)
             sim.stampVoltageSource(0, lead_node[i], p.voltSource);
     }
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:8,代碼來源:Chip.cs

示例10: stamp

 public override void stamp(Circuit sim)
 {
     sim.stampVoltageSource(0, lead_node[0], voltSource, 0);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:4,代碼來源:Ground.cs

示例11: stamp

 public override void stamp(Circuit sim)
 {
     sim.stampVoltageSource(lead_node[4], lead_node[0], voltSource1);
     sim.stampVoltageSource(lead_node[5], lead_node[1], voltSource2);
     sim.stampResistor(lead_node[2], lead_node[4], impedance);
     sim.stampResistor(lead_node[3], lead_node[5], impedance);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:7,代碼來源:TransLineElm.cs

示例12: stamp

 public override void stamp(Circuit sim)
 {
     double v = (position == 0) ? lowVoltage : highVoltage;
     if(isTernary) v = position * 2.5;
     sim.stampVoltageSource(0, lead_node[0], voltSource, v);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:6,代碼來源:LogicInput.cs

示例13: stamp

 public override void stamp(Circuit sim)
 {
     if(position == 2) return; // in center?
     sim.stampVoltageSource(lead_node[0], lead_node[position + 1], voltSource, 0);
 }
開發者ID:DotNetSparky,項目名稱:SharpCircuit,代碼行數:5,代碼來源:SwitchSPDT.cs


注:本文中的Circuit.stampVoltageSource方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。