コード例 #1
0
 /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 /// <param name="ranode">Index of reference anode terminal.</param>
 /// <param name="rcathode">Index of reference cathode terminal.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode, int ranode, int rcathode)
 {
     nara = adapter.GetMatrixCoefficientProxy(anode, ranode);
     ncra = adapter.GetMatrixCoefficientProxy(cathode, ranode);
     narc = adapter.GetMatrixCoefficientProxy(anode, rcathode);
     ncrc = adapter.GetMatrixCoefficientProxy(cathode, rcathode);
 }
コード例 #2
0
 public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
 {
     // get proxies
     voltage.Register(adapter, Anode, Cathode);
     currentStamper.Register(adapter, Anode, Cathode);
     conductanceStamper.Register(adapter, Anode, Cathode);
 }
コード例 #3
0
 /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
 {
     n11 = adapter.GetMatrixCoefficientProxy(anode, anode);
     n12 = adapter.GetMatrixCoefficientProxy(anode, cathode);
     n21 = adapter.GetMatrixCoefficientProxy(cathode, anode);
     n22 = adapter.GetMatrixCoefficientProxy(cathode, cathode);
 }
コード例 #4
0
 /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
 /// <param name="adapter">The equation system builder.</param>
 /// <param name="context">Context of current simulation.</param>
 public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
 {
     stamper.Register(adapter, Anode, Cathode);
     voltage.Register(adapter, Anode, Cathode);
     firstDcPoint      = true;
     IntegrationMethod = context.SimulationParameters.IntegrationMethodFactory.CreateInstance();
 }
コード例 #5
0
        /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
        /// <param name="adapter">The equation system builder.</param>
        /// <param name="context">Context of current simulation.</param>
        public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
        {
            stamper.Register(adapter, bprimeNode, cprimeNode, eprimeNode);

            voltageBc.Register(adapter, bprimeNode, cprimeNode);
            voltageBe.Register(adapter, bprimeNode, eprimeNode);
            voltageCs.Register(adapter, cprimeNode, Substrate);

            capacbe.Register(adapter, bprimeNode, eprimeNode);
            capacbc.Register(adapter, bprimeNode, cprimeNode);
            capaccs.Register(adapter, cprimeNode, Substrate);

            chargebe = context.SimulationParameters.IntegrationMethodFactory.CreateInstance();
            chargebc = context.SimulationParameters.IntegrationMethodFactory.CreateInstance();
            chargecs = context.SimulationParameters.IntegrationMethodFactory.CreateInstance();

            gb.Register(adapter, bprimeNode, Base);
            gc.Register(adapter, cprimeNode, Collector);
            ge.Register(adapter, eprimeNode, Emitter);

            vT = PhysicalConstants.Boltzmann *
                 PhysicalConstants.CelsiusToKelvin(Parameters.NominalTemperature) /
                 PhysicalConstants.DevicearyCharge;

            VoltageBaseEmitter = DeviceHelpers.PnCriticalVoltage(Parameters.SaturationCurrent, vT);
        }
コード例 #6
0
        /// <summary>Allows devices to register any additional variables.</summary>
        /// <param name="adapter">The equation system builder.</param>
        public override void RegisterAdditionalVariables(IEquationSystemAdapter adapter)
        {
            base.RegisterAdditionalVariables(adapter);

            bprimeNode = Parameters.BaseResistance > 0 ? adapter.AddVariable() : Base;
            cprimeNode = Parameters.CollectorResistance > 0 ? adapter.AddVariable() : Collector;
            eprimeNode = Parameters.EmitterCapacitance > 0 ? adapter.AddVariable() : Emitter;
        }
コード例 #7
0
        /// <summary>Allows devices to register any additional variables.</summary>
        /// <param name="adapter">The equation system builder.</param>
        public override void RegisterAdditionalVariables(IEquationSystemAdapter adapter)
        {
            base.RegisterAdditionalVariables(adapter);

            foreach (var model in devices)
            {
                model.RegisterAdditionalVariables(adapter);
            }
        }
コード例 #8
0
ファイル: InductorStamper.cs プロジェクト: rzikm/NextGenSpice
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="anode">Index of anode terminal.</param>
        /// <param name="cathode">Index of cathode terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
        {
            voltage.Register(adapter, anode, cathode);
            currentStamper.Register(adapter, anode, cathode);
            n13 = adapter.GetMatrixCoefficientProxy(anode, BranchVariable);
            n23 = adapter.GetMatrixCoefficientProxy(cathode, BranchVariable);
            n33 = adapter.GetMatrixCoefficientProxy(BranchVariable, BranchVariable);

            r3 = adapter.GetRightHandSideCoefficientProxy(BranchVariable);
        }
