diff options
author | Ian Jauslin <ian@jauslin.org> | 2019-12-16 15:06:59 -0500 |
---|---|---|
committer | Ian Jauslin <ian@jauslin.org> | 2019-12-16 15:06:59 -0500 |
commit | e6bf8349d7fc554bdbd915cc65c44f23c1b86e75 (patch) | |
tree | 990c2f8a32ab12e94cd36cacb1079bfd2fd188c0 /figs/numerical.fig/simpleq/tools.jl |
Initial commitv0.0
Diffstat (limited to 'figs/numerical.fig/simpleq/tools.jl')
-rw-r--r-- | figs/numerical.fig/simpleq/tools.jl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/figs/numerical.fig/simpleq/tools.jl b/figs/numerical.fig/simpleq/tools.jl new file mode 100644 index 0000000..1635a14 --- /dev/null +++ b/figs/numerical.fig/simpleq/tools.jl @@ -0,0 +1,20 @@ +# \Phi(x)=2*(1-sqrt(1-x))/x +function Phi(x) + if abs(x)>1e-5 + return 2*(1-sqrt(1-x))/x + else + return 1+x/4+x^2/8+5*x^3/64+7*x^4/128+21*x^5/512 + end +end +# \partial\Phi +function dPhi(x) + #if abs(x-1)<1e-5 + # @printf(stderr,"warning: dPhi is singular at 1, and evaluating it at (% .8e+i% .8e)\n",real(x),imag(x)) + #end + if abs(x)>1e-5 + return 1/(sqrt(1-x)*x)-2*(1-sqrt(1-x))/x^2 + else + return 1/4+x/4+15*x^2/64+7*x^3/32+105*x^4/512+99*x^5/512 + end +end + |