Scrigroup - Documente si articole

Username / Parola inexistente      

Home Documente Upload Resurse Alte limbi doc  


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

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

Step Size Control Functions

c

+ Font mai mare | - Font mai mic



Step Size Control Functions

Table 3 lists the step size control functions. These functions allow you to choose the initial or current step size, the minimum and maximum allowable step sizes, whether fixed or variable step sizes will be used, and the method for choosing variable step sizes.

Table 3 Step Size Control Functions.




Function

Description

SetStepSize

Allows you to set the current step size.

SetH0

Sets the initial step size.

SetHMax

Sets the maximum step size.

SetHMin

Sets the minimum step size.

UseFixedStepSize

Tells the integrator to use a fixed step size.

UseVariableStepSize

Tells the integrator to use a variable step size.

UseRichardsonExtrapolation

Tells the integrator to use Richardson Extrapolation to set the variable step size.

UseEmbeddedFormula

Tells the integrator to use the Butcher Table’s embedded formula to set the variable step size.

SetStepSize

Usage

pInteg->SetStepSize();

pInteg->SetStepSize(h);

Arguments

Variable

Type

Description

h

double

(Optional) Value of the step size to use. Default: 0.01.

Return Value

None.

Notes

This function sets the step size for the current step. This will override the existing step size, so care must be taken. It should generally not be used once integration has begun and may cause errors if done.

SetH0

Usage

pInteg->SetH0();

pInteg->SetH0(h0);

Arguments

Variable

Type

Description

h0

double

(Optional) Value of the initial step size to use. Default: 0.0.

Return Value

None.

Notes

This function will set the initial step size for variable step size integration. If you supply a value of zero (the default), the integrator will try to determine the initial step size from the error tolerance.

SetHMax

Usage

pInteg->SetHMax();

pInteg->SetHMax(hMax);

Arguments

Variable

Type

Description

hMax

double

(Optional) Value of the maximum allowed step size.



Default: 100.0.

Return Value

None.

Notes

This function allows you to set the maximum variable step size to allow. If you supply a positive number, this is the value that will be used. If you enter a value of zero (the default) or negative, the routine first checks to see if the ODE has a default value defined. If the ODE has one, that value is used, otherwise the maximum is set to 100.0. Note that it is an error to try to set the maximum less than the minimum.

SetHMin

Usage

pInteg->SetHMin();

pInteg->SetHMin(hMin);

Arguments

Variable

Type

Description

hMin

double

(Optional) Value of the minimum allowed step size. Default: 10-6.

Return Value

None.

Notes

This function allows you to set the minimum variable step size to allow. If you supply a positive number, this is the value that will be used. If you enter a value of zero (the default) or negative, the routine first checks to see if the ODE has a default value defined. If the ODE has one, that value is used, otherwise the minimum is set to 10-6. Note that it is an error to try to set the maximum less than the minimum.

If you set the step size less than the minimum allowed an errorState_StepSizeTooSmall error will be set. However, if a variable step size selection would require a step size smaller than the minimum then an errorState_TooMuchAccuracy error will be set. In the latter case, you can use GetTolScaleFactor( to determine what you need to scale the absolute and relative tolerances by to achieve the minimum step size.

UseFixedStepSize

Usage

pInteg->UseFixedStepSize();

pInteg->UseFixedStepSize(h);

Arguments

Variable

Type

Description

h

double

(Optional) Value of the fixed step size to use. Default: 0.01.

Return Value

None.

Notes

This routine tells the integrator to use a fixed step size, and sets it to the optional input value. You can reset the value using SetStepSize( . Note that it is an error to change from variable to fixed step size control once integration has started.

The default is to use variable step size control, so this function must be called if you wish to perform fixed step size integration.

UseVariableStepSize

Usage

pInteg->UseVariableStepSize();

pInteg->UseVariableStepSize(h0);

Arguments

Variable

Type

Description

h

double

(Optional) Value of the initial step size to use. Default: 0.0.

Return Value

None.

Notes

This functions tells the integrator to use a variable step size, and will also set the initial step size with the value provided. If you supply a value of zero (the default), the integrator will try to determine the initial step size from the error tolerance. You can also reset the value of h0 using SetH0().The integrator will try to use an embedded formula for step size control if the method has one, otherwise it will try use Richardson Extrapolation. Note that it is an error to change from fixed to variable step size control once integration has started.

Variable step size control is the default method for this package.

UseRichardsonExtrapolation

Usage

pInteg->UseRichardsonExtrapolation();

Arguments

None.

Return Value

None.

Notes

This function tells the integrator to use Richardson Extrapolation to compute the local error of the solution. Richardson Extrapolation is an extremely accurate, although computationally expensive means of computing the local error. Each integration step is performed normally and then once again in two steps of half the original step size. The difference between these two solutions is a measure of the local error. The result, though, is that each step costs triple the number of function evaluations to perform.

UseEmbeddedFormula

Usage

pInteg->UseEmbeddedFormula();

Arguments

None.

Return Value

None.

Notes

This function tells the integrator to use the embedded formula contained in the Butcher Table to compute the local error of the solution. The embedded formula is not quite as accurate as Richardson Extrapolation, but computationally cheap. Each integration step is computed using two different formulas of different order (they typically differ by 1 order). The difference between these two solutions is a measure of the local error. Since the embedded formula typically requires only one or two additional function evaluations, it generally much more efficient than Richardson Extrapolation. The efficiency of the embedded formula outweighs the slightly better accuracy of the other method.

The solution at each step is usually carried out with the lower order formula. There are a number of newer methods that use Local Extrapolation whereby the higher order solution is retained. The accuracy of the local error estimate is no longer guaranteed, but is usually reasonably assured for most applications. See Section for more details on embedded formula and the Butcher Table.






Politica de confidentialitate



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 355
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 2021 . All rights reserved

Distribuie URL

Adauga cod HTML in site