Scrigroup - Documente si articole

     

HomeDocumenteUploadResurseAlte limbi doc
AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

Functions to Check the Error State

c



+ Font mai mare | - Font mai mic



Functions to Check the Error State

Table 15 lists the functions which allow you to check the error state of the integrator.



Table 15. Functions to Check the Error State.

Function

Description

IntegratorIsReady

Returns true if the integrator is ready to operate without any errors.

IntegratorHasError

Returns true if the integrator has encountered an error during operation.

IntegratorHasBadInput

Returns true if the integrator has received illegal or inconsistent input.

ErrorStateIsSet

Checks to see if a specific error state is currently set.

InputErrorIsSet

Checks to see if a specific illegal input flag is currently set.

GetIntegratorState

Returns the current integrator state.

GetIntegratorStateString

Returns a string describing the current integrator state.

GetIllegalInputString

Returns a string describing the illegal input state.

GetErrorStateString

Returns a string describing the current error state.

IntegratorIsReady

Usage

if ( pInteg->IntegratorIsReady() ).

Arguments

None.

Return Value

Type

Description

bool

Returns true if the integrator is ready to operate.

Notes

This function returns true if the integrator is ready to operate, i.e., has not encountered an error or terminal event. Note, however, that if the integrator has received illegal input, integration can proceed even though this function will return true.

IntegratorHasError

Usage

if ( pInteg->IntegratorHasError() ).

Arguments

None.

Return Value

Type

Description

bool

Returns true if the integrator has encountered any errors.

Notes

This function returns true if the integrator has encountered any errors during setup or during the course of integration. Integration will not proceed until the error is corrected. You can use ErrorStateIsSet() to see which of the various error states are set.

IntegratorHasBadInput

Usage

if ( pInteg->IntegratorHasBadInput() ).

Arguments

None.

Return Value

Type

Description

bool

Returns true if the integrator has received illegal input.

Notes

This function returns true if the integrator has received illegal input. When the integrator receives illegal input, the original values are left unchanged while this flag is set. Integration is still allowed to proceed even if this is the case. You can use InputErrorIsSet() to see which of the various input error states are set.

ErrorStateIsSet

Usage

if ( pInteg->ErrorStateIsSet(whichError) ).

Arguments

Variable

Type

Description

whichError

EErrorState

Value of the error state to be queried. See Table 16.

Return Value

Type

Description

bool

Returns true if the specified error is set, false otherwise.

Notes

Use this function to see if a specific error state is set. Table 16 lists the valid error states and their meanings. The constant kNumErrorStates specifies the number of legal error states that have been defined.

InputErrorIsSet

Usage

if ( pInteg->InputErrorIsSet(whichError) ).

Arguments

Variable

Type

Description

whichError

EIllegalInput

Value of the error state to be queried. See Table 17.

Return Value

Type

Description

bool

Returns true if the specified error is set, false otherwise.

Notes

Use this function to see if a specific error state is set. Table 17 lists the valid error states and their meanings. The constant kNumInputErrorStates specifies the number of legal input error states that have been defined.

Table 16. Defined error states. Integration cannot proceed until all errors are cleared.

Error State

Meaning and Remedy

errorState_TooMuchAccuracy

Unable to meet the accuracy requirements with the minimum step size. Increase tolerance with SetAbsTol() SetRelTol(), or decrease minimum step size with SetHMin()

errorState_TooManyRejects

Rejected too many step size selections. Increase the number of allowable rejected steps using SetMaxRejectedSteps()

errorState_TooManySteps

Took too many steps to finish integration. Increase the number of allowable steps using SetMaxSteps()

errorState_StepSizeTooSmall

Specified step size is less than the minimum allowed. Increase the step size using SetStepSize() or decrease the minimum allowed step size using SetHMin()

errorState_NotEnoughMemory

Insufficient memory available (not implemented).

errorState_ATolRTol_Eq_0

Absolute and relative tolerances are both set to zero. Increase either or both tolerances using SetAbsTol() SetRelTol()

errorState_PastTFinal

Tried to integrate past the final requested output time. Add additional requested output times using AppendTOut()

errorState_ChangedStepSizeControl

Tried to change between variable and fixed step size selection methods after integration started. Reset this error using ClearStepSizeControlError()

errorState_ICsNotDefined

Initial conditions have not been defined yet. Use SetICs()

errorState_TOutNotDefined

