/// <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); }
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); }
/// <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); }
/// <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(); }
/// <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); }
/// <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); } }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); } }
/// <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); }
/// <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); }
/// <summary> /// Registers the branch variable for the voltage source device /// </summary> /// <param name="adapter"></param> public void RegisterVariable(IEquationSystemAdapter adapter) { BranchVariable = adapter.AddVariable(); }
/// <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); }
/// <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); }
/// <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); }
/// <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 }
/// <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 }
/// <summary> /// Registers the branch variable for the voltage source device /// </summary> /// <param name="adapter"></param> public void RegisterVariable(IEquationSystemAdapter adapter) { voltage.RegisterVariable(adapter); }