Compute numerically zeros of a function of two or more variables. All free variables (all but the variable on the right side) named in the expression must be assigned a value via \ldots

findZerosMult(..., npts = 10, rad = 5, near = 0, sortBy = "byx")

Arguments

...

arguments for values NOTE: if the system has more than one equation and the rhs variables do not match up, there will be an error.

npts

number of desired zeros to return

rad

radius around near in which to look for zeros

near

center of search for zeros

sortBy

options for sorting zeros for plotting. Options are 'byx', 'byy' and 'radial'. The default value is 'byx'.

Value

A data frame of numerical values which should all result in a value of zero when input into original function

Details

sorts points in the domain according to the sign of the function value at respective points. Use continuity and uniroot to find zeros between points of opposite signs. Returns any number of points which may be sorted and plotted according to x, y, or radial values.

Author

Cecylia Bocovich

Examples

findZerosMult(a*x^2-8~a&x, npts = 50)
#>            a        x
#> 1  0.3721049 4.637504
#> 2  0.4401708 4.263184
#> 3  0.4589887 4.175552
#> 4  0.4640593 4.151986
#> 5  0.5207730 3.919367
#> 6  0.5208263 3.919074
#> 7  0.5794556 3.715162
#> 8  0.5996720 3.652939
#> 9  0.6012051 3.647847
#> 10 0.6283875 3.568688
#> 11 0.6449736 3.522070
#> 12 0.7563289 3.252226
#> 13 0.9659305 2.877601
#> 14 1.0441059 2.767821
#> 15 1.2188055 2.561975
#> 16 1.3347443 2.448198
#> 17 1.3385963 2.444498
#> 18 1.3870704 2.401806
#> 19 1.3900339 2.398775
#> 20 1.4505443 2.348425
#> 21 1.5324095 2.284850
#> 22 1.5332990 2.283908
#> 23 1.6384082 2.209704
#> 24 1.6661298 2.191264
#> 25 1.7485324 2.138941
#> 26 1.7923306 2.112807
#> 27 1.8003914 2.107969
#> 28 1.8159056 2.099158
#> 29 1.9634150 2.018545
#> 30 1.9727785 2.013752
#> 31 1.9744762 2.012774
#> 32 2.0290921 1.985614
#> 33 2.0553859 1.972878
#> 34 2.0624063 1.969707
#> 35 2.0878196 1.957529
#> 36 2.1470027 1.930255
#> 37 2.1672779 1.921262
#> 38 2.2466907 1.886994
#> 39 2.3401014 1.848994
#> 40 2.4044656 1.823760
#> 41 2.4799467 1.796061
#> 42 2.5495342 1.771347
#> 43 2.6007216 1.753873
#> 44 2.8348605 1.679858
#> 45 2.8356844 1.679638
#> 46 2.9285277 1.652793
#> 47 3.1632372 1.590301
#> 48 3.5957748 1.491600
#> 49 4.0899686 1.398562
#> 50 4.4276037 1.344206
findZerosMult(a^2+x^2-8~a&x, npts = 100, sortBy='radial')
#>             a          x
#> 1   2.0966450 -1.8984415
#> 2   2.1661205 -1.8187413
#> 3   2.1900956 -1.7898398
#> 4   2.2817743 -1.6713825
#> 5   2.2822543 -1.6706605
#> 6   2.2897262 -1.6604665
#> 7   2.2987926 -1.6478615
#> 8   2.3462584 -1.5795791
#> 9   2.3796589 -1.5287989
#> 10  2.4003666 -1.4960731
#> 11  2.4135446 -1.4746697
#> 12  2.4181477 -1.4671562
#> 13  2.4226658 -1.4596821
#> 14  2.4449693 -1.4219411
#> 15  2.4464471 -1.4194691
#> 16  2.4493937 -1.4143603
#> 17  2.4555551 -1.4039108
#> 18  2.4587810 -1.3978670
#> 19  2.4590061 -1.3975334
#> 20  2.4823007 -1.3557950
#> 21  2.4987721 -1.3250469
#> 22  2.5146992 -1.2946055
#> 23  2.5150632 -1.2939044
#> 24  2.5269594 -1.2704840
#> 25  2.5320743 -1.2603326
#> 26  2.5410049 -1.2422375
#> 27  2.5622845 -1.1977872
#> 28  2.5651533 -1.1916180
#> 29  2.5775016 -1.1645571
#> 30  2.5871776 -1.1430267
#> 31  2.5888870 -1.1391424
#> 32  2.5949679 -1.1248433
#> 33  2.6014438 -1.1098190
#> 34  2.6126256 -1.0832788
#> 35  2.6159452 -1.0754997
#> 36  2.6317116 -1.0362034
#> 37  2.6397140 -1.0158283
#> 38  2.6466957 -0.9973601
#> 39  2.6645153 -0.9485804
#> 40  2.6694205 -0.9347667
#> 41  2.6716569 -0.9284195
#> 42  2.6763718 -0.9148935
#> 43  2.7248750 -0.7583254
#> 44  2.7766432 -0.5387596
#> 45  2.7774182 -0.5347708
#> 46  2.8082700 -0.3370788
#> 47  2.8104903 -0.3181301
#> 48  2.8251447  0.1359858
#> 49  2.7955059  0.4303080
#> 50  2.6815444  0.8995977
#> 51  2.6765249  0.9143447
#> 52  2.5940819  1.1272589
#> 53  2.5931776  1.1293366
#> 54  2.5174947  1.2892736
#> 55  2.4703119  1.3775959
#> 56  2.3980400  1.4998026
#> 57  2.3772928  1.5323640
#> 58  2.3496376  1.5744824
#> 59  2.2629921  1.6967139
#> 60  2.1667183  1.8182276
#> 61  2.1626558  1.8226550
#> 62  2.1522495  1.8351464
#> 63  2.1409482  1.8483001
#> 64  2.1386238  1.8514083
#> 65  2.1261721  1.8653088
#> 66  2.1112181  1.8822134
#> 67  2.0980922  1.8968337
#> 68  2.0881512  1.9078603
#> 69  2.0669959  1.9306759
#> 70  2.0224112  1.9773329
#> 71  2.0134284  1.9864763
#> 72  2.0079488  1.9920185
#> 73  1.9802709  2.0196986
#> 74  1.9788334  2.0209784
#> 75  1.9714793  2.0281100
#> 76  1.9351316  2.0628269
#> 77  1.9025481  2.0926923
#> 78  1.8982140  2.0971372
#> 79  1.8519162  2.1378476
#> 80  1.8321185  2.1548846
#> 81  1.7945334  2.1861739
#> 82  1.7210361  2.2445559
#> 83  1.6953825  2.2639552
#> 84  1.6589210  2.2908426
#> 85  1.5363689  2.3749626
#> 86  1.4393180  2.4348147
#> 87  1.4370389  2.4361625
#> 88  1.4331757  2.4383864
#> 89  1.4238813  2.4436674
#> 90  1.3957256  2.4600712
#> 91  1.3745461  2.4719656
#> 92  1.3694230  2.4746110
#> 93  1.3466238  2.4872511
#> 94  0.9187593  2.6750246
#> 95  0.9141758  2.6765309
#> 96  0.8975829  2.6821267
#> 97  0.8700510  2.6912849
#> 98  0.7966210  2.7139197
#> 99  0.7663570  2.7226049
#> 100 0.1620246  2.8237871
if (FALSE) findZerosMult(a^2+x^2-8~a&x, npts = 1000, sortBy='radial')