Requested output times have not been defined yet. Use SetTOut()

errorState_BrentZeroSearchFailed

The Brent Zero Search failed to find a solution for the event finding routine.

errorState_ODEHasError

The ODE has generated an error.

errorState_ImplicitUnsupported

Implicit methods are no longer supported.

Table 17. Illegal input states. Integration may proceed. Clear all errors using ClearIllegalInputFlags().

Illegal Input State

Meaning and Remedy

illegalInput_H0_LT_0

Requested a negative initial step size. Specify a legal h0 using SetH0()

illegalInput_H0TooLate

Tried to set h0 after integration started. Clear the error using ClearH0TooLateFlag()

illegalInput_HMax_LE_0

Tried to set a negative maximum step size. Specify a legal hmax using SetHMax()

illegalInput_HMin_LE_0

Tried to set a negative minimum step size. Specify a legal hmin using SetHMin()

illegalInput_HMax_LT_HMin

Tried to set the maximum step size less than the minimum step size. Correct this by specifying a new hmin or hmax using SetHMin() or SetHMax(), respectively.

illegalInput_T0TooLate

Tried to set t0 after integration started. Clear the error using ClearT0TooLateFlag()

illegalInput_MaxStep_LE_0

Tried to set a zero or negative number of maximum allowable steps. Specify a legal value using SetMaxSteps()

illegalInput_MaxReject_LE_0

Tried to set a zero or negative number of maximum allowable step size rejections. Specify a legal value using SetMaxRejectedSteps()

illegalInput_ATol_LT_0

Requested a negative absolute tolerance. Specify a legal value using SetAbsTol().

illegalInput_RTol_LT_0

Requested a negative relative tolerance. Specify a legal value using SetRelTol().

illegalInput_ICsTooLate

Tried to set initial conditions after integration started. Clear the error using ClearICsTooLateFlag()

illegalInput_TOutTooLate

Tried to set requested output times after integration started. Clear the error using ClearTOutTooLateFlag()

illegalInput_IllegalTOut

Requested illegal output times (typically not monotonic). Specify a valid set using SetTOut()

illegalInput_WrongNumICs

Provided the incorrect number of initial conditions and the ODE does not have a default set. Specify a valid number of IC's using SetICs()

illegalInput_NoEmbeddedFormula

The Butcher Table does not have an embedded formula and you called UseEmbeddedFormula(). Reset by calling UseRichardsonExtrapolation()

illegalInput_IllegalT0

The specified t0 is inconsistent with the requested output times (after first tout or in the wrong direction). Specify a legal value using SetT0()

illegalInput_EventsNotSupported

Tried to use event handling with a Butcher Table that does not have dense output. Reset this flag by calling UseEvents(false).

GetIntegratorState

Usage

state = pInteg->GetIntegratorState();

Arguments

None.

Return Value

Type

Description

EIntegratorState

State of the integrator.

Notes

This function lets you query the state of the integrator. It provides a starting point for determining any problems with the integrator. The constant kNumIntegratorStates specifies the number of defined states. Table 18 lists the valid values for the integrator state.

GetIntegratorStateString

Usage

cout << pInteg->GetIntegratorStateString();

Arguments

None.

Return Value

Type

Description

string

Descriptive string regarding the current integrator state.

Notes

This function returns a single string describing the current state of the integrator corresponding to the meanings listed in Table 18.

Table 18. Integrator state values. Values are listed in order of precedence.

Integrator State

Meaning

integratorState_Ready

The integrator is ready to integrate.

integratorState_Initialization

The integrator has not completed initialization yet.

integratorState_Error

An error has occurred which prevents further integration until remedied.

integratorState_TerminalEvent

A terminal event has been encountered. You can clear this using ResetTerminalEvent()

GetIllegalInputString

Usage

cout << pInteg->GetIllegalInputString();

Arguments

None.

Return Value

Type

Description

string

Descriptive string regarding the illegal input states of the integrator.

Notes

This function returns a string describing the illegal input errors as listed in Table 17. There will be one line in the string for each illegal input flag that is currently set.

GetErrorStateString

Usage

cout << pInteg->GetErrorStateString();

Arguments

None.

Return Value

Type

Description

string

Descriptive string regarding the error states of the integrator.

Notes

This function returns a string describing the errors as listed in Table 16. There will be one line in the string for each error state that is currently set.



Politica de confidentialitate | Termeni si conditii de utilizare



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 1023
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved