Class FrequencySimulation
A template for frequency-dependent analysis.
Inheritance
Implements
Inherited Members
Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public abstract class FrequencySimulation : BiasingSimulation, IStateful<TemperatureSimulationState>, IStateful<IIterationSimulationState>, IBehavioral<IBiasingUpdateBehavior>, IParameterized<BiasingParameters>, IFrequencySimulation, IBiasingSimulation, ISimulation<IVariable<double>>, ITemperatureSimulation, IStateful<ITemperatureSimulationState>, IBehavioral<ITemperatureBehavior>, IBehavioral<IBiasingBehavior>, IBehavioral<IConvergenceBehavior>, IStateful<IBiasingSimulationState>, ISimulation<IVariable<Complex>>, ISimulation, IParameterSetCollection, IParameterSet, IBehavioral<IFrequencyBehavior>, IStateful<IComplexSimulationState>, IStateful, IBehavioral<IFrequencyUpdateBehavior>, IBehavioral, IParameterized<FrequencyParameters>
Constructors
FrequencySimulation(string)
Initializes a new instance of the FrequencySimulation class.
Declaration
protected FrequencySimulation(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the simulation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
FrequencySimulation(string, IEnumerable<double>)
Initializes a new instance of the FrequencySimulation class.
Declaration
protected FrequencySimulation(string name, IEnumerable<double> frequencySweep)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the simulation. |
IEnumerable<double> | frequencySweep | The frequency points. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
Properties
FrequencyParameters
Gets the frequency parameters.
Declaration
public FrequencyParameters FrequencyParameters { get; }
Property Value
Type | Description |
---|---|
FrequencyParameters | The frequency parameters. |
Statistics
Gets the statistics.
Declaration
public ComplexSimulationStatistics Statistics { get; }
Property Value
Type | Description |
---|---|
ComplexSimulationStatistics | The statistics. |
Methods
AcIterate()
Iterate small-signal matrix and vector.
Declaration
protected void AcIterate()
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if a behavior cannot load the complex matrix and/or right hand side vector. |
SingularException | Thrown if the equation matrix is singular. |
CreateBehaviors(IEntityCollection)
Creates all behaviors for the simulation.
Declaration
protected override void CreateBehaviors(IEntityCollection entities)
Parameters
Type | Name | Description |
---|---|---|
IEntityCollection | entities | The entities. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
CreateStates()
Creates all the simulation states for the simulation.
Declaration
protected override void CreateStates()
Overrides
Execute(int)
Executes the simulation.
Declaration
protected override IEnumerable<int> Execute(int mask = 65535)
Parameters
Type | Name | Description |
---|---|---|
int | mask | A bit mask for simulation export identifiers. |
Returns
Type | Description |
---|---|
IEnumerable<int> |
Overrides
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if the simulation can't continue. |
FrequencyLoad()
Loads the Y-matrix and right hand side vector.
Declaration
protected void FrequencyLoad()
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if a behavior cannot load the complex matrix and/or right hand side vector. |
InitializeAcParameters()
Initializes the small-signal parameters.
Declaration
protected void InitializeAcParameters()
LoadFrequencyBehaviors()
Loads the Y-matrix and right hand side vector.
Declaration
protected virtual void LoadFrequencyBehaviors()
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if a behavior cannot load the complex matrix and/or right hand side vector. |
OnAfterFrequencyLoad(LoadStateEventArgs)
Raises the AfterFrequencyLoad event.
Declaration
protected virtual void OnAfterFrequencyLoad(LoadStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
LoadStateEventArgs | args | The LoadStateEventArgs instance containing the event data. |
OnBeforeFrequencyLoad(LoadStateEventArgs)
Raises the BeforeFrequencyLoad event.
Declaration
protected virtual void OnBeforeFrequencyLoad(LoadStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
LoadStateEventArgs | args | The LoadStateEventArgs instance containing the event data. |
Validate(IEntityCollection)
Validates the input.
Declaration
protected override void Validate(IEntityCollection entities)
Parameters
Type | Name | Description |
---|---|---|
IEntityCollection | entities | The entities. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
ValidationFailedException | Thrown if the validation failed. |
Events
AfterFrequencyLoad
Occurs after loading the matrix and right-hand side vector.
Declaration
public event EventHandler<LoadStateEventArgs> AfterFrequencyLoad
Event Type
Type | Description |
---|---|
EventHandler<LoadStateEventArgs> |
Remarks
For better performance you can also create an entity with a low priority that generates a frequency behavior.
BeforeFrequencyLoad
Occurs before loading the matrix and right-hand side vector.
Declaration
public event EventHandler<LoadStateEventArgs> BeforeFrequencyLoad
Event Type
Type | Description |
---|---|
EventHandler<LoadStateEventArgs> |
Remarks
For better performance you can also create an entity with a high priority that generates a frequency behavior.