1 / 12

Sparse matrix

Sparse matrix. fort.97. <NOTE> fort.97 record the RHS. row index. RHS. <NOTE> fort.96 record the solution vector. row index. Solution vector. Take dimension by 9. fort.98. There are 3 nonzero element in row1 There are 4 nonzero element in row2 There are 3 nonzero element in row3 …

reginaldw
Download Presentation

Sparse matrix

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Sparse matrix

  2. fort.97 <NOTE> fort.97 record the RHS row index RHS <NOTE> fort.96 record the solution vector row index Solution vector

  3. Take dimension by 9 fort.98 There are 3 nonzero element in row1There are 4 nonzero element in row2 There are 3 nonzero element in row3 … … … There are 3 nonzero element in row10 10 exceed the dimension => end of matrix row index The first nonzero element’s index <NOTE> fort.98 help us to know how many nonzero element in each row

  4. The row index The column index The entity of corresponding index <NOTE> fort.99 actually record the matrix

  5. procedure • Step I : Modify parameter n to change the dimension of matrix A • Step II : Execute the programming in fortran to get the solution vector • Step III : Load fort.96, fort.97, fort.99 into matlab to get data we need • Step IV : Construct a sparse matrix then get solution vector • Step V : Compute the SupNorm of solution vector in fortran and in matlab

  6. Step I : set the dimension of sparse matrix lupara.nml In this experiment We use n =128, 256, 512, 1024 consecutively dimension (n-1)^2 <NOTE> we use lipara.nml to change the dimension of our matrix

  7. Step II : make project and execute In execution , showing some information to us

  8. Step III : load the file into matlab [1] Load fort.96 and fort.97, then get the RHS and solution vector Solution vector RHS <NOTE> we ignore the first column, because it is index

  9. Step III : load the file into matlab [2] Load fort.99, then get the parameter I, J, S

  10. Step IV : Construct a sparse matrix then get solution vector Construct sparse A Do solute

  11. Step IV : Compute the SupNorm of solution vector in fortran and in matlab Compute the SupNorm

  12. N = 128 SupNorm = 8.049116928532385e-16 N = 256 SupNorm = 6.383782391594650e-15 N = 512 SupNorm = 1.434963259328015e-14 N = 1024 SupNorm = 1.975294927625271e-13 When n increase 2 times, dimension increase 4 times roughly. ConclusionWhen n become double , we lose one point accuracy

More Related