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 .')

相关内容

热门资讯

脚本解密!wpk透视辅助方法,... 脚本解密!wpk透视辅助方法,有哪些免费的wpk作必弊码(透视)真是是真的app(哔哩哔哩);1、上...
脚本解谜!hhpoker软件安... 脚本解谜!hhpoker软件安装包,hhpoker视频巡查真的假的(透视)一直真的是有插件(哔哩哔哩...
脚本分享!wpk显示有作必弊,... 脚本分享!wpk显示有作必弊,wpk俱乐部辅助器(透视)总是真的有软件(哔哩哔哩)1、让任何用户在无...
透视关于!wepoker怎么拿... 透视关于!wepoker怎么拿到好牌,wepokerplus辅助(透视)确实真的是有app(哔哩哔哩...
透视详情!hhpoker怎么破... 透视详情!hhpoker怎么破解,hhpoker底牌透视脚本(透视)总是真的有技巧(哔哩哔哩)1、实...
脚本透视!aapoker脚本,... 脚本透视!aapoker脚本,aapoker如何设置胜率(透视)总是是有技巧(哔哩哔哩)小薇(辅助器...
脚本详情!德普之星辅助工具如何... 脚本详情!德普之星辅助工具如何设置,德普之星辅助工具如何打开(透视)总是真的是有脚本(哔哩哔哩)脚本...
透视推荐!wpk官网下载链接,... 透视推荐!wpk官网下载链接,wpk透视辅助(透视)都是是真的教程(哔哩哔哩)1、超多福利:超高返利...
脚本详情!wpk辅助器,wpk... 脚本详情!wpk辅助器,wpk德州局怎么透视(透视)好像是真的软件(哔哩哔哩)1、德州局怎么透视破解...
透视分享!wejoker透视方... 透视分享!wejoker透视方法,wepoker黑侠辅助器(透视)都是真的有脚本(哔哩哔哩)1、用户...