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
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.
Examples
findZerosMult(a*x^2-8~a&x, npts = 50)
#> a x
#> 1 0.4631470 4.156167
#> 2 0.4815988 4.075546
#> 3 0.4839904 4.065619
#> 4 0.4895583 4.042433
#> 5 0.4965593 4.013842
#> 6 0.5068974 3.972699
#> 7 0.5069208 3.972609
#> 8 0.5159563 3.937915
#> 9 0.5209283 3.919258
#> 10 0.5263881 3.898549
#> 11 0.5278132 3.893428
#> 12 0.5291708 3.888735
#> 13 0.5468485 3.824798
#> 14 0.5500788 3.813573
#> 15 0.5505174 3.811792
#> 16 0.5538986 3.800832
#> 17 0.5570937 3.789217
#> 18 0.5582809 3.785116
#> 19 0.5662895 3.758521
#> 20 0.5697239 3.747312
#> 21 0.5700331 3.746332
#> 22 0.5725457 3.737998
#> 23 0.5761881 3.726115
#> 24 0.5815567 3.708782
#> 25 0.5817396 3.707950
#> 26 0.5869323 3.691907
#> 27 0.6004361 3.650151
#> 28 0.6010137 3.648492
#> 29 0.6157788 3.604392
#> 30 0.6256789 3.575720
#> 31 0.6274700 3.570654
#> 32 0.6571173 3.489174
#> 33 0.6619889 3.476310
#> 34 0.6727472 3.448401
#> 35 0.7061345 3.365874
#> 36 0.8879086 3.001656
#> 37 0.9339584 2.926796
#> 38 1.0023487 2.825108
#> 39 1.1759660 2.608211
#> 40 1.3039600 2.476907
#> 41 1.4092227 2.382625
#> 42 1.6215040 2.221194
#> 43 1.8572068 2.075468
#> 44 1.9427542 2.029252
#> 45 2.5391777 1.775005
#> 46 3.0739727 1.613222
#> 47 3.2902656 1.559299
#> 48 3.3357326 1.548722
#> 49 3.6906291 1.472294
#> 50 3.7317985 1.464151
findZerosMult(a^2+x^2-8~a&x, npts = 100, sortBy='radial')
#> a x
#> 1 2.825281114 -0.1333276
#> 2 2.693612188 0.8628207
#> 3 1.553022434 2.3639042
#> 4 1.430712641 2.4398916
#> 5 1.373142397 2.4727050
#> 6 1.289410908 2.5174919
#> 7 1.260850101 2.5318487
#> 8 1.235919768 2.5441311
#> 9 1.188621002 2.5665242
#> 10 1.153786549 2.5823963
#> 11 1.126401800 2.5944743
#> 12 1.121295991 2.5966706
#> 13 1.045243266 2.6281972
#> 14 0.982803050 2.6520999
#> 15 0.946781405 2.6652598
#> 16 0.937021777 2.6687114
#> 17 0.934491287 2.6695938
#> 18 0.895083125 2.6830672
#> 19 0.686679465 2.7438077
#> 20 0.650568807 2.7525802
#> 21 0.619213095 2.7598162
#> 22 0.612720894 2.7613730
#> 23 0.495414996 2.7847018
#> 24 0.472928559 2.7886091
#> 25 0.466030117 2.7897624
#> 26 0.425035704 2.7963072
#> 27 0.357538903 2.8057346
#> 28 0.353312718 2.8062734
#> 29 0.350278200 2.8066550
#> 30 0.328308832 2.8093081
#> 31 0.318705918 2.8104140
#> 32 0.302592197 2.8121945
#> 33 0.232341066 2.8188704
#> 34 0.231210358 2.8189617
#> 35 0.203741802 2.8210818
#> 36 0.158167388 2.8239578
#> 37 0.135193823 2.8252268
#> 38 0.055814270 2.8278021
#> 39 0.009744701 2.8283352
#> 40 -0.005353994 2.8284224
#> 41 -0.061301008 2.8278384
#> 42 -0.098206694 2.8268200
#> 43 -0.105998209 2.8264313
#> 44 -0.145329847 2.8246873
#> 45 -0.159970323 2.8238883
#> 46 -0.173743282 2.8231001
#> 47 -0.204237940 2.8210344
#> 48 -0.277183849 2.8147692
#> 49 -0.296584079 2.8128354
#> 50 -0.336588623 2.8082982
#> 51 -0.420405634 2.7970054
#> 52 -0.446954787 2.7928896
#> 53 -0.476378158 2.7880143
#> 54 -0.795330552 2.7143038
#> 55 -0.881955308 2.6874147
#> 56 -1.053647562 2.6250067
#> 57 -1.055278091 2.6242572
#> 58 -1.064585687 2.6203475
#> 59 -1.200008841 2.5612401
#> 60 -1.208146664 2.5575062
#> 61 -1.238963996 2.5426557
#> 62 -1.263179648 2.5305825
#> 63 -1.299218543 2.5123691
#> 64 -1.367271367 2.4760610
#> 65 -1.434972620 2.4374412
#> 66 -1.467050435 2.4181947
#> 67 -1.470668054 2.4160442
#> 68 -1.488179212 2.4052457
#> 69 -1.491424607 2.4031745
#> 70 -1.496803207 2.3998457
#> 71 -1.498723231 2.3987079
#> 72 -1.504261937 2.3952574
#> 73 -1.522815091 2.3834372
#> 74 -1.532996751 2.3769548
#> 75 -1.606837575 2.3276005
#> 76 -1.650359858 2.2970563
#> 77 -1.660225049 2.2899382
#> 78 -1.750235617 2.2217992
#> 79 -1.769921525 2.2061541
#> 80 -1.789035919 2.1907646
#> 81 -1.793370681 2.1872538
#> 82 -1.810847596 2.1727383
#> 83 -1.923771881 2.0733534
#> 84 -1.968827369 2.0307067
#> 85 -1.979100682 2.0207351
#> 86 -1.993275022 2.0065695
#> 87 -2.055178585 1.9431912
#> 88 -2.189769903 1.7904367
#> 89 -2.213719103 1.7604843
#> 90 -2.235664426 1.7327611
#> 91 -2.243068784 1.7229264
#> 92 -2.270361260 1.6868484
#> 93 -2.284337032 1.6678991
#> 94 -2.311346968 1.6302355
#> 95 -2.346209284 1.5796178
#> 96 -2.360279869 1.5584126
#> 97 -2.538600511 1.2471669
#> 98 -2.612243905 1.0845145
#> 99 -2.627107800 1.0479957
#> 100 -2.641018937 1.0124065
if (FALSE) findZerosMult(a^2+x^2-8~a&x, npts = 1000, sortBy='radial') # \dontrun{}