コード例 #9
0
ファイル: CcvsStamper.cs プロジェクト: rzikm/NextGenSpice
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="anode">Index of anode terminal.</param>
        /// <param name="cathode">Index of cathode terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int anode, int cathode, int refBranch)
        {
            n14 = adapter.GetMatrixCoefficientProxy(anode, BranchVariable);
            n24 = adapter.GetMatrixCoefficientProxy(cathode, BranchVariable);
            n41 = adapter.GetMatrixCoefficientProxy(BranchVariable, anode);
            n42 = adapter.GetMatrixCoefficientProxy(BranchVariable, cathode);
            n43 = adapter.GetMatrixCoefficientProxy(BranchVariable, refBranch);

            solution = adapter.GetSolutionProxy(BranchVariable);
        }
コード例 #10
0
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="anode">Index of anode terminal.</param>
        /// <param name="cathode">Index of cathode terminal.</param>
        /// <param name="ranode">Index of reference anode terminal.</param>
        /// <param name="rcathode">Index of reference cathode terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int anode, int cathode, int ranode, int rcathode)
        {
            nab  = adapter.GetMatrixCoefficientProxy(anode, BranchVariable);
            ncb  = adapter.GetMatrixCoefficientProxy(cathode, BranchVariable);
            nba  = adapter.GetMatrixCoefficientProxy(BranchVariable, anode);
            nbc  = adapter.GetMatrixCoefficientProxy(BranchVariable, cathode);
            nbra = adapter.GetMatrixCoefficientProxy(BranchVariable, ranode);
            nbrc = adapter.GetMatrixCoefficientProxy(BranchVariable, rcathode);

            cur = adapter.GetSolutionProxy(BranchVariable);
        }
コード例 #11
0
ファイル: BjtStamper.cs プロジェクト: rzikm/NextGenSpice
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="nBase">Index of base terminal.</param>
        /// <param name="nCollector">Index of collector terminal.</param>
        /// <param name="nEmitter">Index of emitter terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int nBase, int nCollector, int nEmitter)
        {
            gbc_.Register(adapter, nBase, nCollector);
            gbe_.Register(adapter, nBase, nEmitter);

            gmf_.Register(adapter, nCollector, nEmitter, nBase, nEmitter);
            gmr_.Register(adapter, nCollector, nEmitter, nEmitter, nCollector);

            ibe.Register(adapter, nBase, nEmitter);
            ibc.Register(adapter, nBase, nCollector);
        }
コード例 #12
0
ファイル: VoltageStamper.cs プロジェクト: rzikm/NextGenSpice
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="anode">Index of anode terminal.</param>
        /// <param name="cathode">Index of cathode terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
        {
            n13 = adapter.GetMatrixCoefficientProxy(anode, BranchVariable);
            n23 = adapter.GetMatrixCoefficientProxy(cathode, BranchVariable);
            n31 = adapter.GetMatrixCoefficientProxy(BranchVariable, anode);
            n32 = adapter.GetMatrixCoefficientProxy(BranchVariable, cathode);

            br = adapter.GetRightHandSideCoefficientProxy(BranchVariable);

            solution = adapter.GetSolutionProxy(BranchVariable);
        }
コード例 #13
0
        /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
        /// <param name="adapter">The equation system adapter.</param>
        /// <param name="anode">Index of anode terminal.</param>
        /// <param name="cathode">Index of cathode terminal.</param>
        public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
        {
            nba = adapter.GetMatrixCoefficientProxy(BranchVariable, anode);
            nbc = adapter.GetMatrixCoefficientProxy(BranchVariable, cathode);
            nab = adapter.GetMatrixCoefficientProxy(anode, BranchVariable);
            ncb = adapter.GetMatrixCoefficientProxy(cathode, BranchVariable);
            nbb = adapter.GetMatrixCoefficientProxy(BranchVariable, BranchVariable);

            nb = adapter.GetRightHandSideCoefficientProxy(BranchVariable);

            sol = adapter.GetSolutionProxy(BranchVariable);
        }
コード例 #14
0
        /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
        /// <param name="adapter">The equation system builder.</param>
        /// <param name="context">Context of current simulation.</param>
        public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
        {
            stamper.Register(adapter, Anode, Cathode);
            capacitorStamper.Register(adapter, Anode, Cathode);
            voltage.Register(adapter, Anode, Cathode);

            initialConditionCapacitor = true;
            IntegrationMethod         = context.SimulationParameters.IntegrationMethodFactory.CreateInstance();

            vt = Parameters.EmissionCoefficient * PhysicalConstants.Boltzmann *
                 PhysicalConstants.CelsiusToKelvin(Parameters.NominalTemperature) /
                 PhysicalConstants.DevicearyCharge;

            var iS = Parameters.SaturationCurrent;
            var n  = Parameters.EmissionCoefficient;

            Voltage = DefinitionDevice.VoltageHint ?? 0;
        }
