MathematicalFunctions[Evalf]
QuadrantNumbers
return the quadrant of the complex plane where a given complex number is located, or return an Array of random complex numbers in each quadrant
Calling Sequence
Parameters
Description
Examples
Compatibility
QuadrantNumbers(complex_number)
QuadrantNumbers()
QuadrantNumbers(around = [...], quadrants = [...], listformat, floatingpoint)
complex_number
-
any complex number
around
(optional) list of complex numbers, default value is [0], so that the returned numbers in each quadrant have absolute value around the numbers indicated in the list
quadrants
(optional) list of quadrants, default value is [1, 2, 3, 4], so that the returned numbers are in the specified quadrants
listformat
(optional) return a list of lists of numbers instead of an Array (the default).
floatingpoint
(optional) true or false; whether to return the Array or list of numbers in floating-point notation, obtained by applying evalf to the exact numbers of the intermediate computations. The default is true
The QuadrantNumbers command has two related but different purposes to facilitate numerical experimentation and testing of numerical algorithms. First, if a complex number is passed, it returns a single number identifying the quadrant where the passed number is located. Second purpose: when QuadrantNumbers is called with no arguments, or with any of the optional arguments around = [...], quadrants = [...], it returns an organized Array, with components A1 A2, A3 and A4, of random complex numbers that are located in each of the four quadrants. This is particularly useful for testing the performance of numerical algorithms in different regions of the complex plane.
When the optional argument listformat is passed, the returned numbers will be in a list of four lists instead of an Array, each sublist corresponding to a quadrant.
Within the context of this command, the four quadrants of the complex plane are defined as usual, plus some conventions to locate the axes: the quadrants do not include the starting semi-axis and do include the ending semi-axis. So,
quadrant 1: 0≤x,0<y, so the real positive semi-axis is not included, but the imaginary positive semi-axis is
quadrant 2: x<0,0≤y, so the real negative semi-axis is included, but the imaginary positive semi-axis is not
quadrant 3: x≤0,y<0, so the real negative semi-axis is not included, but the imaginary negative semi-axis is
quadrant 4: 0<x,y≤0 or x=0,y=0, so the real positive semi-axis is included, but the imaginary negative semi-axis is not
The convention for the real positive semi-axis in the fourth quadrant is related to the situation of mathematical functions related to the hypergeometric function that have the branch cut located on the real positive semi-axis and the value of the function there is obtained arriving to the axis from below (i.e. locating the positive real axis in the fourth quadrant).
When no arguments are passed, the Array returned - say it is assigned to A - contains only four complex numbers around the origin, given by A1 A2, A3 and A4. When a list around = [...] is passed, the same organization of numbers per quadrant in A1,A2, ... is returned, and in each Aj there will be numbers with absolute value in between the origin and the absolute value of the first given number, with absolute value equal to the one of the given number, and with absolute value in between the one of the number and the one of the next number. In addition, at the end of the numbers of each quadrant there will be an additional number with absolute value in between the one of the last number and of that number multiplied by Digits/3. All in all, if the list around contains n numbers, there will be n+1 numbers in each quadrant of the returned Array.
When the optional argument quadrants = [...] is passed, the Array of numbers returned is still organized with the structure A1 A2, A3 and A4, but only the Aj where j is one of the quadrants specified will contain numbers and the other ones will be empty lists or arrays.
When the optional argument floatingpoint = false is passed, the returned Array of numbers will contain exact complex numbers of the form ρ⁢ⅇI⁢α instead of the same numbers after applying evalf to them.
Initialization: Load the package and set the display of special functions in output to typeset mathematical notation (textbook notation):
withMathematicalFunctions:-Evalf;Typesetting:-EnableTypesetRuleTypesetting:-SpecialFunctionRules:
Add,Evalb,Zoom,QuadrantNumbers,Singularities,GenerateRecurrence,PairwiseSummation
Consider a list of complex number
L≔1.104686701+0.9380134212⁢I,1.164644325−0.9889247393⁢I,−0.8023493481+3.596784532⁢I,−1.451484463−6.506737839⁢I
When doing numerical experimentation, interactively or within a program, it is frequently useful to see in which quadrants are the numbers located; for this purpose you can use QuadrantNumbers
map⁡QuadrantNumbers,L
1,4,2,3
By convention, each quadrant contains the ending semi-axis, not the starting one
map⁡QuadrantNumbers,0,1,I,−1,−I
4,4,1,2,3
To get an Array of four complex numbers around the origin, you can call QuadrantNumbers with no arguments
QuadrantNumbers⁡
0.05953530934+0.7891952948⁢I−0.4512890613+0.6501629407⁢I−0.7894746337−0.05570878890⁢I0.5603893987−0.5588715310⁢I
The four numbers in this array are located in the four quadrants respectively.
map⁡QuadrantNumbers,
1234
Note that each time you call this command it will return different numbers; they are chosen randomly.
0.5179927666+0.6803576553⁢I−0.8228434075+0.2326623568⁢I−0.1426185909−0.8431269079⁢I0.8012314934−0.2987158170⁢I
To get an Array of complex numbers with absolute value around the number 1 (where various special functions happen to be singular) use
QuadrantNumbers⁡around=1
0.2283867284+0.1782335157⁢I0.8084325983+0.5885887648⁢I0.7210705780+5.037504451⁢I−0.1604555877+0.2412088062⁢I−0.8604933959+0.5094615938⁢I−1.047232448+4.979929525⁢I−0.1722919981−0.2329015913⁢I−0.09073663578−0.9958749233⁢I−1.685305297−4.801680949⁢I0.2270281045−0.1799608946⁢I0.9967320509−0.08077882542⁢I3.293807212−3.879075653⁢I
Consider the singularities of the linear differential equation behind the following AppellF4 function as a function of z
F4 ≔ AppellF41, 2, 3, 4, 5, z
F4≔F4⁡1,2,3,4,5,z
S≔Singularities⁡F4
S≔0,6−2⁢5,203,6+2⁢5,∞+∞⁢I
Get an Array of exact (not floating-point) complex number around these singularities
A≔QuadrantNumbers⁡around=S,floatingpoint=false
A≔235818355005249999999997−78606118335⁢5249999999997⁢ⅇ85464007853⁢I499999999994⁢π6−2⁢5⁢ⅇ9949508401⁢I999999999988⁢π4506402031123749999999991−493597968817⁢5249999999997⁢ⅇ363627416873⁢I999999999988⁢π20⁢ⅇ109656846529⁢I249999999997⁢π34549855081811749999999991+450144918129⁢5249999999997⁢ⅇ170269515793⁢I999999999988⁢π6+2⁢5⁢ⅇ74577847373⁢I249999999997⁢π3854209493301249999999997+1284736497767⁢5249999999997⁢ⅇ31538302949⁢I90909090908⁢π235818355005249999999997−78606118335⁢5249999999997⁢ⅇ709905483453⁢I999999999988⁢π6−2⁢5⁢ⅇ84557924477⁢I90909090908⁢π4506402031123749999999991−493597968817⁢5249999999997⁢ⅇ685586434823⁢I999999999988⁢π20⁢ⅇ144382346049⁢I249999999997⁢π34549855081811749999999991+450144918129⁢5249999999997⁢ⅇ644198178291⁢I999999999988⁢π6+2⁢5⁢ⅇ864542897283⁢I999999999988⁢π3854209493301249999999997+1284736497767⁢5249999999997⁢ⅇ475073843039⁢I499999999994⁢π235818355005249999999997−78606118335⁢5249999999997⁢ⅇ−341098947853⁢I499999999994⁢π6−2⁢5⁢ⅇ−682937339737⁢I999999999988⁢π4506402031123749999999991−493597968817⁢5249999999997⁢ⅇ−234928485965⁢I249999999997⁢π20⁢ⅇ−481942387325⁢I499999999994⁢π34549855081811749999999991+450144918129⁢5249999999997⁢ⅇ−647736343415⁢I999999999988⁢π6+2⁢5⁢ⅇ−182546200740⁢I249999999997⁢π3854209493301249999999997+1284736497767⁢5249999999997⁢ⅇ−15911858460⁢I22727272727⁢π235818355005249999999997−78606118335⁢5249999999997⁢ⅇ−41425258201⁢I499999999994⁢π6−2⁢5⁢ⅇ−2798479627⁢I999999999988⁢π4506402031123749999999991−493597968817⁢5249999999997⁢ⅇ−450788311293⁢I999999999988⁢π20⁢ⅇ−21319687011⁢I499999999994⁢π34549855081811749999999991+450144918129⁢5249999999997⁢ⅇ−86409639356⁢I249999999997⁢π6+2⁢5⁢ⅇ−82680971566⁢I249999999997⁢π3854209493301249999999997+1284736497767⁢5249999999997⁢ⅇ−64407666101⁢I499999999994⁢π
Verify that the numbers in each of the Aj arrays are located in the corresponding quadrant:
mapQuadrantNumbers, A1
1111111
mapQuadrantNumbers, A2
2222222
mapQuadrantNumbers, A3
3333333
mapQuadrantNumbers, A4
4444444
Note that the absolute values of the numbers in each quadrant are equal or in between the absolute values of the singularities of F4 passed using around. For example, for the numbers in the first quadrant
evalfmapabs, A1
0.24019892411.5278640461.5936615966.66666666710.0926919910.4721359526.90787054
These numbers are equal or in between the absolute values of the singularities of F4
evalf⁡map⁡abs,S
0.,1.527864046,6.666666667,10.47213595,Float⁡∞
The MathematicalFunctions[Evalf][QuadrantNumbers] command was introduced in Maple 2017.
For more information on Maple 2017 changes, see Updates in Maple 2017.
See Also
Appell
DEtools[singularities]
evalb
evalf
Evalf command
Evalf package
FunctionAdvisor
hypergeom
MathematicalFunctions
Download Help Document