fdiscont - numerically find the discontinuities of a function over the Reals
|
Calling Sequence
|
|
fdiscont(f, domain, res, ivar, eqns)
|
|
Parameters
|
|
f
|
-
|
algebraic expression or a procedure
|
domain
|
-
|
the domain of interest
|
res
|
-
|
the desired resolution
|
ivar
|
-
|
the independent variable name
|
eqns
|
-
|
optional equations
|
|
|
|
|
Description
|
|
•
|
fdiscont attempts to return a list of ranges, each of width res, in which there appears to be a discontinuity in the function or its first derivative. fdiscont works via the application of divided differences. This method will not locate point discontinuities, nor can it differentiate between cusps and singularities or jump discontinuities. Note that absolute success is not guaranteed. In addition, ranges may be larger than res due to overlapping results, which are coalesced.
|
•
|
fdiscont can be fooled by dense oscillatory functions (such as on ); if features are found that are not expected, the resolution, res, should be made smaller. If too few singularities are found, res should be made smaller, or in the evalhf case, the amount of internal storage (see number below) should be increased.
|
•
|
fdiscont uses evalhf when possible. However, in this instance, the number of ranges returned is limited by the size of the internal work array. Use the number option to change this limit.
|
•
|
f may be an algebraic expression in ivar or a procedure. If f is algebraic, then ivar must be specified in ivar or domain (see below). If f is a procedure, it may only take one argument, and must return a single value of type realcons.
|
•
|
domain is used to define the domain of interest of f. It may be specified as either of:
|
left..right
ivar= left..right
|
left and right must be of type realcons. When f is algebraic, the second form above may be used to specify ivar. Note that the initial evaluation mesh extends at most from left-res/10 to right+res/10 under evalhf, whereas the range is strictly adhered to under evalf.
|
•
|
res indicates the desired width for returned ranges. The minimum allowable resolution is given by 10^(-evalhf(Digits)+5) under evalhf, and 10^(-Digits+2) under evalf. The maximum resolution for computation is (right-left)/bins, where bins is the number of bins used when generating the mesh. If res falls outside of these bounds, it will be internally set to the closer of the two. The default is 0.001.
|
•
|
The available option equations eqns are:
|
|
bins indicates the number of bins to be used in the evaluation mesh. Better results are generally obtained for higher mesh values, but at the expense of efficiency. It is recommended that bins be an odd number. The default is 21.
|
|
If newton is true, then fdiscont attempts to apply an inverse modified Newton method (secant method) on each of the returned ranges. This method will not work if f is a procedure. The inverse of f is evaluated under a secant method, to a maximum of twenty iterations. If successful, the final point is returned, otherwise the original range of interest is returned. This method generally works best if res is not overly restrictive (i.e. for res of magnitude or ). The default is false.
|
|
number indicates the maximum number of features (ranges) to be stored while working under evalhf mode. This value will have no effect in evalf mode. Note that fewer than number features may be returned (even if more exist) due to coalescing by fdiscont of overlapping features. The default is 20. The global variable _FullFeatures indicates if the internal work array has reached its maximum capacity.
|
|
order specifies the order of divided differences to use. The default is 3, as this produces good results without excessive computation. The minimum order is 2, while the maximum is 7.
|
|
pts indicates if evaluation points should be returned along with features. If set to true, then coordinates from the evaluation mesh will be stored and returned, up to three levels of recursion. If true, then output will take the form of a list of two lists, the first being the features, the second the evaluation coordinates. The default is false.
|
|
|
Examples
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
sin(75*x) gives features when the resolution is as large as 0.1.
>
|
|
| (7) |
Narrowing the resolution to 0.001 shows there are no features.
>
|
|
| (8) |
|
|