computational mathematics AMATH242
创始人
2024-12-26 12:05:21
0
Total points: 20 1. (0 points) Please sign the Academic Integrity Checklist on the last page of this pdf. If you do not sign the Academic Integrity Checklist you will receive a 0 for this assignment. iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520 2. (Theoretical, 3 points) When applying Gauss-Seidel iteration to solve a linear system 𝐴 ⃗𝑥 = ⃗𝑏 and when 𝐴 is one of the two matrices below, we expect convergence of the iteration. You’re asked to argue why the convergence. Use two different arguments for convergence of Gauss-Seidel iteration applied to 𝐴1 and 𝐴2. (You’re allowed to use a software/calculator to compute, for example, an inverse of a matrix, if needed.)• Use vector 2-norm to evaluate the residuals;† • Use relative tolerance 𝜏rel = 10−3, i.e., the stopping criterion should be: ‖⃗𝑟 (𝑘) ‖ / ‖⃗𝑟 (0)‖ ≤ 10−3; • Use the zero vector (a vector with all its components being zeros) as the initial guess; • Output the final iteration count when stopping criterion is met. Apply your Jacobi and Gauss-Seidel codes to the two linear systems 𝐴 ⃗𝑥 = ⃗𝑏 and 𝐴bigger ⃗𝑥 = ⃗𝑏bigger, with their data provided on LEARN (A.txt,b.txt,A bigger.txt,b bigger.txt‡ ). Here is how you load matrix/vector data into MATLAB: 1 A = load ('A.txt ') ; 2 b = load ('b.txt ') ; And here is how you load them into Python: 1 import numpy as np 2 A = np . loadtxt ('A.txt ') 3 b = np . loadtxt ('b.txt ', ndmin =2) You are also asked to record the execution time of your code when solving each system. Here is how you do it if, for example, your Jacobi iteration is written as a function jacobi itr(A,b,guess,tol) in MATLAB§ : 1 % The execution of codes between tic and toc is timed by MATLAB 2 % and the elapsed time is printed out ( see the documentation for examples ) 3 tic 4 number_itr = jacobi_itr (A ,b , guess , tol ) ; % the final iteration count is the output 5 toc And here is how you do it in Python¶ : 1 import time 2 3 # ...... 4 # other codes here 5 # ...... 6 7 start = time . time () 8 nunmber_itr = jacobi_itr (A ,b , guess , tol ) 9 T = time . time () - start 10 print ('Elapsed time is ', T , 'seconds .')

相关内容

热门资讯

一分钟发现!同城跑胡子免费辅助... 一分钟发现!同城跑胡子免费辅助器,德州本来是有挂,技巧教程(有挂ai代打)1、进入到同城跑胡子免费辅...
两分钟普及!全民牛牛科技app... 两分钟普及!全民牛牛科技app,扑克之城本来存在有挂,安装教程(有挂技巧)全民牛牛科技app软件透明...
1分钟实锤!云来台州麻将游戏有... 1分钟实锤!云来台州麻将游戏有胜率吗,好运大菠萝原来存在有挂,系统教程(有挂揭秘)暗藏猫腻,小编详细...
4分钟科普!越乡游义乌麻将牛牛... 4分钟科普!越乡游义乌麻将牛牛有挂吗,传奇扑克真是是真的有挂,切实教程(有挂机密)1、4分钟科普!越...
四分钟科普!天天真人麻将怎么增... 四分钟科普!天天真人麻将怎么增加胜率,扑克世界一贯存在有挂,透视教程(有挂脚本);1、天天真人麻将怎...
两分钟辅助!云南星悦麻将有挂是... 两分钟辅助!云南星悦麻将有挂是真的吗,nzt德州一直存在有挂,系统教程(有挂技巧)1、云南星悦麻将有...
六分钟普及!闽游十三水专用平台... 六分钟普及!闽游十三水专用平台辅助器,wepoKE果然真的是有挂,教你教程(有挂总结)1、每一步都需...
5分钟了解!大晋游戏有外 挂吗... 5分钟了解!大晋游戏有外 挂吗,鱼扑克app俱乐部其实存在有挂,总结教程(有挂秘籍)进入游戏-大厅左...
9分钟辅助挂!哥哥杭州麻将小程... 9分钟辅助挂!哥哥杭州麻将小程序技巧,云扑克德州总是存在有挂,AI教程(有挂揭秘)1、下载好哥哥杭州...
九分钟普及!途游四川麻将是不是... 九分钟普及!途游四川麻将是不是有挂,WpK真是存在有挂,软件教程(有挂攻略);1、途游四川麻将是不是...