|
George Mason UniversityConor Philip NelsonSource: Home > Classes > Math 447 > Project 1 > Step 3Math 447: Numerical Analysis
3. Rerun the calculation in step 1 for \(n=10*2^k\), where \(k=1,...,11\). Make a table of the at \(x=L\) for each \(n\). For which \(n\)is the error smallest? Why does the error begin to increase with \(n\) after a certain point? You may want to make an accompanying table of condition number of \(A\) as a function of \(n\) to help answer the last question. To carry out this step for large \(k\), you may need to ask Matlab to store the matrix \(A\) as a sparse matrix to avoid running out of memory. To do this, just initialize \(A\) with the command \(A=sparse(n,n)\), and proceed as before. We will discuss sparse matrices in more detail in the next section. Results: The table below shows us that at \(n = 20\), our error is the smallest. As at \(n =10\) the resultant error was near machine epsilon, any more discretization of the model only produces increased error due to round-off. It can be seen that we cannot bound the error any further as the condition number of the matrix grows larger and larger as the matrix increases in size.
Code for Results
|