/// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            base.Setup(simulation, provider);
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            FrequencyParameters = provider.GetParameterSet <CommonBehaviors.IndependentFrequencyParameters>();
        }
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp  = provider.GetParameterSet <BaseParameters>();
            _mbp = provider.GetParameterSet <ModelBaseParameters>("model");

            // Get behaviors
            _temp      = provider.GetBehavior <TemperatureBehavior>();
            _load      = provider.GetBehavior <LoadBehavior>();
            _modeltemp = provider.GetBehavior <ModelTemperatureBehavior>("model");

            if (simulation is TimeSimulation ts)
            {
                _method = ts.Method;
            }
        }
Beispiel #3
0
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">The simulation</param>
        /// <param name="provider">The setup data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            BaseParameters = provider.GetParameterSet <BaseParameters>();
            provider.TryGetParameterSet("model", out ModelBaseParameters mbp);
            ModelParameters = mbp;
        }
Beispiel #4
0
        /// <summary>
        /// Setup the behavior.
        /// </summary>
        /// <param name="simulation">The simulation.</param>
        /// <param name="provider">The data provider.</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            base.Setup(simulation, provider);

            provider.ThrowIfNull(nameof(provider));

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>();

            // Get transient
            _tran = provider.GetBehavior <TransientBehavior>();
        }
Beispiel #5
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="provider">Data provider</param>
        public override void Setup(SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>("entity");

            // Get behaviors
            _load = provider.GetBehavior <LoadBehavior>("entity");
        }
Beispiel #6
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            BaseParameters = provider.GetParameterSet <BaseParameters>();

            // Get behaviors (0 = CCCS behaviors, 1 = VSRC behaviors)
            VoltageLoad = provider.GetBehavior <VoltageSourceBehaviors.BiasingBehavior>("control");
        }
Beispiel #7
0
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>();

            // Get behaviors
            _vsrcload = provider.GetBehavior <VoltageSourceBehaviors.LoadBehavior>("control");
        }
Beispiel #8
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get configurations
            _baseConfig = simulation.Configurations.Get <BaseConfiguration>();

            // Get parameters
            _bp  = provider.GetParameterSet <BaseParameters>();
            _mbp = provider.GetParameterSet <ModelBaseParameters>("model");

            // Get behaviors
            _temp      = provider.GetBehavior <TemperatureBehavior>();
            _modeltemp = provider.GetBehavior <ModelTemperatureBehavior>("model");

            // Reset
            SaturationVoltageDs = 0.0;
            Von = 0.0;
        }
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            provider.ThrowIfNull(nameof(provider));

            // Get parameters
            BaseParameters = provider.GetParameterSet <BaseParameters>();

            ModelBaseParameters modelParameters;

            if (provider.TryGetParameterSet <ModelBaseParameters>("model", out modelParameters))
            {
                ModelParameters = modelParameters;
            }
        }
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            base.Setup(simulation, provider);
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>();

            // Get behaviors
            _base = provider.GetBehavior <BiasingBehavior>();
        }
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _ap = provider.GetParameterSet <FrequencyParameters>();

            // Calculate the AC vector
            var radians = _ap.AcPhase * Math.PI / 180.0;

            _ac = new Complex(_ap.AcMagnitude * Math.Cos(radians), _ap.AcMagnitude * Math.Sin(radians));
        }
Beispiel #12
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="provider">Data provider</param>
        public override void Setup(SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>("entity");

            // Give some warnings if no value is given
            if (!_bp.DcValue.Given)
            {
                // no DC value - either have a transient value or none
                CircuitWarning.Warning(this,
                                       _bp.Waveform != null
                        ? "{0} has no DC value, transient time 0 value used".FormatString(Name)
                        : "{0} has no value, DC 0 assumed".FormatString(Name));
            }
        }
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            var ap = provider.GetParameterSet <FrequencyParameters>();

            // Calculate AC vector
            var radians = ap.AcPhase * Math.PI / 180.0;

            Ac = new Complex(ap.AcMagnitude * Math.Cos(radians), ap.AcMagnitude * Math.Sin(radians));

            // Get behaviors
            var load = provider.GetBehavior <LoadBehavior>();

            _branchEq = load.BranchEq;
        }
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            base.Setup(simulation, provider);
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            BaseParameters = provider.GetParameterSet <BaseParameters>();

            // Clear all events
            if (UpdateFlux != null)
            {
                foreach (var inv in UpdateFlux.GetInvocationList())
                {
                    UpdateFlux -= (EventHandler <UpdateFluxEventArgs>)inv;
                }
            }
        }
Beispiel #15
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            provider.ThrowIfNull(nameof(provider));

            // Get parameters
            BaseParameters = provider.GetParameterSet <CommonBehaviors.IndependentSourceParameters>();

            // Setup the waveform
            BaseParameters.Waveform?.Setup();

            // Give some warnings if no value is given
            if (!BaseParameters.DcValue.Given)
            {
                // no DC value - either have a transient value or none
                CircuitWarning.Warning(this,
                                       BaseParameters.Waveform != null
                        ? "{0} has no DC value, transient time 0 value used".FormatString(Name)
                        : "{0} has no value, DC 0 assumed".FormatString(Name));
            }
        }
Beispiel #16
0
        /// <summary>
        /// Setup behavior
        /// </summary>
        /// <param name="provider">Data provider</param>
        public override void Setup(SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>("entity");

            // Get behaviors
            _load = provider.GetBehavior <LoadBehavior>("entity");

            // Clear all events
            if (UpdateFlux != null)
            {
                foreach (var inv in UpdateFlux.GetInvocationList())
                {
                    UpdateFlux -= (EventHandler <UpdateFluxEventArgs>)inv;
                }
            }
        }
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            // Get parameters
            _bp = provider.GetParameterSet <BaseParameters>();

            // Setup the waveform
            _bp.Waveform?.Setup();

            // Calculate the voltage source's complex value
            if (!_bp.DcValue.Given)
            {
                // No DC value: either have a transient value or none
                CircuitWarning.Warning(this,
                                       _bp.Waveform != null
                        ? "{0}: No DC value, transient time 0 value used".FormatString(Name)
                        : "{0}: No value, DC 0 assumed".FormatString(Name));
            }
        }
Beispiel #18
0
        /// <summary>
        /// Setup the behavior
        /// </summary>
        /// <param name="simulation">Simulation</param>
        /// <param name="provider">Data provider</param>
        public override void Setup(Simulation simulation, SetupDataProvider provider)
        {
            provider.ThrowIfNull(nameof(provider));

            // Get parameters
            BaseParameters = provider.GetParameterSet <CommonBehaviors.IndependentSourceParameters>();

            // Setup the waveform
            BaseParameters.Waveform?.Setup();

            if (!BaseParameters.DcValue.Given)
            {
                // No DC value: either have a transient value or none
                if (BaseParameters.Waveform != null)
                {
                    CircuitWarning.Warning(this, "{0}: No DC value, transient time 0 value used".FormatString(Name));
                    BaseParameters.DcValue.RawValue = BaseParameters.Waveform.Value;
                }
                else
                {
                    CircuitWarning.Warning(this, "{0}: No value, DC 0 assumed".FormatString(Name));
                }
            }
        }
 // Get the base parameters
 public override void Setup(Simulation simulation, SetupDataProvider provider)
 {
     _baseConfig = simulation.Configurations.Get <BaseConfiguration>();
     _bp         = provider.GetParameterSet <BaseParameters>();
 }