# test function: inverse-radius function (Wang et.al 2024)
inverse_r = function(x){
epsilon = 0.1
y1 = 1 / (x[1]^2 + x[2]^2 + epsilon^2) ^ (1/2)
if (x[2]==0){
y2 = 0
}else if (x[1]==0) {
y2 = pi / 2}else{
y2 = atan(x[2] / x[1])
}
return (c(y1=y1, y2=y2))
}
set.seed(2022)
p = 2
q = 2
f = inverse_r
n_ini = 10
n = 50
osfd = OSFD(f=f, p=p, q=q, n_ini=n_ini, n=n)
D = osfd$D
Y = osfd$Y
Run the code above in your browser using DataLab