版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、应用地球物理学课程作业基于MATLAB的球体重力正演程序实验报告1一 程序简介本程序基于MATLAB软件的GUI模块编写,旨在实现球体重力正演结果的可视化分析。MATLAB是一个高级的编程语言,其矩阵思想方便了地球物理的编程工作。随着该语言和相应软件的发展,其内部也集成了许多模块,如该实验用到的GUI模块。在该模块中,可以通过窗口、按键和赋值框等基本元素的组合,编写出可视化的应用程序,再配合MATLAB强大的作图功能,可以实现正演结果的展示与分析。该程序应包含以下内容:1. 可以自由输入参数,如球体半径,埋深和剩余密度。2. 可以计算出g、VZZ、VXZ和VZZZ这四种重力异常及其导数的对应值
2、。3. 可以绘制剖面图及平面图两种图像。二 源程序由于GUI程序的头文件均大同小异,这里只列出赋值框及绘图按键的程序代码。% - Executes on selection change in popupmenu1.function popupmenu1_Callback(hObject, eventdata, handles)% hObject handle to popupmenu1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with han
3、dles and user data (see GUIDATA) % Hints: contents = cellstr(get(hObject,'String') returns popupmenu1 contents as cell array% contentsget(hObject,'Value') returns selected item from popupmenu1s=get(hObject,'value');handles.s = s;guidata(hObject, handles);function edit1_Callba
4、ck(hObject, eventdata, handles)% hObject handle to edit1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit1 as text% str2double(get(hObject,'Stri
5、ng') returns contents of edit1 as a doubled = str2double(get(hObject,'string');handles.d = d;guidata(hObject, handles);function edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles struc
6、ture with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit2 as text% str2double(get(hObject,'String') returns contents of edit2 as a doubler = str2double(get(hObject,'string');handles.r = r;guidata(hObject, handles);function edit3_Ca
7、llback(hObject, eventdata, handles)% hObject handle to edit3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of edit3 as text% str2double(get(hObject,'
8、String') returns contents of edit3 as a doublero = str2double(get(hObject,'string');handles.ro = ro;guidata(hObject, handles);% - Executes on button press in pushbutton1.function pushbutton1_Callback(hObject, eventdata, handles)% hObject handle to pushbutton1 (see GCBO)% eventdata reserv
9、ed - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ro = handles.ro;r = handles.r;d = handles.d;x=-2*d:2*d;G=6.67e-11;pi=3.14159;switch handles.s case 2 z=4*ro*pi*G*r3*d./(3*(x.2+d2).1.5); plot(x,z.*1e6);xlabel('X/m');ylabel('Delta
10、g/g.u.'); case 3 z=4*ro*pi*G*r3*(2*d2-x.2)./(3*(x.2+d2).2.5); plot(x,z.*1e9);xlabel('X/m');ylabel('Vzz/E'); case 4 z=-4*ro*pi*G*r3*(d.*x)./(x.2+d2).2.5; plot(x,z.*1e9);xlabel('X/m');ylabel('Vxz/E'); case 5 z=4*ro*pi*G*r3*(2*d2-3.*x.2)./(x.2+d2).3.5; plot(x,z.*1e9)
11、;xlabel('X/m');ylabel('Vzzz/nMKS');end% - Executes on button press in pushbutton3.function pushbutton3_Callback(hObject, eventdata, handles)% hObject handle to pushbutton3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and
12、 user data (see GUIDATA)ro = handles.ro;r = handles.r;d = handles.d;x=-2*d:2*d;y=-2*d:2*d;X,Y=meshgrid(x,y);G=6.67e-11;pi=3.14159;switch handles.s case 2 c=4*ro*pi*G*r3*d./(3*(X.2+Y.2+d2).1.5); contour(X,Y,c.*1e6,'showtext','on');colormap(winter);xlabel('X/m');ylabel('Y/m
13、'); case 3 c=4*ro*pi*G*r3*(2*d2-X.2-Y.2)./(3*(X.2+Y.2+d2).2.5); contour(X,Y,c.*1e9,'showtext','on');colormap(winter);xlabel('X/m');ylabel('Y/m'); case 4 c=-4*ro*pi*G*r3*(d.*X.*Y)./(X.2+Y.2+d2).2.5; contour(X,Y,c.*1e9,'showtext','on');colormap(winter);xlabel('X/m');ylabel('Y/m'); case 5 c=4*ro*pi*G*r3*(2*d2-3.*X.2-Y.2)./(X.2+Y.2+d2).3.5;
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026山西运城市北赵引黄服务中心有限公司招聘20人考试备考题库及答案解析
- 2026年靖宇县公开招聘城市社区工作者专职岗位人员(12人)考试备考题库及答案解析
- 2026福建三明市浦丰乡村发展集团有限公司及其下属企业招聘4人考试备考题库及答案解析
- 2026四川省革命伤残军人休养院(四川省第一退役军人医院)第一批招聘编外人员11人考试参考试题及答案解析
- 2026年甘肃卫生职业学院招聘高层次人才20人(第一批)考试备考题库及答案解析
- 2025天津市第二批次工会社会工作者招聘笔试环节及相关安排考试参考题库及答案解析
- 2025安徽芜湖市湾沚区国有资本建设投资(集团)有限公司及其子公司第一批人员招聘递补考试备考题库及答案解析
- 2026年保山市图书馆城镇公益性岗位招聘(8人)考试参考题库及答案解析
- 2026广东江门市供销集团侨通农产品有限公司招聘业务岗1人考试备考试题及答案解析
- 2026年保山市昌宁县机关事务管理局招聘编外工作人员(1人)考试备考题库及答案解析
- 道岔滚轮作用原理讲解信号设备检修作业课件
- 小学师徒结对师傅工作总结
- 廉洁征兵培训课件
- 2024-2025学年山东省临沂市高二上学期期末学科素养水平监测数学试卷(含答案)
- 农业机械行业调研报告
- 金融行业风险控制与投资策略研究
- 北京巿通州区2025届高二数学第一学期期末考试试题含解析
- 幼儿园大班语言活动《新年礼物》课件
- BCG-并购后整合培训材料-201410
- 古代汉语与中华文明智慧树知到期末考试答案章节答案2024年山东师范大学
- JB-T 8881-2020 滚动轴承 渗碳轴承钢零件 热处理技术条件
评论
0/150
提交评论