Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context)
            : base(context)
        {
            context.Nodes.CheckNodes(4);

            // Get configurations
            BaseConfiguration = context.GetSimulationParameterSet <BiasingParameters>();

            // Get states
            Iteration      = context.GetState <IIterationSimulationState>();
            CollectorPrime = BiasingState.GetSharedVariable(context.Nodes[0]);
            BasePrime      = BiasingState.GetSharedVariable(context.Nodes[1]);
            EmitterPrime   = BiasingState.GetSharedVariable(context.Nodes[2]);
            _collectorNode = BiasingState.Map[CollectorPrime];
            _baseNode      = BiasingState.Map[BasePrime];
            _emitterNode   = BiasingState.Map[EmitterPrime];

            // Add a series collector node if necessary
            if (ModelParameters.CollectorResistance > 0)
            {
                CollectorPrime = BiasingState.CreatePrivateVariable(Name.Combine("col"), Units.Volt);
            }
            _collectorPrimeNode = BiasingState.Map[CollectorPrime];

            // Add a series base node if necessary
            if (ModelParameters.BaseResist > 0)
            {
                BasePrime = BiasingState.CreatePrivateVariable(Name.Combine("base"), Units.Volt);
            }
            _basePrimeNode = BiasingState.Map[BasePrime];

            // Add a series emitter node if necessary
            if (ModelParameters.EmitterResistance > 0)
            {
                EmitterPrime = BiasingState.CreatePrivateVariable(Name.Combine("emit"), Units.Volt);
            }
            _emitterPrimeNode = BiasingState.Map[EmitterPrime];

            // Get solver pointers
            _elements = new ElementSet <double>(BiasingState.Solver, new[] {
                new MatrixLocation(_collectorNode, _collectorNode),
                new MatrixLocation(_baseNode, _baseNode),
                new MatrixLocation(_emitterNode, _emitterNode),
                new MatrixLocation(_collectorPrimeNode, _collectorPrimeNode),
                new MatrixLocation(_basePrimeNode, _basePrimeNode),
                new MatrixLocation(_emitterPrimeNode, _emitterPrimeNode),
                new MatrixLocation(_collectorNode, _collectorPrimeNode),
                new MatrixLocation(_baseNode, _basePrimeNode),
                new MatrixLocation(_emitterNode, _emitterPrimeNode),
                new MatrixLocation(_collectorPrimeNode, _collectorNode),
                new MatrixLocation(_collectorPrimeNode, _basePrimeNode),
                new MatrixLocation(_collectorPrimeNode, _emitterPrimeNode),
                new MatrixLocation(_basePrimeNode, _baseNode),
                new MatrixLocation(_basePrimeNode, _collectorPrimeNode),
                new MatrixLocation(_basePrimeNode, _emitterPrimeNode),
                new MatrixLocation(_emitterPrimeNode, _emitterNode),
                new MatrixLocation(_emitterPrimeNode, _collectorPrimeNode),
                new MatrixLocation(_emitterPrimeNode, _basePrimeNode)
            }, new[] { _collectorPrimeNode, _basePrimeNode, _emitterPrimeNode });
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Temperature"/> class.
 /// </summary>
 /// <param name="context">The context.</param>
 /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
 public Temperature(IComponentBindingContext context)
     : base(context)
 {
     context.ThrowIfNull(nameof(context));
     _temperature      = context.GetState <ITemperatureSimulationState>();
     ModelParameters   = context.ModelBehaviors.GetParameterSet <ModelParameters>();
     ModelTemperature  = context.ModelBehaviors.GetValue <ModelTemperature>();
     BiasingParameters = context.GetSimulationParameterSet <BiasingParameters>();
     Parameters        = context.GetParameterSet <Parameters>();
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The binding context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context)
            : base(context)
        {
            var state = context.GetState <IBiasingSimulationState>();

            _config    = context.GetSimulationParameterSet <BiasingParameters>();
            _iteration = context.GetState <IIterationSimulationState>();
            _args      = new MosfetContributionEventArgs(_contributions);
            context.TryGetState(out _time);
            context.TryGetState(out _method);
            _variables = new MosfetVariables <double>(context, state);

            // Get matrix pointers
            _elements = new ElementSet <double>(state.Solver,
                                                _variables.GetMatrixLocations(state.Map),
                                                _variables.GetRhsIndices(state.Map));
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context)
            : base(context)
        {
            context.Nodes.CheckNodes(3);

            BiasingParameters = context.GetSimulationParameterSet <BiasingParameters>();
            _iteration        = context.GetState <IIterationSimulationState>();
            context.TryGetState(out _time);
            context.TryGetState(out _method);

            DrainPrime  = BiasingState.GetSharedVariable(context.Nodes[0]);
            _drainNode  = BiasingState.Map[DrainPrime];
            _gateNode   = BiasingState.Map[BiasingState.GetSharedVariable(context.Nodes[1])];
            SourcePrime = BiasingState.GetSharedVariable(context.Nodes[2]);
            _sourceNode = BiasingState.Map[SourcePrime];

            if (ModelParameters.DrainResistance > 0)
            {
                DrainPrime = BiasingState.CreatePrivateVariable(Name.Combine("drain"), Units.Volt);
            }
            _drainPrimeNode = BiasingState.Map[DrainPrime];

            if (ModelParameters.SourceResistance > 0)
            {
                SourcePrime = BiasingState.CreatePrivateVariable(Name.Combine("source"), Units.Volt);
            }
            _sourcePrimeNode = BiasingState.Map[SourcePrime];

            _elements = new ElementSet <double>(BiasingState.Solver, new[] {
                new MatrixLocation(_drainNode, _drainPrimeNode),
                new MatrixLocation(_gateNode, _drainPrimeNode),
                new MatrixLocation(_gateNode, _sourcePrimeNode),
                new MatrixLocation(_sourceNode, _sourcePrimeNode),
                new MatrixLocation(_drainPrimeNode, _drainNode),
                new MatrixLocation(_drainPrimeNode, _gateNode),
                new MatrixLocation(_drainPrimeNode, _sourcePrimeNode),
                new MatrixLocation(_sourcePrimeNode, _gateNode),
                new MatrixLocation(_sourcePrimeNode, _sourceNode),
                new MatrixLocation(_sourcePrimeNode, _drainPrimeNode),
                new MatrixLocation(_drainNode, _drainNode),
                new MatrixLocation(_gateNode, _gateNode),
                new MatrixLocation(_sourceNode, _sourceNode),
                new MatrixLocation(_drainPrimeNode, _drainPrimeNode),
                new MatrixLocation(_sourcePrimeNode, _sourcePrimeNode)
            }, new[] { _gateNode, _drainPrimeNode, _sourcePrimeNode });
        }
Esempio n. 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Biasing"/> class.
        /// </summary>
        /// <param name="context">The binding context.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="context"/> is <c>null</c>.</exception>
        public Biasing(IComponentBindingContext context)
            : base(context)
        {
            var state = context.GetState <IBiasingSimulationState>();

            _config    = context.GetSimulationParameterSet <BiasingParameters>();
            _iteration = context.GetState <IIterationSimulationState>();
            _args      = new MosfetContributionEventArgs(_contributions);
            context.TryGetState(out _time);
            context.TryGetState(out _method);

            _variables = new MosfetVariables <double>(Name, state, context.Nodes,
                                                      !ModelParameters.DrainResistance.Equals(0.0) || !ModelParameters.SheetResistance.Equals(0.0) && Parameters.DrainSquares > 0,
                                                      !ModelParameters.SourceResistance.Equals(0.0) || !ModelParameters.SheetResistance.Equals(0.0) && Parameters.SourceSquares > 0);

            // Get matrix pointers
            _elements = new ElementSet <double>(state.Solver,
                                                _variables.GetMatrixLocations(state.Map),
                                                _variables.GetRhsIndices(state.Map));
        }