Class VoltageSource
An independent voltage source.
Inheritance
Implements
Inherited Members
Namespace: SpiceSharp.Components
Assembly: SpiceSharp.dll
Syntax
[Pin(0, "V+")]
[Pin(1, "V-")]
[VoltageDriver(0, 1)]
public class VoltageSource : Component<IndependentSourceParameters>, IComponent, IEntity, IParameterSetCollection, IParameterSet, ICloneable<IEntity>, IParameterized<IndependentSourceParameters>, IRuleSubject
  Constructors
VoltageSource(string)
Initializes a new instance of the VoltageSource class.
Declaration
public VoltageSource(string name)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | name | The name  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if   | 
      
VoltageSource(string, string, string, IWaveformDescription)
Initializes a new instance of the VoltageSource class.
Declaration
public VoltageSource(string name, string pos, string neg, IWaveformDescription waveform)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | name | The name of the voltage source  | 
      
| string | pos | The positive node  | 
      
| string | neg | The negative node  | 
      
| IWaveformDescription | waveform | The waveform  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if   | 
      
VoltageSource(string, string, string, double)
Initializes a new instance of the VoltageSource class.
Declaration
public VoltageSource(string name, string pos, string neg, double dc)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | name | The name of the voltage source  | 
      
| string | pos | The positive node  | 
      
| string | neg | The negative node  | 
      
| double | dc | The DC value  | 
      
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if   | 
      
Fields
PinCount
The pin count for a voltage source.
Declaration
[ParameterName("pincount")]
[ParameterInfo("Number of pins")]
public const int PinCount = 2
  Field Value
| Type | Description | 
|---|---|
| int | 
Methods
CreateBehaviors(ISimulation)
Creates the behaviors and stores them in the specified container.
Declaration
public override void CreateBehaviors(ISimulation simulation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ISimulation | simulation | The simulation.  | 
      
Overrides
Exceptions
| Type | Condition | 
|---|---|
| ArgumentNullException | Thrown if   | 
      
| ArgumentException | Thrown if the simulation does not use an IComplexSimulationState.  | 
      
| TypeNotFoundException | Thrown if a required behavior or parameter set could not be found.  | 
      
| AmbiguousTypeException | Thrown if a behavior or parameter set could not be resolved unambiguously.  |