コード例 #15
0
        /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
        /// <param name="adapter">The equation system builder.</param>
        /// <param name="context">Context of current simulation.</param>
        public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
        {
            for (var i = 1; i < nodeMap.Length; i++)
            {
                nodeMap[i] = -1;
            }

            for (var i = 0; i < DefinitionDevice.TerminalNodes.Length; i++)
            {
                nodeMap[DefinitionDevice.TerminalNodes[i]] = DefinitionDevice.ConnectedNodes[i];
            }

            for (var i = 1; i < nodeMap.Length; i++)
            {
                nodeMap[i] = nodeMap[i] < 0 ? adapter.AddVariable() : nodeMap[i];
            }

            var decorator = new RedirectingEquationEditor(nodeMap, adapter);

            foreach (var model in devices)
            {
                model.Initialize(decorator, context);
            }
        }
コード例 #16
0
 /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
 /// <param name="adapter">The equation system builder.</param>
 /// <param name="context">Context of current simulation.</param>
 public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
 {
     stamper.Register(adapter, Anode, Cathode);
     voltage.Register(adapter, Anode, Cathode);
 }
コード例 #17
0
ファイル: CurrentStamper.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
 {
     this.anode   = adapter.GetRightHandSideCoefficientProxy(anode);
     this.cathode = adapter.GetRightHandSideCoefficientProxy(cathode);
 }
コード例 #18
0
ファイル: CcvsStamper.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>
 ///   Registers the branch variable for the voltage source device
 /// </summary>
 /// <param name="adapter"></param>
 public void RegisterVariable(IEquationSystemAdapter adapter)
 {
     BranchVariable = adapter.AddVariable();
 }
コード例 #19
0
ファイル: CccsStamper.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 /// <param name="branch">Index of variable containing the reference current.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode, int branch)
 {
     na = adapter.GetMatrixCoefficientProxy(anode, branch);
     nc = adapter.GetMatrixCoefficientProxy(cathode, branch);
 }
コード例 #20
0
 /// <summary>Allows devices to register any additional variables.</summary>
 /// <param name="adapter">The equation system builder.</param>
 public override void RegisterAdditionalVariables(IEquationSystemAdapter adapter)
 {
     base.RegisterAdditionalVariables(adapter);
     stamper.RegisterVariable(adapter);
 }
コード例 #21
0
ファイル: LargeSignalCcvs.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
 /// <param name="adapter">The equation system builder.</param>
 /// <param name="context">Context of current simulation.</param>
 public override void Initialize(IEquationSystemAdapter adapter, ISimulationContext context)
 {
     stamper.Register(adapter, Anode, Cathode, ampermeter.BranchVariable);
 }
コード例 #22
0
 /// <summary>Registeres the equation system coefficient proxies into the stamper.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
 {
     cond.Register(adapter, anode, cathode);
     current.Register(adapter, cathode, anode);             // current faces the other way
 }
コード例 #23
0
ファイル: VoltageProxy.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>Registeres the equation system solution proxies.</summary>
 /// <param name="adapter">The equation system adapter.</param>
 /// <param name="anode">Index of anode terminal.</param>
 /// <param name="cathode">Index of cathode terminal.</param>
 public void Register(IEquationSystemAdapter adapter, int anode, int cathode)
 {
     this.anode   = adapter.GetSolutionProxy(anode);
     this.cathode = adapter.GetSolutionProxy(cathode);
 }
コード例 #24
0
 public RedirectingEquationEditor(int[] nodeMap, IEquationSystemAdapter decoreated) : base(nodeMap)
 {
     this.decoreated = decoreated;
 }
コード例 #25
0
 /// <summary>Performs necessary initialization of the device, like mapping to the equation system.</summary>
 /// <param name="adapter">The equation system builder.</param>
 /// <param name="context">Context of current simulation.</param>
 public abstract void Initialize(IEquationSystemAdapter adapter, ISimulationContext context);
コード例 #26
0
 /// <summary>Allows devices to register any additional variables.</summary>
 /// <param name="adapter">The equation system builder.</param>
 public virtual void RegisterAdditionalVariables(IEquationSystemAdapter adapter)
 {
     // no registration default
 }
コード例 #27
0
ファイル: InductorStamper.cs プロジェクト: rzikm/NextGenSpice
 /// <summary>
 ///   Registers the branch variable for the voltage source device
 /// </summary>
 /// <param name="adapter"></param>
 public void RegisterVariable(IEquationSystemAdapter adapter)
 {
     voltage.RegisterVariable(adapter);
 }