Show / Hide Table of Contents

Class BiasingSimulation

A class that can bias components.

Inheritance
object
ParameterSet
ParameterSetCollection
Simulation
BiasingSimulation
DC
FrequencySimulation
OP
Transient
Implements
IBiasingSimulation
ISimulation<IVariable<double>>
ITemperatureSimulation
ISimulation
IParameterSetCollection
IParameterSet
IStateful<ITemperatureSimulationState>
IBehavioral<ITemperatureBehavior>
IBehavioral<IBiasingBehavior>
IBehavioral<IConvergenceBehavior>
IStateful<IBiasingSimulationState>
IStateful<TemperatureSimulationState>
IStateful<IIterationSimulationState>
IStateful
IBehavioral<IBiasingUpdateBehavior>
IBehavioral
IParameterized<BiasingParameters>
Inherited Members
Simulation.Exports
Simulation.Actions
Simulation.AfterSetup
Simulation.AfterValidation
Simulation.BeforeExecute
Simulation.AfterExecute
Simulation.Status
Simulation.States
Simulation.Behaviors
Simulation.Name
Simulation.CurrentRun
Simulation.Repeat
Simulation.EntityBehaviors
Simulation.Run(IEntityCollection, int)
Simulation.Rerun(int)
Simulation.Validate(IRules, IEntityCollection)
Simulation.UsesBehaviors<B>()
Simulation.UsesBehavior(Type)
Simulation.GetState<S>()
Simulation.TryGetState<S>(out S)
Simulation.UsesState<S>()
ParameterSetCollection.GetParameterSet<P>()
ParameterSetCollection.TryGetParameterSet<P>(out P)
ParameterSetCollection.ParameterSets
ParameterSetCollection.SetParameter<P>(string, P)
ParameterSetCollection.TrySetParameter<P>(string, P)
ParameterSetCollection.GetProperty<P>(string)
ParameterSetCollection.TryGetProperty<P>(string, out P)
ParameterSetCollection.CreateParameterSetter<P>(string)
ParameterSetCollection.CreatePropertyGetter<P>(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SpiceSharp.Simulations
Assembly: SpiceSharp.dll
Syntax
public abstract class BiasingSimulation : Simulation, IBiasingSimulation, ISimulation<IVariable<double>>, ITemperatureSimulation, 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 name is null.

Fields

AfterTemperature

Represents the action after doing temperature-dependent calculations.

Declaration
public const int AfterTemperature = 1048576
Field Value
Type Description
int

Properties

BiasingParameters

Gets the biasing parameters.

Declaration
public BiasingParameters BiasingParameters { get; }
Property Value
Type Description
BiasingParameters

The biasing parameters.

Iteration

Gets the iteration state.

Declaration
protected BiasingSimulation.IterationState Iteration { get; }
Property Value
Type Description
BiasingSimulation.IterationState

The iteration state.

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.

Statistics

Gets the statistics.

Declaration
public BiasingSimulationStatistics Statistics { get; }
Property Value
Type Description
BiasingSimulationStatistics

The statistics.

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
Simulation.CreateBehaviors(IEntityCollection)
Exceptions
Type Condition
ArgumentNullException

Thrown if entities is null.

CreateStates()

Creates all the simulation states for the simulation.

Declaration
protected override void CreateStates()
Overrides
Simulation.CreateStates()

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
Simulation.Execute(int)
Exceptions
Type Condition
SpiceSharpException

Thrown if the simulation can't continue.

Finish()

Finish the simulation.

Declaration
protected override void Finish()
Overrides
Simulation.Finish()

IsConvergent()

Checks that the solution converges to a solution.

Declaration
protected bool IsConvergent()
Returns
Type Description
bool

true if the solution converges; otherwise, false.

Exceptions
Type Condition
SpiceSharpException

Thrown if a solution is not a number (NaN).

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

true if the iterations converged to a solution; otherwise, false.

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.

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

true if the diagonal gmin stepping succeeded; otherwise false.

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

true if the gmin stepping succeeded; otherwise false.

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

true if source stepping succeeded; otherwise false.

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.

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.

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.

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.

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.

StoreSolution()

Stores the solution.

Declaration
protected void StoreSolution()

Validate(IEntityCollection)

Validates the input.

Declaration
protected override void Validate(IEntityCollection entities)
Parameters
Type Name Description
IEntityCollection entities

The entities.

Overrides
Simulation.Validate(IEntityCollection)
Exceptions
Type Condition
ArgumentNullException

Thrown if entities is null.

ValidationFailedException

Thrown if the validation failed.

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.

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.

Implements

IBiasingSimulation
ISimulation<V>
ITemperatureSimulation
ISimulation
IParameterSetCollection
IParameterSet
IStateful<S>
IBehavioral<B>
IBehavioral<B>
IBehavioral<B>
IStateful<S>
IStateful<S>
IStateful<S>
IStateful
IBehavioral<B>
IBehavioral
IParameterized<P>

Extension Methods

Documentation.ParameterValues<T>(IParameterSet, bool)
Documentation.Parameters(IParameterSet)
Documentation.ParameterValues<T>(IParameterSetCollection, bool)
Documentation.Parameters(IParameterSetCollection)
Utility.ThrowIfNull<T>(T, string)
SimulationHelper.GetComplexCurrent(ISimulation, Reference)
SimulationHelper.GetComplexProperty(ISimulation, Reference, string)
SimulationHelper.GetComplexVoltage(ISimulation, Reference)
SimulationHelper.GetComplexVoltage(ISimulation, Reference, Reference)
SimulationHelper.GetCurrent(ISimulation, Reference)
SimulationHelper.GetProperty(ISimulation, Reference, string)
SimulationHelper.GetVoltage(ISimulation, Reference)
SimulationHelper.GetVoltage(ISimulation, Reference, Reference)
SimulationHelper.RunToEnd(ISimulation, IEntityCollection, IDictionary<int, Action>)
SimulationHelper.TryGetComplexCurrent(ISimulation, Reference, out Complex)
SimulationHelper.TryGetComplexProperty(ISimulation, Reference, string, out Complex)
SimulationHelper.TryGetComplexVoltage(ISimulation, Reference, Reference, out Complex)
SimulationHelper.TryGetComplexVoltage(ISimulation, Reference, out Complex)
SimulationHelper.TryGetCurrent(ISimulation, Reference, out double)
SimulationHelper.TryGetProperty(ISimulation, Reference, string, out double)
SimulationHelper.TryGetVoltage(ISimulation, Reference, Reference, out double)
SimulationHelper.TryGetVoltage(ISimulation, Reference, out double)

See Also

Simulation
IBiasingSimulation
IStateful<S>
TemperatureSimulationState
IIterationSimulationState
IBiasingUpdateBehavior
IBehavioral<B>
IParameterized<P>
In this article
Back to top Generated by DocFX