20 likes | 95 Vues
CSE245 Lab 3. In this lab we will use KLU ( klu ), GMRES ( gmres ) and Preconditioned Conjugate Gradients ( pcg ) methods in Matlab to solve four circuit matrices* and compare the results. Setup: ssh to cselab1.ucsd.edu and execute the following commands: cp /home/hepeng/cse245_lab3.tar.gz .
E N D
CSE245 Lab 3 • In this lab we will use KLU (klu), GMRES (gmres) and Preconditioned Conjugate Gradients (pcg) methods in Matlab to solve four circuit matrices* and compare the results. • Setup: • ssh to cselab1.ucsd.edu and execute the following commands: • cp /home/hepeng/cse245_lab3.tar.gz . • tar xvzf cse245_lab3.tar.gz • cd cse245_lab3 • matlab & • Generate a random right hand side b for the matrices. For example, run the following commands in Matlab: • %load matlab file scircuit.mat • load scircuit; • A = Problem.A; • % generate RHS • b = sum(A,2); • % solve Ax = b • ….. • ….. * Matrix Source: http://www.cise.ufl.edu/research/sparse/matrices/
CSE245 Lab 3 • Before you start, please read the matlab reference pages for these solvers. (Type doc klu or doc gmres or doc pcg in Matlab to access these reference pages) • Use ILU (luinc) as preconditioner for GMRES and PCG. • Do not use PCG unless the matrix is symmetric and positive definite. • It is suggested that you read and run the KLU demo in Matlab: • edit /home/hepeng/klu/KLU/MATLAB/klu_demo.m • For more information about KLU: • http://cseweb.ucsd.edu/classes/fa04/cse245/notes/KLU.pdf • http://www.cise.ufl.edu/research/sparse/klu/ • Tune input parameters for each solver and try to get the best runtime** results. • Deliverable: • A Matlab script that reads the circuit matrices and calls klu/gmres/pcg to solve the matrices. • A report that compares the runtime of these three different solvers. Explain the runtime difference. ** Run doc cputime in Matlab