CATEGORII DOCUMENTE |
Asp | Autocad | C | Dot net | Excel | Fox pro | Html | Java |
Linux | Mathcad | Photoshop | Php | Sql | Visual studio | Windows | Xml |
Table 5 lists the error tolerance control functions. These functions determine what the tolerances will be, and tell the integrator which norm to use. Two tolerance criteria are used to determine whether to accept a variable step size step. An estimate of the local error is computed and compared to the absolute and relative tolerance values. The integrator tries to find a step size small enough such that for the current step
(2-1)
where error is the local error estimate, AbsTol is the absolute tolerance requirement, RelTol is the relative tolerance requirement, and solution is the current estimate of the solution. Note that AbsTol and RelTol are both vectors, which allows you to specify a different tolerance for each component of the ODE. You can specify a single value, which will then be used for all components. The integrator can use the 2-norm or -norm (default) in the computation above.
Note that either of the absolute or relative tolerances may be set to zero, but not both at once. It is an error to set either less than zero. The relative tolerance typically dominates the error computation unless the solution is near zero, in which case the absolute tolerance dominates.
Table 5 Error Tolerance Control Functions.
Function |
Description |
SetAbsTol |
Set the absolute error tolerance. |
SetRelTol |
Set the relative error tolerance. |
SetTolerance |
Set the absolute and relative error tolerances simultaneously. |
UseRSSNorm |
Tell the integrator to use the root-sum-square (RSS) norm (2-norm) for computing the error tolerance. |
UseInfNorm |
Tell the integrator to use the maximum error value ( -norm) for computing the error tolerance. |
pInteg->SetAbsTol(cvAbsTol);
pInteg->SetAbsTol(fAbsTol);
Variable |
Type |
Description |
cvAbsTol |
colvec |
Column vector of absolute tolerance values. |
fAbsTol |
double |
Single value for the absolute tolerance. |
None.
Either of the forms of SetAbsTol( may be used. The first requires a column vector the same dimension as the state vector. Each element individually defines the absolute tolerance requirement of the corresponding element of the state vector. In the second form, the same value will be used for all elements of the state vector. It is an error to set both the absolute and relative tolerances to zero, or either one negative.
pInteg->SetRelTol(cvRelTol);
pInteg->SetRelTol(fRelTol);
Variable |
Type |
Description |
|
cvRelTol |
colvec |
Column vector of relative tolerance values. |
|
fRelTol |
double |
Single value for the relative tolerance. |
None.
Either of the forms of SetRelTol( may be used. The first requires a column vector the same dimension as the state vector. Each element individually defines the relative tolerance requirement of the corresponding element of the state vector. In the second form, the same value will be used for all elements of the state vector. It is an error to set both the absolute and relative tolerances to zero, or either one negative.
pInteg->SetTolerance(cvAbsTol, cvRelTol);
pInteg->SetTolerance(fAbsTol, fRelTol);
pInteg->SetTolerance();
Variable |
Type |
Description |
cvAbsTol |
colvec |
Column vector of absolute tolerance values. |
cvRelTol |
colvec |
Column vector of relative tolerance values. |
fAbsTol |
double |
Single value for the absolute tolerance. Default: -1.0. |
fRelTol |
double |
Single value for the relative tolerance. Default: -1.0. |
None.
Any of the forms of SetTolerance( may be used. The first requires two column vectors the same dimension as the state vector. Each element individually defines the absolute and relative tolerance requirements of the corresponding element of the state vector. In the second form, the same tolerance values will be used for all elements of the state vector. It is an error to set both the absolute and relative tolerances to zero. However, if you supply a negative value for either input then default values will be used. If the ODE supplies a default value, that will be used first. If not, then the integrator default values (10-6 for AbsTol and 10-4 for RelTol) will be used instead.
pInteg->UseRSSNorm();
None.
None.
This function tells the integrator to use the 2-norm (root-sum-square magnitude) for computing the error tolerance.
pInteg->UseInfNorm();
None.
None.
This function tells the integrator to use the -norm (largest value) for computing the error tolerance.
Politica de confidentialitate | Termeni si conditii de utilizare |
Vizualizari: 969
Importanta:
Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved