Class BiasingSimulation
A class that can bias components.
Inheritance
Implements
Inherited Members
Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public abstract class BiasingSimulation : Simulation, IBiasingSimulation, ISimulation<IVariable<double>>, ITemperatureSimulation, IEventfulSimulation, ISimulation, IParameterSetCollection, IParameterSet, IStateful<ITemperatureSimulationState>, IBehavioral<ITemperatureBehavior>, IBehavioral<IBiasingBehavior>, IBehavioral<IConvergenceBehavior>, IStateful<IBiasingSimulationState>, IStateful<TemperatureSimulationState>, IStateful<IIterationSimulationState>, IStateful, IBehavioral<IBiasingUpdateBehavior>, IBehavioral, IParameterized<BiasingParameters>
Constructors
BiasingSimulation(string)
Initializes a new instance of the BiasingSimulation class.
Declaration
protected BiasingSimulation(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the simulation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
See Also
Properties
BiasingParameters
Gets the biasing parameters.
Declaration
public BiasingParameters BiasingParameters { get; }
Property Value
Type | Description |
---|---|
BiasingParameters | The biasing parameters. |
See Also
Iteration
Gets the iteration state.
Declaration
protected BiasingSimulation.IterationState Iteration { get; }
Property Value
Type | Description |
---|---|
BiasingSimulation.IterationState | The iteration state. |
See Also
ProblemVariable
Gets the variable that causes issues.
Declaration
public IVariable ProblemVariable { get; protected set; }
Property Value
Type | Description |
---|---|
IVariable |
Remarks
This variable can be used to close in on the problem in case of non-convergence.
See Also
Statistics
Gets the statistics.
Declaration
public BiasingSimulationStatistics Statistics { get; }
Property Value
Type | Description |
---|---|
BiasingSimulationStatistics | The statistics. |
See Also
Methods
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 |
See Also
CreateStates()
Creates all the simulation states for the simulation.
Declaration
protected override void CreateStates()
Overrides
See Also
Execute()
Executes the simulation.
Declaration
protected override void Execute()
Overrides
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if the simulation can't continue. |
See Also
Finish()
Finish the simulation.
Declaration
protected override void Finish()
Overrides
See Also
IsConvergent()
Checks that the solution converges to a solution.
Declaration
protected bool IsConvergent()
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if a solution is not a number (NaN). |
See Also
Iterate(int)
Iterates towards a solution.
Declaration
protected virtual bool Iterate(int maxIterations)
Parameters
Type | Name | Description |
---|---|---|
int | maxIterations | The maximum allowed iterations. |
Returns
Type | Description |
---|---|
bool |
|
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if any behavior cannot load the matrix and/or right hand side vector, or if the solution is not a number (NaN). |
SingularException | Thrown if the equation matrix is singular. |
See Also
IterateDiagonalGminStepping(int, int)
Iterates to a solution while adding a conductive path to ground on all nodes.
Declaration
protected bool IterateDiagonalGminStepping(int maxIterations, int steps)
Parameters
Type | Name | Description |
---|---|---|
int | maxIterations | The maximum number of iterations per step. |
int | steps | The number of steps. |
Returns
Type | Description |
---|---|
bool |
|
See Also
IterateGminStepping(int, int)
Iterates to a solution while shunting PN-junctions with a conductance.
Declaration
protected bool IterateGminStepping(int maxIterations, int steps)
Parameters
Type | Name | Description |
---|---|---|
int | maxIterations | The maximum number of iterations per step. |
int | steps | The number of steps. |
Returns
Type | Description |
---|---|
bool |
|
See Also
IterateSourceStepping(int, int)
Iterates to a solution slowly ramping up independent voltages and currents.
Declaration
protected bool IterateSourceStepping(int maxIterations, int steps)
Parameters
Type | Name | Description |
---|---|---|
int | maxIterations | The maximum number of iterations per step. |
int | steps | The number of steps. |
Returns
Type | Description |
---|---|
bool |
|
See Also
Load()
Load the current simulation state solver.
Declaration
protected void Load()
Exceptions
Type | Condition |
---|---|
SpiceSharpException | Thrown if any behavior cannot load the matrix or right hand side vector. |
See Also
LoadNodeSets(object, LoadStateEventArgs)
Applies nodesets.
Declaration
protected void LoadNodeSets(object sender, LoadStateEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
object | sender | The object sending the event. |
LoadStateEventArgs | e | The event arguments for loading the convergence aids. |
See Also
OnAfterLoad(LoadStateEventArgs)
Raises the AfterLoad event.
Declaration
protected virtual void OnAfterLoad(LoadStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
LoadStateEventArgs | args | The LoadStateEventArgs instance containing the event data. |
See Also
OnAfterTemperature(TemperatureStateEventArgs)
Raises the AfterTemperature event.
Declaration
protected virtual void OnAfterTemperature(TemperatureStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
TemperatureStateEventArgs | args | The TemperatureStateEventArgs instance containing the event data. |
See Also
OnBeforeLoad(LoadStateEventArgs)
Raises the BeforeLoad event.
Declaration
protected virtual void OnBeforeLoad(LoadStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
LoadStateEventArgs | args | The LoadStateEventArgs instance containing the event data. |
See Also
OnBeforeTemperature(TemperatureStateEventArgs)
Raises the BeforeTemperature event.
Declaration
protected virtual void OnBeforeTemperature(TemperatureStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
TemperatureStateEventArgs | args | The TemperatureStateEventArgs instance containing the event data. |
See Also
Op(int)
Calculates the operating point of the circuit.
Declaration
protected void Op(int maxIterations)
Parameters
Type | Name | Description |
---|---|---|
int | maxIterations | The maximum amount of allowed iterations. |
See Also
StoreSolution()
Stores the solution.
Declaration
protected void StoreSolution()
See Also
Temperature()
Perform temperature-dependent calculations.
Declaration
protected void Temperature()
See Also
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. |
See Also
Events
AfterLoad
Occurs after loading the matrix and right-hand side vector.
Declaration
public event EventHandler<LoadStateEventArgs> AfterLoad
Event Type
Type | Description |
---|---|
EventHandler<LoadStateEventArgs> |
Remarks
For better performance, you can also create an entity with a low priority that generates a load behavior.
See Also
AfterTemperature
Occurs after performing temperature-dependent calculations.
Declaration
public event EventHandler<TemperatureStateEventArgs> AfterTemperature
Event Type
Type | Description |
---|---|
EventHandler<TemperatureStateEventArgs> |
Remarks
For better performance, you can also create an entity with a low priority that creates a temperature behavior.
See Also
BeforeLoad
Occurs before loading the matrix and right-hand side vector.
Declaration
public event EventHandler<LoadStateEventArgs> BeforeLoad
Event Type
Type | Description |
---|---|
EventHandler<LoadStateEventArgs> |
Remarks
For better performance, you can also create an entity with a high priority that generates a load behavior.
See Also
BeforeTemperature
Occurs before performing temperature-dependent calculations.
Declaration
public event EventHandler<TemperatureStateEventArgs> BeforeTemperature
Event Type
Type | Description |
---|---|
EventHandler<TemperatureStateEventArgs> |
Remarks
For better performance, you can also create an entity with a high priority that creates a temperature behavior.