From b78cdd9a233f2fa36c9621415387db7609ba5338 Mon Sep 17 00:00:00 2001 From: Huaifeng Sun Date: Wed, 23 Oct 2019 15:58:29 +0800 Subject: [PATCH] Update all code. --- .gitignore | 1 + .vs/slnx.sqlite | Bin 77824 -> 77824 bytes README.en.md | 9 - TEM1dSAinv/.vs/TEM1dSAinv/v15/.suo | Bin 22016 -> 46592 bytes TEM1dSAinv/TEM1dSAinv.sln | 13 +- TEM1dSAinv/TEM1dSAinv.vfproj | 21 ++- TEM1dSAinv/code/get.f90 | 19 +++ TEM1dSAinv/code/inv_tem.f90 | 170 +++++++++++++++++++ TEM1dSAinv/code/main.f90 | 12 ++ TEM1dSAinv/code/out.f90 | 12 ++ TEM1dSAinv/code/tem.f90 | 76 +++++++++ TEM1dSAinv/coefficients/J1_coef.txt | 140 ++++++++++++++++ TEM1dSAinv/coefficients/sin250.txt | 250 ++++++++++++++++++++++++++++ TEM1dSAinv/ttt.txt | 33 ++++ TEM1dSAinv/uu.txt | 31 ++++ 15 files changed, 767 insertions(+), 20 deletions(-) delete mode 100644 README.en.md create mode 100644 TEM1dSAinv/code/get.f90 create mode 100644 TEM1dSAinv/code/inv_tem.f90 create mode 100644 TEM1dSAinv/code/main.f90 create mode 100644 TEM1dSAinv/code/out.f90 create mode 100644 TEM1dSAinv/code/tem.f90 create mode 100644 TEM1dSAinv/coefficients/J1_coef.txt create mode 100644 TEM1dSAinv/coefficients/sin250.txt create mode 100644 TEM1dSAinv/ttt.txt create mode 100644 TEM1dSAinv/uu.txt diff --git a/.gitignore b/.gitignore index 259148f..d9a1d82 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ *.exe *.out *.app +/TEM1dSAinv/x64 diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 25a8c23ad99af795b246bfa46a5b8897124f2338..d3603f1654de06b58b8862575b84cd9a037f2b0b 100644 GIT binary patch delta 3657 zcma)9dvH`&8NVm@?%mft=i5hKo6TzYi zA^|&_v{Ni7wRC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-1,9 +0,0 @@ -# TEM1dSAinv - - -#### Description -This code is for the Simulated Annealling inversion of Transient Electromagnetic data. - -This is developed by Laboratory of Earth Electromagnetic Exploration, Shandong University. - -Please refer the Chinese README for more details. \ No newline at end of file diff --git a/TEM1dSAinv/.vs/TEM1dSAinv/v15/.suo b/TEM1dSAinv/.vs/TEM1dSAinv/v15/.suo index ba13a285cd3c36b05727d8da0462a5799360b0ca..fff0807fdcf7fef24d7af178bbc8f1da150ccb64 100644 GIT binary patch delta 4981 zcmeH~TX0iF7{||+q)p3do0gzyDG;E@rA<61NiXRI8gijR)3gmY$0F7yjCG)eCQ*bs z)fvazljQTRCUP)WCZ=<6*s(6P^XNP4OHY-5)5qj8AF1AoIXE4+Z(^4K6DF^()?HP%u<5Y+? zy=+7oE0PKT4?7v;0~2|z_00-Ov%qXn4!HMRf`R%|yS|4@wVS_C{cW5npS`EAA=~m6li0M)f-I*TpoSd@JjXl*pa-ps@;LCvW z_V%d3spS?jWZBltLAeU3U;%K08c+*7pbpf72G9r=fyJN+c)=3j1AY(zL9i51SxH%W z7zJKPJMxaP@(ScD!79)Owzuy|HMeYh9>r(Cv*0Z8~|^FgWz0RWGxl{)2w-ZnfGH7*1Ux{iwu2f;N{-p_3)H z|74Ps#g{J?W7<-HRcL!h2}_$i9R^E=F+FUNMaq2al6|CM^CKce4-`F?Di}Qn9BK5i zLd`NsZ0zfIm| z+>FwX^nkovo-+1;{!sQ^FytEOtlVnK9c$y$Ns0V6xeNx5)8h~GHU2(}&Q3i}$8wa^ zG(-B#O(ro^x~r(@RN~xgzV}WP9W0f0ep)zkRN$ygqhBlL77A(h3Mn9k5N)DTYJ8J2OeHDG@SeR~d%n+iHHapts(5+_U7O7ftQ@b)t)N8f|MLur}x#9RWggz%0 z7(l3W<6A`-U!s*=D5?1PB?Tp~*5*Y?!N&`H2&xKt^2diubl9g}+Y0XPeg<4Ai&-s(nd~+htc(zhd_WRIgo8 zyo%4G1cO1J>%oDBP*1!&*s~!PUo_yW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0x|ptPUA(2 diff --git a/TEM1dSAinv/TEM1dSAinv.sln b/TEM1dSAinv/TEM1dSAinv.sln index a251f9b..6769301 100644 --- a/TEM1dSAinv/TEM1dSAinv.sln +++ b/TEM1dSAinv/TEM1dSAinv.sln @@ -7,14 +7,19 @@ Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "TEM1dSAinv", "TEM1dSAinv.vf EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x86.ActiveCfg = Debug|Win32 - {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x86.Build.0 = Debug|Win32 - {0DC004CB-77B3-482C-9DC9-3683936A620E}.Release|x86.ActiveCfg = Release|Win32 - {0DC004CB-77B3-482C-9DC9-3683936A620E}.Release|x86.Build.0 = Release|Win32 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x64.ActiveCfg = Debug|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x64.Build.0 = Debug|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x86.ActiveCfg = Debug|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Debug|x86.Build.0 = Debug|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Release|x64.ActiveCfg = Release|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Release|x64.Build.0 = Release|x64 + {0DC004CB-77B3-482C-9DC9-3683936A620E}.Release|x86.ActiveCfg = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TEM1dSAinv/TEM1dSAinv.vfproj b/TEM1dSAinv/TEM1dSAinv.vfproj index 1377601..8f6fe8a 100644 --- a/TEM1dSAinv/TEM1dSAinv.vfproj +++ b/TEM1dSAinv/TEM1dSAinv.vfproj @@ -1,23 +1,23 @@ - + - + - + - + - + @@ -25,6 +25,13 @@ - - + + + + + + + + + diff --git a/TEM1dSAinv/code/get.f90 b/TEM1dSAinv/code/get.f90 new file mode 100644 index 0000000..deee61b --- /dev/null +++ b/TEM1dSAinv/code/get.f90 @@ -0,0 +1,19 @@ + !读取数据文件 + subroutine get_t_u(t,u,n1,i0,a) + implicit none + integer n1,i + real(8) t(n1),u(n1),i0,a,pi,u0,ff + pi=3.1415926 + u0=4.e-7*pi + open(102,file='uu.txt') + read(102,*)i0,a + do i=1,n1 + read(102,*)t(i),u(i) + enddo + + ff=u0/4.0/pi*(2*pi*i0*a*a*u0/5.0)**(2.0/3.0) + do i=1,n1 + u(i)=ff/t(i)*(1.0/t(i)/u(i))**(2.0/3.0) + + enddo + endsubroutine \ No newline at end of file diff --git a/TEM1dSAinv/code/inv_tem.f90 b/TEM1dSAinv/code/inv_tem.f90 new file mode 100644 index 0000000..36637a3 --- /dev/null +++ b/TEM1dSAinv/code/inv_tem.f90 @@ -0,0 +1,170 @@ + subroutine inv(t,u,n1,p,n,i0,a) + implicit none + external fain !申明子函数 + integer n,n1,i,j,k_i,k_p,MarkovLength + real(8) p_max,p_max2,t(n1),u(n1),uu(n1),p(2*n-1),p_0(2*n-1),p_1(2*n-1),s(2*n-1),i0,a + real(8) random(2*n-1) + real(8) fx1,fx2,fx3(20),fain,t_0,eps + real pr + ! 确定初温 + eps=0.001 !误差率,控制何时终止循环 + MarkovLength=200 !在没有找到更优解的情况下的迭代次数 MarkovLength=200 + pr=0.1 !接受概率 + p_max=300.0 + p_max2=200.0 + !pmax为电阻率和深度的可搜索最大范围 最大扰动范围 + call random_seed() + do j=1,20 !一次迭代循环20次 + print*,j + call random_number(random) + do i=1,n + p(i)=(p_max*random(i)) + if(p(i)<1.0) p(i)=1.0 !当p(i)=pmax时终止do循环 + enddo + do i=n+1,2*n-1 + p(i)=(p_max2*random(i)) + if(p(i)<1.0) p(i)=1.0 !当p(i)=pmax时终止do循环 + enddo + call Tem_calculate(p,n,t,uu,n1,a,i0) !利用此时随机搜索的p(i) p(i+n)带入正演程序得到场值和衰减电压值 + fx3(j)=fain(u,uu,n1) !利用得到的衰减电压值u(i)与之前的最优解的u值进行做差得到目标函数值差 + enddo + fx1=0.0 + do i=1,20 + do j=i,20 + fx1=max(abs(fx3(i)-fx3(j)),fx1) !fx1即最大目标函数差值 + enddo + enddo + + t_0=-1.0*fx1/alog(pr) !得到初温 + !得到初始解 + call random_number(random) + do i=1,n + p_0(i)=(p_max*random(i)) + enddo + do i=n+1,2*n-1 + p_0(i)=(p_max2*random(i)) + enddo + p=p_0 !求解初始解时随机产生的p + s=p !初温时的p + call Tem_calculate(s,n,t,uu,n1,a,i0) + fx1=fain(u,uu,n1) !初温时p得到的目标函数差值fx1 + k_i=0 + k_p=0 + open(109,file='ttt.txt') +100 continue + call chou_yang(t,u,n1,t_0,p,s,n,p_0,p_1,p_max,p_max2,a,i0) + p=p_1 !调用抽样过程得到目标函数差值fx2 + call Tem_calculate(p_0,n,t,uu,n1,a,i0) + fx2=fain(u,uu,n1) + if(fx1eps) then !当迭代次数小于等于200或且误差控制大于0.2,继续循环 + goto 100 + else + p=s + print*,'计算结束' !当迭代次数大于200或且误差控制在0.2以内 结束循环 并输出最终的反演结果 + print*,s + print*,p + pause + close(109) + endif + endsubroutine + !******************************** + subroutine chou_yang(t,u,n1,t_0,p,s,n,p_0,p_1,p_max,p_max2,a,i0) + implicit none + integer n,k,q,n1,i,step1 + external fain + real(8) t(n1),u(n1),a,i0,uu(n1),p_max,p_max2 + real(8) t_0,p(2*n-1),s(2*n-1),p_0(2*n-1),p_1(2*n-1),p_2(2*n-1) + real(8) random(2*n-1),random2(2*n-1),StepFactor1,StepFactor,random1 + real(8) fx1,fx2,fx3,fain + stepFactor=0.1 !领域解半径为0.1 + k=0 + p_1=p !求解初始解时随机产生的p + p_0=s !初温时的p + q=0 + step1=20 !步长为20 + call Tem_calculate(p_1,n,t,uu,n1,a,i0) + fx1=fain(u,uu,n1) !p_1产生的目标函数差值fx1 + call Tem_calculate(p_0,n,t,uu,n1,a,i0) + fx3=fain(u,uu,n1) !p_0产生的目标函数差值fx3 +200 continue + ! 得到初始解的领域解 + call random_seed() + call random_number(random) + call random_number(random2) + + do i=1,n + if(random2(i)>=0.5) StepFactor1=StepFactor + if(random2(i)<0.5) StepFactor1=-1.0*StepFactor + p_2(i)=p_1(i)+StepFactor1*p_max*random(i) + if(p_2(i)>p_max) p_2(i)=p_max + if(p_2(i)<1.0) p_2(i)=1.0 + enddo + do i=n+1,2*n-1 + if(random2(i)>=0.5) StepFactor1=StepFactor + if(random2(i)<0.5) StepFactor1=-1.0*StepFactor + p_2(i)=p_1(i)+StepFactor1*p_max2*random(i) + if(p_2(i)>p_max2) p_2(i)=p_max2 + if(p_2(i)<1.0) p_2(i)=1.0 + enddo + call Tem_calculate(p_2,n,t,uu,n1,a,i0) + fx2=fain(u,uu,n1) + + if(fx2fx2) then + p_0=p_2 + fx3=fx2 + q=0 + else + q=q+1 + endif + endif + call random_number(random1) + if(fx2>fx1) then + ! 状态接受函数 + if(exp((fx1-fx2)/t_0)>random1)then + p_1=p_2 + fx1=fx2 + q=q+1 + endif + endif + k=k+1 + print*,q + print*,p_0 + print*,uu,t + if(q>step1)then + else + goto 200 + endif + endsubroutine +!********************************** + ! 计算目标函数值 + function fain(u,uu,n1) + implicit none + integer n1,i + real(8) fain,u(n1),uu(n1) + fain=0.0 + do i=1,n1 + fain=fain+abs((u(i)-uu(i))/u(i))!i时间道实际衰减电压值uu(i)与正演得到的衰减电压值u(i)作差 + enddo + fain=fain/n1 !n1个时间道的衰减电压值差取平均数即为每个时间道的目标函数值 + endfunction \ No newline at end of file diff --git a/TEM1dSAinv/code/main.f90 b/TEM1dSAinv/code/main.f90 new file mode 100644 index 0000000..f9aa8c0 --- /dev/null +++ b/TEM1dSAinv/code/main.f90 @@ -0,0 +1,12 @@ +!主程序,瞬变电磁模拟退火法一维正演 + program simulatedannealingmethod + implicit none + integer n,n1,i,j + ! n为层数,n1为采样时间道 + parameter(n=3,n1=30) + real(8) p(2*n-1),t(n1),u(n1),i0,a,wl(140),wsl(-149:100) + call get_t_u(t,u,n1,i0,a) + call inv(t,u,n1,p,n,i0,a) + call output(p,n) + end program simulatedannealingmethod +!******************************************** diff --git a/TEM1dSAinv/code/out.f90 b/TEM1dSAinv/code/out.f90 new file mode 100644 index 0000000..221820a --- /dev/null +++ b/TEM1dSAinv/code/out.f90 @@ -0,0 +1,12 @@ + !输出结果 + subroutine output(p,n) + implicit none + integer n,i + real(8) p(2*n-1) + open(131,file='inv_p.dat') + do i=1,n-1 + write(131,*) p(i),p(i+n)!p(i+n)为第i层高度,p(i)为第i层电阻率 + enddo + write(131,*)p(n) + close(131) + endsubroutine \ No newline at end of file diff --git a/TEM1dSAinv/code/tem.f90 b/TEM1dSAinv/code/tem.f90 new file mode 100644 index 0000000..74d020e --- /dev/null +++ b/TEM1dSAinv/code/tem.f90 @@ -0,0 +1,76 @@ + ! 瞬变电磁一维正演 + subroutine Tem_calculate(p,n,t,u,n1,a,i0) + implicit none + integer i,j,n,n1,mm + real(8) drt,pi,w,a,i0,u0,ff + real(8) p(2*n-1),t(n1),u(n1),wsl(-149:100),wl(140) + complex(8) hw + pi=3.1415926 + u0=4.e-7*pi + mm=140 + open(400,file='sin250.txt') + do i=-149,100 + read(400,*)wsl(i) + enddo + close(400) + open(100,file='J1_coef.txt') !J1系数 + do i=1,mm + read(100,*)wl(i) + enddo + close(100) + drt=alog(10.0)/20.0 !alog(x)是单精度自然对数 dlog(x)是双精度自然对数 clog(x)是复数度自然对数 log(x)表示自然对数 + u=0 + ff=u0/4.0/pi*(2*pi*i0*a*a*u0/5.0)**(2.0/3.0)!场值 + do i=1,n1 + do j=-149,100,1 + w=exp(j*drt)/t(i) + call frequency(hw,w,wl,mm,p,n,i0,a) + u(i)=u(i)+imag(hw)*wsl(j) + enddo + u(i)=u(i)/t(i)*sqrt(pi/2) + u(i)=abs(u(i)*2/pi*u0) + u(i)=ff/t(i)*(1.0/t(i)/u(i))**(2.0/3.0)!衰减电压值 + enddo + endsubroutine + !*********************************************** + !频率域一维正演 + subroutine frequency(hw,w,wl,mm,p,n,I0,a) + implicit none + external ths + integer n,mm,i,j + real(8) u0,pi,s,I0,a,a0,w + complex(8) z(n),zs(n),hw,k(n),u1(n),aa,ths,z0 + real(8) r(mm),wl(mm),p(2*n-1) + pi=3.1415926 + u0=4.e-7*pi + a0=-7.91001919 + s=8.7967143957e-2 + do i=1,mm + r(i)=10**(a0+s*(i-1))/a + enddo + hw=0.0 + do j=1,mm + k(n)=cmplx(0,-1*w*u0/p(n))!p(i)即第i层电阻率 p(i+n)即第i层厚度 complex(a,b)为转换为a+bi的复数 + z0=cmplx(0,-1*w*u0/r(j)) + u1(n)=sqrt(r(j)**2+k(n)) + z(n)=cmplx(0,-1*w*u0)/u1(n) + zs(n)=z(n) + do i=n-1,1,-1 + k(i)=cmplx(0,-1*w/p(i)*u0) + u1(i)=sqrt(r(j)**2+k(i)) + z(i)=cmplx(0,-1*w*u0)/u1(i) + aa=p(i+n)*u1(i) + zs(i)=z(i)*(zs(i+1)+z(i)*ths(aa))/(z(i)+zs(i+1)*ths(aa)) + enddo + hw=hw+r(j)*(zs(1)/(zs(1)+z0)-0.5)*wl(j) + enddo + hw=hw*i0 + endsubroutine + !*********************************************************** + function ths(aa) + IMPLICIT NONE + complex(8) ths,aa + ths=exp(-2*aa) + ths=(1-ths)/(1+ths) + endfunction + diff --git a/TEM1dSAinv/coefficients/J1_coef.txt b/TEM1dSAinv/coefficients/J1_coef.txt new file mode 100644 index 0000000..e1076f4 --- /dev/null +++ b/TEM1dSAinv/coefficients/J1_coef.txt @@ -0,0 +1,140 @@ + -6.76671159511e-014 + 3.39808396836e-013 + -7.43411889153e-013 + 8.93613024469e-013 + -5.47341591896e-013 + -5.84920181906e-014 + 5.20780672883e-013 + -6.92656254606e-013 + 6.88908045074e-013 + -6.39910528298e-013 + 5.82098912530e-013 + -4.84912700478e-013 + 3.54684337858e-013 + -2.10855291368e-013 + 1.00452749275e-013 + 5.58449957721e-015 + -5.67206735175e-014 + 1.09107856853e-013 + -6.04067500756e-014 + 8.84512134731e-014 + 2.22321981827e-014 + 8.38072239207e-014 + 1.23647835900e-013 + 1.44351787234e-013 + 2.94276480713e-013 + 3.39965995918e-013 + 6.17024672340e-013 + 8.25310217692e-013 + 1.32560792613e-012 + 1.90949961267e-012 + 2.93458179767e-012 + 4.33454210095e-012 + 6.55863288798e-012 + 9.78324910827e-012 + 1.47126365223e-011 + 2.20240108708e-011 + 3.30577485691e-011 + 4.95377381480e-011 + 7.43047574433e-011 + 1.11400535181e-010 + 1.67052734516e-010 + 2.50470107577e-010 + 3.75597211630e-010 + 5.63165204681e-010 + 8.44458166896e-010 + 1.26621795331e-009 + 1.89866561359e-009 + 2.84693620927e-009 + 4.26886170263e-009 + 6.40104325574e-009 + 9.59798498616e-009 + 1.43918931885e-008 + 2.15798696769e-008 + 3.23584600810e-008 + 4.85195105813e-008 + 7.27538583183e-008 + 1.09090191748e-007 + 1.63577866557e-007 + 2.45275193920e-007 + 3.67784458730e-007 + 5.51470341585e-007 + 8.26916206192e-007 + 1.23991037294e-006 + 1.85921554669e-006 + 2.78777669034e-006 + 4.18019870272e-006 + 6.26794044911e-006 + 9.39858833064e-006 + 1.40925408889e-005 + 2.11312291505e-005 + 3.16846342900e-005 + 4.75093313246e-005 + 7.12354794719e-005 + 1.06810848460e-004 + 1.60146590551e-004 + 2.40110903628e-004 + 3.59981158972e-004 + 5.39658308918e-004 + 8.08925141201e-004 + 1.21234066243e-003 + 1.81650387595e-003 + 2.72068483151e-003 + 4.07274689463e-003 + 6.09135552241e-003 + 9.09940027636e-003 + 1.35660714813e-002 + 2.01692550906e-002 + 2.98534800308e-002 + 4.39060697220e-002 + 6.39211368217e-002 + 9.16763946228e-002 + 1.28368795114e-001 + 1.73241920046e-001 + 2.19830379079e-001 + 2.51193131178e-001 + 2.32380049895e-001 + 1.17121080205e-001 + -1.17252913088e-001 + -3.52148528535e-001 + -2.71162871370e-001 + 2.91134747110e-001 + 3.17192840623e-001 + -4.93075681595e-001 + 3.11223091821e-001 + -1.36044122543e-001 + 5.12141261934e-002 + -1.90806300761e-002 + 7.57044398633e-003 + -3.25432753751e-003 + 1.49774676371e-003 + -7.24569558272e-004 + 3.62792644965e-004 + -1.85907973641e-004 + 9.67201396593e-005 + -5.07744171678e-005 + 2.67510121456e-005 + -1.40667136728e-005 + 7.33363699547e-006 + -3.75638767050e-006 + 1.86344211280e-006 + -8.71623576811e-007 + 3.61028200288e-007 + -1.05847108097e-007 + -1.51569361490e-008 + 6.67633241420e-008 + -8.33741579804e-008 + 8.31065906136e-008 + -7.53457009758e-008 + 6.48057680299e-008 + -5.37558016587e-008 + 4.32436265303e-008 + -3.37262648712e-008 + 2.53558687098e-008 + -1.81287021528e-009 + 1.20228328586e-008 + -7.10898040664e-009 + 3.53667004588e-009 + -1.36030600198e-009 + 3.52544249042e-010 + -4.53719284366e-011 diff --git a/TEM1dSAinv/coefficients/sin250.txt b/TEM1dSAinv/coefficients/sin250.txt new file mode 100644 index 0000000..0304e3a --- /dev/null +++ b/TEM1dSAinv/coefficients/sin250.txt @@ -0,0 +1,250 @@ + 1.156447054648637e-016 + 1.455880584491685e-016 + 1.832845064354326e-016 + 2.307415227397174e-016 + 2.904863665331116e-016 + 3.657006686082886e-016 + 4.603898648210914e-016 + 5.795965001557580e-016 + 7.296687626330448e-016 + 9.185985474711453e-016 + 1.156447054648634e-015 + 1.455880584491681e-015 + 1.832845064354321e-015 + 2.307415227397166e-015 + 2.904863665331103e-015 + 3.657006686082864e-015 + 4.603898648210901e-015 + 5.795965001557501e-015 + 7.296687626330329e-015 + 9.185985474711278e-015 + 1.156447054648612e-014 + 1.455880584491647e-014 + 1.832845064354265e-014 + 2.307415227397080e-014 + 2.904863665330965e-014 + 3.657006686082646e-014 + 4.603898648210535e-014 + 5.795965001556953e-014 + 7.296687626329462e-014 + 9.185985474709900e-014 + 1.156447054648389e-013 + 1.455880584491301e-013 + 1.832845064353717e-013 + 2.307415227396208e-013 + 2.904863665329599e-013 + 3.657006686080477e-013 + 4.603898648207092e-013 + 5.795965001551463e-013 + 7.296687626320796e-013 + 9.185985474696154e-013 + 1.156447054646209e-012 + 1.455880584487839e-012 + 1.832845064348231e-012 + 2.307415227387515e-012 + 2.904863665315808e-012 + 3.657006686058640e-012 + 4.603898648172482e-012 + 5.795965001496609e-012 + 7.296687626233827e-012 + 9.185985474558366e-012 + 1.156447054624371e-011 + 1.455880584453228e-011 + 1.832845064293375e-011 + 2.307415227300576e-011 + 2.904863665178019e-011 + 3.657006685840241e-011 + 4.603898647826370e-011 + 5.795965000948059e-011 + 7.296687625364435e-011 + 9.185985473180428e-011 + 1.156447054405990e-010 + 1.455880584107116e-010 + 1.832845063744824e-010 + 2.307415226431180e-010 + 2.904863663800132e-010 + 3.657006683656435e-010 + 4.603898644365244e-010 + 5.795964995462562e-010 + 7.296687616670500e-010 + 9.185985459401473e-010 + 1.156447052222165e-009 + 1.455880580645994e-009 + 1.832845058259313e-009 + 2.307415217737235e-009 + 2.904863650021138e-009 + 3.657006661818234e-009 + 4.603898609754006e-009 + 5.795964940607466e-009 + 7.296687529731007e-009 + 9.185985321611760e-009 + 1.156447030383951e-008 + 1.455880546034779e-008 + 1.832845003404190e-008 + 2.307415130797806e-008 + 2.904863512231297e-008 + 3.657006443436261e-008 + 4.603898263641547e-008 + 5.795964392056795e-008 + 7.296686660335758e-008 + 9.185983943714872e-008 + 1.156446812001731e-007 + 1.455880199922772e-007 + 1.832844454852834e-007 + 2.307414261403871e-007 + 2.904862134332549e-007 + 3.657004259617825e-007 + 4.603894802516352e-007 + 5.795958906554214e-007 + 7.296677966382738e-007 + 9.185970164759857e-007 + 1.156444628179741e-006 + 1.455876738807346e-006 + 1.832838969341425e-006 + 2.307405567480775e-006 + 2.904848355357452e-006 + 3.656982421491810e-006 + 4.603860191324607e-006 + 5.795904051742752e-006 + 7.296591027122000e-006 + 9.185832376013115e-006 + 1.156422790075531e-005 + 1.455842127958865e-005 + 1.832784114711636e-005 + 2.307318629427335e-005 + 2.904710567601305e-005 + 3.656764044807223e-005 + 4.603514087536846e-005 + 5.795355521527330e-005 + 7.295721667410295e-005 + 9.184454558911375e-005 + 1.156204422278983e-004 + 1.455496047235377e-004 + 1.832235621566062e-004 + 2.306449358701818e-004 + 2.903332902825535e-004 + 3.654580713105382e-004 + 4.600053900083832e-004 + 5.789871945981126e-004 + 7.287031465075219e-004 + 9.170683245122596e-004 + 1.154022098295481e-003 + 1.452037965023791e-003 + 1.826756086858394e-003 + 2.297767484717661e-003 + 2.889577754406488e-003 + 3.632790471922652e-003 + 4.565537633632412e-003 + 5.735207473181395e-003 + 7.200470157233521e-003 + 9.033651050110031e-003 + 1.132334380467910e-002 + 1.417727733464931e-002 + 1.772499346509631e-002 + 2.212023128150156e-002 + 2.754164273887034e-002 + 3.419148067351661e-002 + 4.228846080133485e-002 + 5.205416439533162e-002 + 6.368324102630288e-002 + 7.729769668970302e-002 + 9.286191525747088e-002 + 1.100669688846222e-001 + 1.281325720732841e-001 + 1.455759302997095e-001 + 1.598450602566018e-001 + 1.675994998118554e-001 + 1.619683745893242e-001 + 1.351613440916820e-001 + 8.220710085812771e-002 +-5.378512256133189e-003 +-1.293051042068928e-001 +-2.723112991886841e-001 +-3.978468461558793e-001 +-4.394993669496010e-001 +-3.176425577428793e-001 + 1.665756359292827e-002 + 4.630044483056220e-001 + 7.298213861736705e-001 + 3.957559489684660e-001 +-4.902404478827365e-001 +-1.020512348109581e+000 + 5.251407980261734e-002 + 1.253864451347815e+000 +-1.317577223583377e-001 +-1.549527153893942e+000 + 1.822344193602740e+000 +-1.058204213789976e+000 + 2.629725097214586e-001 + 1.625578365785221e-001 +-2.871269632839427e-001 + 2.688993168200287e-001 +-2.085718537012279e-001 + 1.489333044554680e-001 +-1.023510671993418e-001 + 6.920616476794303e-002 +-4.650126535306088e-002 + 3.114481903045837e-002 +-2.081379273802720e-002 + 1.390327480927853e-002 +-9.298886523349949e-003 + 6.224588805575879e-003 +-4.160927227996026e-003 + 2.775386859464604e-003 +-1.851896921274413e-003 + 1.239790988028041e-003 +-8.315445781273338e-004 + 5.558587783122442e-004 +-3.696533331522879e-004 + 2.460602463017792e-004 +-1.651618293595525e-004 + 1.114024919622099e-004 +-7.389805836530149e-005 + 4.938931786488272e-005 +-3.300905019751596e-005 + 2.206139792679832e-005 +-1.474460111811994e-005 + 9.854464474452981e-006 +-6.586171392444854e-006 + 4.401827590217889e-006 +-2.941934696111318e-006 + 1.966224160030928e-006 +-1.314113957933395e-006 + 8.782800707768828e-007 +-5.869931432254631e-007 + 3.923132969292148e-007 +-2.622002057839472e-007 + 1.752399127209358e-007 +-1.171205297822945e-007 + 7.827679370240814e-008 +-5.231581895777865e-008 + 3.496495939305279e-008 +-2.336861793837973e-008 + 1.561827366110047e-008 +-1.043837820431878e-008 + 6.976426582137068e-009 +-4.662652272535390e-009 + 3.116255286086561e-009 +-2.082730266047119e-009 + 1.391980105248554e-009 +-9.303214367194074e-010 + 6.217746736151215e-010 +-4.155593212088843e-010 + 2.777365447188800e-010 +-1.856235303493902e-010 + 1.240603574666303e-010 +-8.291498532420789e-011 + 5.541572611672626e-011 +-3.703676348776440e-011 + 2.475329560347511e-011 +-1.654371455635934e-011 + 1.105689099773430e-011 +-7.389805845555023e-012 + 4.938931788889779e-012 +-3.300905020390523e-012 + 2.206139792849932e-012 +-1.474460111857239e-012 + 9.854464474573356e-013 +-6.586171392476662e-013 + 4.401827590226633e-013 +-2.941934696113489e-013 diff --git a/TEM1dSAinv/ttt.txt b/TEM1dSAinv/ttt.txt new file mode 100644 index 0000000..0b08cbe --- /dev/null +++ b/TEM1dSAinv/ttt.txt @@ -0,0 +1,33 @@ + 1 1.22214105840640 26.4392500759339 + 146.682714158919 142.814919395534 97.3930008127266 + 9.56240490069675 + 9.999999975000000E-007 3382.13731041660 + 1.610262871000000E-006 1528.86461866395 + 2.592946657000000E-006 691.262225691014 + 4.175325557000000E-006 315.390203038714 + 6.723371826000000E-006 153.275717183400 + 1.082639574000000E-005 85.8790517374277 + 1.743334360000000E-005 56.7277816898824 + 2.807226701000000E-005 42.9616973655512 + 4.520372750000000E-005 35.8779609222572 + 7.278988778000000E-005 31.9390648325868 + 1.172107877000000E-004 29.4221640421972 + 1.887400722000000E-004 27.6851271259684 + 3.039209696000000E-004 27.0824340643733 + 4.893923760000000E-004 28.0500776826843 + 7.880499470000000E-004 30.7530013900114 + 1.268966938000000E-003 35.2734037322935 + 2.043369226000000E-003 41.5928727654426 + 3.290359862000000E-003 49.3917386359319 + 5.298341159000000E-003 57.8844892390800 + 8.531717584000001E-003 65.8624096340089 + 1.373830065000000E-002 72.1351638049793 + 2.212226391000000E-002 75.8000590303967 + 3.562264144000000E-002 76.6889869626912 + 5.736178532000000E-002 74.9922295493001 + 9.236750007000000E-002 71.3605248527560 + 0.148735880900000 66.3745026221652 + 0.239503726400000 60.5498461723078 + 0.385663747800000 54.5886793235369 + 0.621019721000000 48.5884018870011 + 1.00000441100000 42.9520620993038 diff --git a/TEM1dSAinv/uu.txt b/TEM1dSAinv/uu.txt new file mode 100644 index 0000000..2d98499 --- /dev/null +++ b/TEM1dSAinv/uu.txt @@ -0,0 +1,31 @@ + 1.0 100.0 + 0.9999999975E-06, 0.2400591642E-03 + 0.1610262871E-05, 0.2400585314E-03 + 0.2592946657E-05, 0.2400618486E-03 + 0.4175325557E-05, 0.2400573042E-03 + 0.6723371826E-05, 0.2399886394E-03 + 0.1082639574E-04, 0.2370218056E-03 + 0.1743334360E-04, 0.2139975027E-03 + 0.2807226701E-04, 0.1566532187E-03 + 0.4520372750E-04, 0.8953300011E-04 + 0.7278988778E-04, 0.4158600672E-04 + 0.1172107877E-03, 0.1664249372E-04 + 0.1887400722E-03, 0.6036465849E-05 + 0.3039209696E-03, 0.2073345585E-05 + 0.4893923760E-03, 0.6915832288E-06 + 0.7880499470E-03, 0.2196386831E-06 + 0.1268966938E-02, 0.6436770499E-07 + 0.2043369226E-02, 0.1726060816E-07 + 0.3290359862E-02, 0.4272469065E-08 + 0.5298341159E-02, 0.9934175265E-09 + 0.8531717584E-02, 0.2225204562E-09 + 0.1373830065E-01, 0.4962414524E-10 + 0.2212226391E-01, 0.1143924865E-10 + 0.3562264144E-01, 0.2821101408E-11 + 0.5736178532E-01, 0.7596871164E-12 + 0.9236750007E-01, 0.2237989747E-12 + 0.1487358809E+00, 0.7119302985E-13 + 0.2395037264E+00, 0.2399804785E-13 + 0.3856637478E+00, 0.8425719520E-14 + 0.6210197210E+00, 0.3040548694E-14 + 0.1000004411E+01, 0.1117619825E-14