コード例 #1
0
        /// <inheritdoc/>
        protected void UpdateTime(object sender, MosfetContributionEventArgs args)
        {
            if (_time.UseDc)
            {
                return;
            }
            var c   = args.Contributions;
            var vgs = _behavior.Vgs;
            var vds = _behavior.Vds;
            var vbs = _behavior.Vbs;
            var vgd = vgs - vds;
            var vgb = vgs - vbs;

            // Update the charges and capacitances
            _charges.Calculate(_behavior, _mp);

            // Bulk junction capacitances
            _qbd.Value = _charges.Qbd;
            _qbd.Derive();
            c.Bd.G += _qbd.GetContributions(_charges.Cbd).Jacobian;
            c.Bd.C += _qbd.Derivative;
            c.Ds.C -= _qbd.Derivative;

            _qbs.Value = _charges.Qbs;
            _qbs.Derive();
            c.Bs.G += _qbs.GetContributions(_charges.Cbs).Jacobian;
            c.Bs.C += _qbs.Derivative;

            // Gate capacitances
            var GateSourceOverlapCap = _mp.GateSourceOverlapCapFactor * _behavior.Parameters.ParallelMultiplier * _behavior.Parameters.Width;
            var GateDrainOverlapCap  = _mp.GateDrainOverlapCapFactor * _behavior.Parameters.ParallelMultiplier * _behavior.Parameters.Width;
            var GateBulkOverlapCap   = _mp.GateBulkOverlapCapFactor * _behavior.Parameters.ParallelMultiplier * _behavior.Properties.EffectiveLength;

            var vgs1 = _vgs.GetPreviousValue(1);
            var vgd1 = vgs1 - _vds.GetPreviousValue(1);
            var vgb1 = vgs1 - _vbs.GetPreviousValue(1);

            _cgs.Value = _charges.Cgs;
            var capgs = _charges.Cgs + _cgs.GetPreviousValue(1) + GateSourceOverlapCap;

            _cgd.Value = _charges.Cgd;
            var capgd = _charges.Cgd + _cgd.GetPreviousValue(1) + GateDrainOverlapCap;

            _cgb.Value = _charges.Cgb;
            var capgb = _charges.Cgb + _cgb.GetPreviousValue(1) + GateBulkOverlapCap;

            _vgs.Value = vgs;
            _vds.Value = vds;
            _vbs.Value = vbs;
            _qgs.Value = (vgs - vgs1) * capgs + _qgs.GetPreviousValue(1);
            _qgd.Value = (vgd - vgd1) * capgd + _qgd.GetPreviousValue(1);
            _qgb.Value = (vgb1 - vgb1) * capgb + _qgb.GetPreviousValue(1);

            _qgs.Derive();
            var info = _qgs.GetContributions(capgs, vgs);

            c.Gs.G += info.Jacobian;
            c.Gs.C += info.Rhs;

            _qgd.Derive();
            info    = _qgd.GetContributions(capgd, vgd);
            c.Gd.G += info.Jacobian;
            c.Gd.C += info.Rhs;

            _qgb.Derive();
            info    = _qgb.GetContributions(capgb, vgb);
            c.Gb.G += info.Jacobian;
            c.Gb.C += info.Rhs;
        }