R Under development (unstable) (2024-10-16 r87241 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > if(!require("GNE"))stop("this test requires package GNE.") Loading required package: GNE Loading required package: alabama Loading required package: numDeriv Loading required package: nleqslv Loading required package: BB Loading required package: SQUAREM > > limphiFB <- function(x, ab) + ( sqrt(x^2*ab[1]^2 + x^2*ab[2]^2) - x*(ab[1]+ab[2]) )/x > > > x <- seq(-.1, .1, .001) > n <- 10 > > plot(x, limphiFB(x, c(1,1)), type="l", ylim=c(-5, 2), + main="limits of phiFB(ta, tb)/t as t-> 0", xlab="t", ylab="phiFB(ta, tb)/t") > > for(i in 1:n) + lines(x, limphiFB(x, c(1/i,1/(i-1))), col=grey( (i+5)/(n+15) ) ) > > for(i in 1:n) + lines(x, limphiFB(x, c(0,1/(i-1))), col=grey( (i+5)/(n+5) ) ) > > > for(i in 1:n) + lines(x, limphiFB(x, c(1,1/(i-1))), col=grey( (i+5)/(n+5) ) ) > > > > somevals <- sapply(1:n, function(i) limphiFB(x, c(3,1/(i+1)))) > apply(somevals, 2, range, na.rm=TRUE) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -6.5413813 -6.3517950 -6.2603986 -6.2066593 -6.1712927 -6.1462566 [2,] -0.4586187 -0.3148716 -0.2396014 -0.1933407 -0.1620406 -0.1394577 [,7] [,8] [,9] [,10] [1,] -6.127603 -6.1131680 -6.1016662 -6.092286 [2,] -0.122397 -0.1090542 -0.0983338 -0.089532 > > > > > limphigraFB <- function(x, ab) + sign(x)*ab[1]/sqrt(sum(ab^2)) - x*sum(ab) > > > x <- seq(.001, .1, .001) > n <- 10 > > plot(x, limphigraFB(x, c(1,1)), type="l", ylim=c(-1, 1), xlim=range(-x, x), + main="limits of GrAphiFB(ta, tb) as t-> 0", xlab="t", ylab="GrAphiFB(ta, tb)") > lines(-x, limphigraFB(-x, c(1,1))) > > for(i in 1:n) + { + lines(x, limphigraFB(x, c(1/i,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + lines(-x, limphigraFB(-x, c(1/i,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + } > > > for(i in 1:n) + { + lines(x, limphigraFB(x, c(1,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + lines(-x, limphigraFB(-x, c(1,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + } > > for(i in 1:n) + { + lines(x, limphigraFB(x, c(10,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + lines(-x, limphigraFB(-x, c(10,1/(i-1))), col=grey( (i+5)/(n+15) ) ) + } > > proc.time() user system elapsed 0.48 0.18 0.65