From e6bf8349d7fc554bdbd915cc65c44f23c1b86e75 Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Mon, 16 Dec 2019 15:06:59 -0500 Subject: Initial commit --- figs/numerical.fig/simpleq/simpleq.jl | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 figs/numerical.fig/simpleq/simpleq.jl (limited to 'figs/numerical.fig/simpleq/simpleq.jl') diff --git a/figs/numerical.fig/simpleq/simpleq.jl b/figs/numerical.fig/simpleq/simpleq.jl new file mode 100644 index 0000000..88209b0 --- /dev/null +++ b/figs/numerical.fig/simpleq/simpleq.jl @@ -0,0 +1,40 @@ +# \eta +function eta(x,t,weights,d,v) + if d==2 + return integrate_chebyshev(y->4*((x+t)*y+abs(x-t)*(1-y))*v((x+t)*y+abs(x-t)*(1-y))/sqrt(((x+t)*y+abs(x-t)*(2-y))*((x+t)*(1+y)+abs(x-t)*(1-y))),0,1,length(weights)) + elseif d==3 + return (x>t ? 2*t/x : 2)* integrate_legendre(y->2*pi*((x+t)*y+abs(x-t)*(1-y))*v((x+t)*y+abs(x-t)*(1-y)),0,1,weights) + end +end + +# initialize V and Eta +function init_veta(weights,d,v) + order=length(weights[1]) + V=Array{Complex{Float64}}(undef,order) + Eta=Array{Array{Complex{Float64}}}(undef,order) + Eta0=Array{Complex{Float64}}(undef,order) + V0=v(0) + for i in 1:order + k=(1-weights[1][i])/(1+weights[1][i]) + V[i]=v(k) + Eta[i]=Array{Complex{Float64}}(undef,order) + for j in 1:order + y=(weights[1][j]+1)/2 + Eta[i][j]=eta(k,(1-y)/y,weights,d,v) + end + y=(weights[1][i]+1)/2 + Eta0[i]=eta(0,(1-y)/y,weights,d,v) + end + return(V,V0,Eta,Eta0) +end + +# inverse Fourier transform +function u_x(x,u,weights,d) + order=length(weights[1]) + if d==2 + out=integrate_legendre_sampled(y->(1-y)/y^3*besselj(0,x*(1-y)/y)/(2*pi),u,0,1,weights) + elseif d==3 + out=integrate_legendre_sampled(y->(1-y)/y^3*sin(x*(1-y)/y)/x/(2*pi^2),u,0,1,weights) + end + return out +end -- cgit v1.2.3-70-g09d2