Class FixedEuler.Instance
An IIntegrationMethod for FixedEuler.
Inherited Members
Namespace: SpiceSharp.Simulations.IntegrationMethods
Assembly: SpiceSharp.dll
Syntax
protected class FixedEuler.Instance : IIntegrationMethod, ISimulationState
Constructors
Instance(FixedEuler)
Initializes a new instance of the FixedEuler.Instance class.
Declaration
public Instance(FixedEuler parameters)
Parameters
Type | Name | Description |
---|---|---|
FixedEuler | parameters | The parameters. |
Properties
BaseTime
Gets the base timepoint in seconds from which the current timepoint is being probed.
Declaration
public double BaseTime { get; }
Property Value
Type | Description |
---|---|
double | The base time. |
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. |
Slope
Gets the derivative factor of any quantity that is being derived by the integration method.
Declaration
public double Slope { get; }
Property Value
Type | Description |
---|---|
double | The slope. |
Time
Gets the currently probed timepoint in seconds.
Declaration
public double Time { get; }
Property Value
Type | Description |
---|---|
double | The current time. |
Methods
Accept()
Accepts a solution at the current timepoint.
Declaration
public void Accept()
CreateDerivative(bool)
Creates a derivative.
Declaration
public IDerivative CreateDerivative(bool track = true)
Parameters
Type | Name | Description |
---|---|---|
bool | track | If set to |
Returns
Type | Description |
---|---|
IDerivative | The derivative. |
CreateIntegral(bool)
Creates an integrator.
Declaration
public IIntegral CreateIntegral(bool track = true)
Parameters
Type | Name | Description |
---|---|---|
bool | track | If set to |
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 bool Evaluate(double maxTimestep)
Parameters
Type | Name | Description |
---|---|---|
double | maxTimestep |
Returns
Type | Description |
---|---|
bool |
|
Remarks
This method ignores any timesteps!
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |
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 void Initialize()
Prepare()
Prepares the integration method for calculating the next timepoint.
Declaration
public void Prepare()
Probe()
Probes a new timepoint.
Declaration
public 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 void Reject()
Truncate(double)
Truncate the current timestep.
Declaration
public void Truncate(double maxTimestep)
Parameters
Type | Name | Description |
---|---|---|
double | maxTimestep |
Remarks
This method ignores any timesteps!
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if |