Example #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);
 }
Example #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);
 }
Example #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);
 }
Example #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();
 }
Example #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);
        }
Example #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;
        }
        /// <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);
            }
        }
Example #8
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)
        {
            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);
        }
Example #9
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, 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);
        }
Example #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);
        }
Example #11
0
        /// <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);
        }
Example #12
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)
        {
            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);
        }
Example #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);
        }
Example #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;
        }
        /// <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);
            }
        }
Example #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);
 }
Example #17
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)
 {
     this.anode   = adapter.GetRightHandSideCoefficientProxy(anode);
     this.cathode = adapter.GetRightHandSideCoefficientProxy(cathode);
 }
Example #18
0
 /// <summary>
 ///   Registers the branch variable for the voltage source device
 /// </summary>
 /// <param name="adapter"></param>
 public void RegisterVariable(IEquationSystemAdapter adapter)
 {
     BranchVariable = adapter.AddVariable();
 }
Example #19
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="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);
 }
Example #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);
 }
Example #21
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, ampermeter.BranchVariable);
 }
Example #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
 }
Example #23
0
 /// <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);
 }
 public RedirectingEquationEditor(int[] nodeMap, IEquationSystemAdapter decoreated) : base(nodeMap)
 {
     this.decoreated = decoreated;
 }
 /// <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);
 /// <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
 }
Example #27
0
 /// <summary>
 ///   Registers the branch variable for the voltage source device
 /// </summary>
 /// <param name="adapter"></param>
 public void RegisterVariable(IEquationSystemAdapter adapter)
 {
     voltage.RegisterVariable(adapter);
 }