function [t,p,L]=traceray_ps(vp,zp,vs,zs,zsrc,zr,zd,x,xcap,pfan,itermax,optflag,pflag,dflag)
% TRACERAY_PS: traces a P-S (or S-P) reflection for v(z)
%
% [t,p,L]=traceray_ps(vp,zp,vs,zs,zsrc,zr,zd,x,xcap,pfan,itermax,optflag,pflag,dflag)
%
% TRACERAY_PS uses the modified bisection algorithm
% to trace a p-s reflection
% in a stratified medium.
%
% vp,zp = velocity and depth vectors giving the p wave model. Depths are
% considered to be the tops of homogeneous layers.
% vs,zs = velocity and depth vectors giving the s wave model.
% for both models, depths are considered to be the tops of homogeneous layers. Thus,
% the first velocity applies from the first depth to the second. A constant velocity
% would be specified like vp=1500;zp=0; etc.
% zsrc = depth of the source (scalar)
% zr = depth of receiver (scalar)
% zd = depth of the reflection (scalar)
% x = vector of desired source-receiver offsets (horizontal)
% MUST be non-negative numbers
% xcap = (scalar) capture radius
% pfan = vector of ray parameters to use for the initial fan of rays
% By default, the routine generates the fan using straight rays.
% Setting pfan to -1 or omitting it activates default behavior.
% Setting pfan to -2 causes the routine to use the pfan used in the
% last call to this program. (pfan of -1 and -2 are identical on the
% first call.)
% itermax = maximum number of iterations allowed for ray capture
% =========================== Default = 4 ================================
% optflag = if nonzero then refine captured rays by linear interpolation
% =========================== Default = 1 ================================
% pflag = if nonzero, then print information about all failed rays
% =========================== Default = 0 ================================
% dflag = 0 no action
% = 1 then a new figure window will be opened and the raypaths plotted
% = 2 raypaths will be plotted in the current window
% =========================== Default = 0 ================================
% NOTE: All z variables must be specified relative to a common datum
%
% t = vector of traveltimes for each x
% p = vector of ray parameters for each x
% L = vector of geometrical spreading factors for each x
% (if L is not asked for, it will not be calculated)
%
% G.F. Margrave, CREWES Project, June 1995
%
% NOTE: It is illegal for you to use this software for a purpose other
% than non-profit education or research UNLESS you are employed by a CREWES
% Project sponsor. By using this software, you are agreeing to the terms
% detailed in this software's Matlab source file.
% BEGIN TERMS OF USE LICENSE
%
% This SOFTWARE is maintained by the CREWES Project at the Department
% of Geology and Geophysics of the University of Calgary, Calgary,
% Alberta, Canada. The copyright and ownership is jointly held by
% its author (identified above) and the CREWES Project. The CREWES
% project may be contacted via email at: crewesinfo@crewes.org
%
% The term 'SOFTWARE' refers to the Matlab source code, translations to
% any other computer language, or object code
%
% Terms of use of this SOFTWARE
%
% 1) Use of this SOFTWARE by any for-profit commercial organization is
% expressly forbidden unless said organization is a CREWES Project
% Sponsor.
%
% 2) A CREWES Project sponsor may use this SOFTWARE under the terms of the
% CREWES Project Sponsorship agreement.
%
% 3) A student or employee of a non-profit educational institution may
% use this SOFTWARE subject to the following terms and conditions:
% - this SOFTWARE is for teaching or research purposes only.
% - this SOFTWARE may be distributed to other students or researchers
% provided that these license terms are included.
% - reselling the SOFTWARE, or including it or any portion of it, in any
% software that will be resold is expressly forbidden.
% - transfering the SOFTWARE in any form to a commercial firm or any
% other for-profit organization is expressly forbidden.
%
% END TERMS OF USE LICENSE
if(nargin<14)
dflag=0;
end
if(nargin<13)
pflag=0;
end
if(nargin<12)
optflag=1;
end
if(nargin<11)
itermax=4;
end
if( nargin<10)
pfan=-1;
end
if(~prod(double(size(vp)==size(zp))))
error('vp and zp must be the same size');
end
if(~prod(double(size(vs)==size(zs))))
error('vp and zp must be the same size');
end
if(length(zsrc)~=1 | length(zr)~=1 | length(zd)~=1 | length(xcap)~=1 )
error(' zsrc,zr,zd and xcap must be scalars ')
end
ind=find(x<0);
if(~isempty(ind));
error('offsets must be nonnegative');
end
%make sure zsrc < Zd and zr<zd
if(zsrc > zd )
error(' zsrc must be less than zd');
end
if(zr > zd )
error(' zr must be less than zd');
end
%adjust zsrc,zr,and zd and z2 so that they won't be exactly on layer boundaries
zsrc=zsrc+100000*eps;
zr=zr+100000*eps;
zd=zd-100000*eps;
if( zsrc < zp(1) | zsrc < zs(1))
error(' source depth outside model range');
elseif(zr < zp(1) | zr < zs(1) )
error('receiver depth outside model range');
end
%determine the layers we propagate through
%down leg
ind=find(zp>zsrc);
if(isempty(ind))
ibegd=length(zp);
else
ibegd=ind(1)-1;
end
ind=find(zp>zd);
if(isempty(ind))
iendd=length(zp);
else
iendd=ind(1)-1;
end
%test for sensible layer indices
if(iendd<1 | iendd > length(zp) | ibegd <1 | iendd > length(zp))
%somethings wrong. return nans
t=inf*ones(size(x));
p=nan*ones(size(x));
return;
end
%create v and z arrays for down leg
vp=vp(:);zp=zp(:);
vpd=[vp(ibegd:iendd);vp(iendd)];%last v is irrelevent.
zpd=[zsrc;zp(ibegd+1:iendd);zd];
%up leg
ind=find(zs>zr);
if(isempty(ind))
ibegu=length(zs);
else
ibegu=ind(1)-1;
end
ind=find(zs>zd);
if(isempty(ind))
iendu=length(zs);
else
iendu=ind(1)-1;
end
%test for sensible layer indices
if(iendu<1 | iendu > length(zs) | ibegu <1 | iendu > length(zs))
%somethings wrong. return nans
t=inf*ones(size(x));
p=nan*ones(size(x));
return;
end
%create v and z arrays for up leg
vs=vs(:);zs=zs(:);
vsu=[vs(ibegu:iendu);vs(iendu)];%last v is irrelevent.
zsu=[zr;zs(ibegu+1:iendu);zd];
% combine into one model. We shoot oneway rays through an
% equivalent model consiting of the down-leg model followed by
% the upleg model (upside down).
vmod=[vpd(1:end-1);flipud(vsu(1:end-1))];
tmp=flipud(zsu);
zmod=[zpd;cumsum(abs(diff(tmp)))+zpd(end)];
z1=zsrc;%start depth
z2=max(zmod)+100000*eps;%end depth
%determine pmax
vmax=max([vmod]);
nearlyone=.999;
pmax=nearlyone/vmax;
%the meaning of pmax is that it is the maximum ray parameter which will not
%be critically refracted anywhere in vp or vs.
if(pfan==-2)
global PFAN
if(isempty(PFAN))
pfan=-1;
else
pfan=PFAN;
PFAN=-2;
end
else
PFAN=0;
end
if(pfan==-1)
%shoot a fan of rays Iterate once if the fan does not span the xrange
%guess angle range
nrays=max([3*length(x),10]);
pfan=linspace(0,1/max(vmod),nrays);
% xmaxf=max(x);
% xminf=min(x);
% if(xminf~=xmaxf)
% nrays=3*length(x);
% xfan=linspace(xminf,xmaxf,nrays);
% %th=atan(xfan/(z2-z1));
% th = pi*linspace(0,90,nrays)/180;
% %determine the fan ray parameters
%
% pfan=sin(th)/vmod(1);
%
% %put in a max and min p
% if(min(pfan)>0)
% pfan=[0 pfan];
% xfan=[0 xfan];
% nrays=nrays+1;
% end
%
% if(max(pfan)>pmax)
% ind=find(pfan<pmax);
% pfan=pfan(ind);
% xfan=xfan(ind);
% nrays=length(ind);
% end
%
% if(max(pfan)<pmax)
% pfan=[pfan pmax];
% xfan=[xfan (z2-z1)*nearlyone/sqrt(1-nearlyone*nearlyone)];
% nrays=nrays+1;
% end
%
% xminf=2.0*min(xfan);
% xmaxf=2.0*max(xfan);
% else
% %3 rays 1
没有合适的资源?快使用搜索试试~ 我知道了~
基于MATLAB实现的二维射线追踪程序!地震声波正演源程序+使用说明文档.zip
共30个文件
m:28个
mat:1个
md:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 66 浏览量
2024-05-23
09:26:22
上传
评论
收藏 411KB ZIP 举报
温馨提示
CSDN IT狂飙上传的代码均可运行,功能ok的情况下才上传的,直接替换数据即可使用,小白也能轻松上手 【资源说明】 基于MATLAB实现的二维射线追踪程序!地震声波正演源程序+使用说明文档.zip 1、代码压缩包内容 主函数:main.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2020b;若运行有误,根据提示GPT修改;若不会,私信博主(问题描述要详细); 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开main.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、仿真咨询 如需其他服务,可后台私信博主; 4.1 期刊或参考文献复现 4.2 Matlab程序定制 4.3 科研合作 功率谱估计: 故障诊断分析: 雷达通信:雷达LFM、MIMO、成像、定位、干扰、检测、信号分析、脉冲压缩 滤波估计:SOC估计 目标定位:WSN定位、滤波跟踪、目标定位 生物电信号:肌电信号EMG、脑电信号EEG、心电信号ECG 通信系统:DOA估计、编码译码、变分模态分解、管道泄漏、滤波器、数字信号处理+传输+分析+去噪、数字信号调制、误码率、信号估计、DTMF、信号检测识别融合、LEACH协议、信号检测、水声通信 5、欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于MATLAB实现的二维射线追踪程序!地震声波正演源程序+使用说明文档.zip (30个子文件)
使用说明文档.md 13KB
raytrace
demoprep2.m 352B
rayvxz_wave.m 5KB
rayfan.m 4KB
traceray_pp.m 13KB
raymig.m 3KB
shootray.m 3KB
sphdiv.m 3KB
normray.m 5KB
testray.m 472B
drayveclin.m 2KB
normraymig.m 4KB
marmousi_mod.mat 471KB
rayfan_a.m 4KB
clearrays.m 3KB
traceray.m 13KB
shootraytosurf.m 5KB
demoprep.m 369B
drawray.m 5KB
raytrace_demo.m 8KB
eventraymig.m 3KB
eventraymod.m 3KB
shootrayvxz.m 5KB
drayvec.m 4KB
shootrayvxz_g.m 2KB
traceray_ps.m 13KB
rayvelmod.m 4KB
rayvxz_demo.m 3KB
raymarmousi_demo.m 2KB
Contents.m 2KB
共 30 条
- 1
资源评论
IT狂飙
- 粉丝: 4778
- 资源: 2640
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于74LS161+ 74LS192芯片实现倒计时定时器Multisim仿真源文件,Multisim10以上版本可打开运行
- 科大讯飞语音引擎 jar包 demo,科大讯飞语音合成引擎3.0,支持4.0系统以上,文字转语音输出.zip
- Java架构面试笔试专题资料及经验(含答案)SpringBoot面试Linux面试专题及答案 合集.zip
- 头歌c语言实验答案tion-model-for-ne开发笔记
- docker配置使用-model-for-networK开发demo
- docker配置使用vaWeb-mas笔记
- c语言连接两个字符串-mas开发笔记
- 俄罗斯引擎yandex进入x-master 笔记
- 头歌c语言实验答案el-for-network-ids-ma笔记
- 一个delphi写的连连看
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功