2022年完整word版,MATLAB实验报告 .pdf

上传人:C****o 文档编号:34261742 上传时间:2022-08-15 格式:PDF 页数:4 大小:53.18KB
返回 下载 相关 举报
2022年完整word版,MATLAB实验报告 .pdf_第1页
第1页 / 共4页
2022年完整word版,MATLAB实验报告 .pdf_第2页
第2页 / 共4页
点击查看更多>>
资源描述

《2022年完整word版,MATLAB实验报告 .pdf》由会员分享,可在线阅读,更多相关《2022年完整word版,MATLAB实验报告 .pdf(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、年级、专业数学与应用数学姓名卢海宽学号 150142009040 名单序号117 实验时间2011 年 11 月 27 日 Matlab 版本2010b 注:实验报告的最后一部分是实验小结与收获实验( 6):蒙特卡洛模拟(Monte Carlo Simulation)第 1 页 共 4 页1 Using Monte Carlo simulation, write a Matlab program to calculate an approximation to by considering the number of random points selected inside the quar

2、ter circle 22:1,0,0Qxyxywhere the quarter circle is taken to be inside the square :01,01Sxycount=0;n=10000;for i=1:n x(i)=rand(1); y(i)=sqrt(1-(x(i)2); z=rand(1);if z=y(i) count=count+1;end ;end ;s=count/nPI=4*s 结果: s =0.7869 PI =3.1476 s =0.7819 PI =3.1276 s =0.7828 PI =3.1312 2.Using Monte Carlo s

3、imulation, write a Matlab program to calculate the volume of an ellipsoid (椭球体)22216248xyzcount=0;n=10000;for i=1:n x(i)=sqrt(32)*rand(1); y(i)=8*rand(1); z(i)=sqrt(8*16-4*(x(i)2-2*(y(i)2); u=sqrt(128)*rand(1); if u=z(i) count=count+1;名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 -

4、 - - - - - - 第 1 页,共 4 页 - - - - - - - - - 年级、专业数学与应用数学姓名卢海宽学号 150142009040 名单序号117 实验时间2011 年 11 月 27 日 Matlab 版本2010b 注:实验报告的最后一部分是实验小结与收获实验( 6):蒙特卡洛模拟(Monte Carlo Simulation)第 2 页 共 4 页end ;end ;v=4*count/n*sqrt(32*64*128) 结果:v = 1.0758e+003 v = 1.0627e+003 v = 1.0818e+003 3、Use Monte Carlo simul

5、ation to simulate the rolls of an unfair die. Assume the die is biased according to the following empirical distribution: Roll Value Probability 1 0.1 2 0.1 3 0.2 4 0.3 5 0.2 6 0.1 设 pi(i=1,2,3,4,5,6)表示色子显示i 点的概率。count=0 0 0 0 0 0;n=12000;for i=1:n x(i)=rand(1);if x(i)0.1 & x(i)0.2 & x(i)0.4 & x(i)0

6、.7 & x(i)=0.5)if(P(i+1)=0.5 & P(i+2)=0.5) count = count + 1;break;endendendendp = count/n 结果: p = 0.3680 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 4 页 - - - - - - - - - 年级、专业数学与应用数学姓名卢海宽学号 150142009040 名单序号117 实验时间2011 年 11 月 27 日 Matlab 版本2010b 注:实验报告的最后一

7、部分是实验小结与收获实验( 6):蒙特卡洛模拟(Monte Carlo Simulation)第 4 页 共 4 页p = 0.3659 p = 0.36735、 (Optional) Using Monte Carlo simulation, write a Matlab program to calculate the volume trapped between the two paraboloids(抛物体)222283zxy and zxyNote that the two paraboloids intersect (相交 )on the elliptic cylinder 2224xy名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 4 页 - - - - - - - - -

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