《数值分析1分析和总结.docx》由会员分享,可在线阅读,更多相关《数值分析1分析和总结.docx(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、MATLAB与科学计算作业老师:姓名:学号:专业:L给定处置问题y=2.-Lix2, XI Xy =1;、(1)编辑函数文件(1)第九章习题y = -50 y + 50x2 + 2x,0 x x=X表示自变量Columns 1 through 181.00001.02501.05001.07501.10001.12501.15001.17501.20001.22501.25001.27501.30001.32501.35001.37501.40001.4250Columns 19 through 361.45001.47501.50001.52501.55001.57501.60001.625
2、01.65001.67501.70001.72501.75001.77501.80001.82501.85001.8750第1页共1页MATLAB与科学计算作业Columns 37 through 411.90001.9250 y =Columns 1 through 181.00000.99970.98530.98200.95460.9503Columns 19 through 360.94590.94150.90960.90500.87310.8686Columns 37 through 410.86410.85970.8553 plot (x,y)10.950.90.850.81.950
3、01.97502.0000y表示0.99880.99750.99570.97850.97490.97100.93700.93250.92790.90040.89580.89120.85090.84660.99360.99110.98830.96710.96300.95890.92330.91880.91420.88660.88210.8776(2)编辑函数文件Fun.mfunction f=fun (x, y)f=-50*y+50*x.2+2*x;y的表达式第2页共2页MATLAB与科学计算作业在MATLAB命令窗口中输入:|x, y|=ode45(fun,0,1|, 1 /3) de45表示
4、采用四阶、五阶Runge-Kutta方法求解常微分 方程,fun代表导函数,0,1表示x的区间范围,y表示函数的初值,y(0)=l/3 x= -X表示自变量Columns 1 through 18笫3页共3页00.00100.00200.00300.00400.00810.01220.01630.02040.02440.02830.03220.04790.05180.0558Columns 19 through 360.03610.04010.04400.05970.06370.06760.07160.07560.07960.08360.08770.09190.09600.10020.1183
5、0.12370.12910.1345Columns 37 through 540.10470.10930.11380.13990.14620.15250.15890.16520.17250.17970.18700.19430.20230.21030.24330.25180.26040.2693Columns 55 through 720.21830.22620.23480.27830.28730.29630.30560.31500.32440.33380.34350.35330.36310.37290.41340.42390.43440.4449Columns 73 through 900.3
6、8300.39310.40330.45530.46620.47700.48780.49860.50980.52090.53210.54320.55460.56610.61240.62420.63590.6479Columns 91 through 1080.57750.58900.6007MATLAB与科学计算作业第4页共4页0.65990.67190.68390.69620.70850.72070.73300.74550.75800.83410.84700.77060.86000.78310.87300.79580.80860.8213Columns 109 through 1210.886
7、00.89910.91230.92550.93870.95210.96540.97880.9922 y =0.99410.99610.99801.0000y表示自变量Columns 1 through 180.33330.31700.30150.28670.27270.22200.18090.14750.12040.03890.03270.09920.02770.08180.02360.06770.05610.0466Columns 19 through 360.02040.01790.01590.01440.01330.01260.01210.01180.01180.01490.01600.
8、01200.01720.01230.01850.01270.01340.0141Columns 37 through 540.01990.02160.02340.02540.02740.02980.03230.03500.03780.05920.06340.04090.06780.04420.07250.04760.05120.0551Columns 55 through 720.07740.08250.08780.09340.09920.10520.11140.11800.12480.17090.17970.13180.18860.13910.19790.14670.15450.1626MA
9、TLAB与科学计算作业Columns 73 through 900.20740.21730.22750.30760.40450.23800.32040.41970.24870.33360.25980.34700.27130.36080.28310.29510.37500.3896Columns 91 through 1080.43540.45150.46790.48460.50180.51950.53750.55570.57450.69590.71740.59380.73940.61340.76210.63330.65360.6746Columns 109 through 1210.78510
10、.80830.95810.98470.83210.98860.85660.88140.99240.99631.00020.90630.9318 plot (x,y)困二1.41.210.80.60.40.200.10.20.30.40.50.60.70.80.91第5页共5页MATLAB与科学计算作业心得:通过上课的学习以及课后的练习,认识了 MATLAB软件的功 能,初步知道软件的开展应用,熟悉并且掌握了表示用二阶、三 阶和用四阶、五阶的Runge-Kutta法解常微分方程的函数ode23()、 ode45 ()的用法,使用MATLAB求解简单的微分方程问题。并 且操作具体例题,画出所求方程的图像。第6页共6页