Show / Hide Table of Contents

Class SpiceMethod.SpiceInstance

An instance of a Spice-based integration method.

Inheritance
object
SpiceMethod.SpiceInstance
Gear.Instance
Trapezoidal.Instance
Implements
IBreakpointMethod
IIntegrationMethod
ISimulationState
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SpiceSharp.Simulations.IntegrationMethods
Assembly: SpiceSharp.dll
Syntax
protected abstract class SpiceMethod.SpiceInstance : IBreakpointMethod, IIntegrationMethod, ISimulationState

Constructors

SpiceInstance(SpiceMethod, IBiasingSimulationState, int)

Initializes a new instance of the SpiceMethod.SpiceInstance class.

Declaration
protected SpiceInstance(SpiceMethod parameters, IBiasingSimulationState state, int maxOrder)
Parameters
Type Name Description
SpiceMethod parameters

The method description.

IBiasingSimulationState state

The biasing simulation state.

int maxOrder

The maximum order.

Properties

BaseTime

Gets the base timepoint in seconds from which the current timepoint is being probed.

Declaration
public double BaseTime { get; protected set; }
Property Value
Type Description
double

The base time.

Break

Gets a value indicating whether this point is the first after a breakpoint.

Declaration
public bool Break { get; }
Property Value
Type Description
bool

Breakpoints

Gets the breakpoint system.

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

Delta

Declaration
public double Delta { get; protected set; }
Property Value
Type Description
double

MaxOrder

Gets the maximum order of the integration method.

Declaration
public int MaxOrder { get; }
Property Value
Type Description
int

The maximum order.

Order

Gets or sets the current order of the integration method.

Declaration
public int Order { get; set; }
Property Value
Type Description
int

The current order.

Parameters

Gets the parameters.

Declaration
protected SpiceMethod Parameters { get; }
Property Value
Type Description
SpiceMethod

The parameters.

Prediction

Gets the prediction.

Declaration
protected IVector<double> Prediction { get; }
Property Value
Type Description
IVector<double>

The prediction.

RegisteredStates

Gets the registered states.

Declaration
protected List<IIntegrationState> RegisteredStates { get; }
Property Value
Type Description
List<IIntegrationState>

The registered states.

Slope

Gets the derivative factor of any quantity that is being derived by the integration method.

Declaration
public double Slope { get; protected set; }
Property Value
Type Description
double

The slope.

State

Gets the simulation state that keeps track of the simulation.

Declaration
protected IBiasingSimulationState State { get; }
Property Value
Type Description
IBiasingSimulationState

The simulation.

States

Gets the history of integration states.

Declaration
protected IHistory<SpiceIntegrationState> States { get; }
Property Value
Type Description
IHistory<SpiceIntegrationState>

The history of integration states.

Time

Gets the currently probed timepoint in seconds.

Declaration
public double Time { get; protected set; }
Property Value
Type Description
double

The current time.

TruncatableStates

Gets the truncatable states.

Declaration
protected List<ITruncatable> TruncatableStates { get; }
Property Value
Type Description
List<ITruncatable>

The truncatable states.

Methods

Accept()

Accepts a solution at the current timepoint.

Declaration
public virtual void Accept()

ComputeCoefficients()

Computes the integration coefficients.

Declaration
protected abstract void ComputeCoefficients()

CreateDerivative(bool)

Creates a derivative.

Declaration
public abstract IDerivative CreateDerivative(bool track = true)
Parameters
Type Name Description
bool track

If set to true, the integration method will use this state to limit truncation errors.

Returns
Type Description
IDerivative

The derivative.

CreateIntegral(bool)

Creates an integrator.

Declaration
public abstract IIntegral CreateIntegral(bool track = true)
Parameters
Type Name Description
bool track

If set to true, the integration method will use this state to limit truncation errors.

Returns
Type Description
IIntegral

The integrator.

Evaluate(double)

Evaluates the current solution at the probed timepoint. If the solution is invalid, the analysis should roll back and try again.

Declaration
public virtual bool Evaluate(double maxTimestep)
Parameters
Type Name Description
double maxTimestep
Returns
Type Description
bool

true if the current solution is a valid solution; otherwise, false.

Exceptions
Type Condition
ArgumentException

Thrown if maxTimestep is not positive.

TimestepTooSmallException

Thrown when the timestep is too small.

GetPreviousSolution(int)

Gets a previous solution used by the integration method. An index of 0 indicates the last accepted solution.

Declaration
public IVector<double> GetPreviousSolution(int index)
Parameters
Type Name Description
int index

The number of points to go back.

Returns
Type Description
IVector<double>

The previous solution.

GetPreviousTimestep(int)

Gets a previous timestep. An index of 0 indicates the current timestep.

Declaration
public double GetPreviousTimestep(int index)
Parameters
Type Name Description
int index

The number of points to go back.

Returns
Type Description
double

The previous timestep.

Initialize()

Initializes the integration method using the allocated biasing state. At this point, all entities should have received the chance to allocate and register integration states.

Declaration
public virtual void Initialize()

Predict()

Predicts a solution for truncation.

Declaration
protected abstract void Predict()

Prepare()

Prepares the integration method for calculating the next timepoint.

Declaration
public virtual void Prepare()

Probe()

Probes a new timepoint.

Declaration
public virtual void Probe()

RegisterState(IIntegrationState)

Registers an integration state with the integration method.

Declaration
public void RegisterState(IIntegrationState state)
Parameters
Type Name Description
IIntegrationState state

The integration state.

Reject()

Rejects the last probed timepoint as a valid solution. This method can be called if no solution could be found (eg. due to non-convergence).

Declaration
public virtual void Reject()
Exceptions
Type Condition
TimestepTooSmallException

Thrown when the timestep became too small.

Truncate(double)

Truncate the current timestep.

Declaration
public void Truncate(double maxTimestep)
Parameters
Type Name Description
double maxTimestep
Exceptions
Type Condition
ArgumentException

Thrown if maxTimestep is not positive.

Implements

IBreakpointMethod
IIntegrationMethod
ISimulationState

Extension Methods

Utility.ThrowIfNull<T>(T, string)

See Also

IBreakpointMethod
In this article
Back to top Generated by DocFX