diff --git a/ENUME/projectA/QRNoShifts.asv b/ENUME/projectA/QRNoShifts.asv deleted file mode 100644 index 36d9cd70..00000000 --- a/ENUME/projectA/QRNoShifts.asv +++ /dev/null @@ -1,85 +0,0 @@ -function [eigenValues, whichIterationAreWeOn, Matrix] = QRNoShifts(Matrix) - - [whichIterationAreWeOn, threshold, startingMatrix, matlabEigen] = initializeValues(Matrix); - [Matrix, whichIterationAreWeOn] = QRNoShiftsLoop(threshold, Matrix, whichIterationAreWeOn); - eigenValues = diag(Matrix)'; - %displayResults(eigenValues, whichIterationAreWeOn, Matrix, startingMatrix, matlabEigen); -end - -function [Matrix, whichIterationAreWeOn] = QRNoShiftsLoop(threshold, Matrix, whichIterationAreWeOn) - while threshold > 1e-6 - [Matrix, whichIterationAreWeOn, threshold] = QRNoShiftsInsideLoop(Matrix, whichIterationAreWeOn); - end -end - -function [Matrix, whichIterationAreWeOn, threshold] = QRNoShiftsInsideLoop(Matrix, whichIterationAreWeOn) - [Q, R] = gramSchmidtAlgorithm(Matrix); - Matrix = R * Q; - whichIterationAreWeOn = whichIterationAreWeOn + 1; - - % iterate until all non-diagonal elements are below the threshold - matrixWithoutDiagonal = Matrix - diag(diag(Matrix)); % first diag converts Matrix - % into vector consisting of values on the diagonal of matrix, - % second diag converts this vector into matrix with zeros on - % everything except diagonal - % If we substract it from Matrix we get original Matrix with zeros - % on a diagonal - threshold = max(max(abs(matrixWithoutDiagonal))); - % first max returns vector of elements - % second max returns max element from this vector -end - -function displayResults(eigenValues, whichIterationsAreWeOn, Matrix, startingMatrix, matlabEigen) - disp("How many iterations it took:") - disp(whichIterationsAreWeOn) - disp("Starting Matrix:") - disp(startingMatrix) - disp("Final Matrix:") - disp(Matrix) - disp("eig(Matrix) eigen values:") - disp(matlabEigen) - disp("Our eigen values:") - disp(eigenValues); -end - -function [whichIterationAreWeOn, threshold, startingMatrix, matlabEigen] = initializeValues(Matrix) - whichIterationAreWeOn = 0; - threshold = inf; - startingMatrix = Matrix; - matlabEigen = eig(Matrix); -end - -% performs QR or QRdash decomposition of a matrix -function [Q, R] = gramSchmidtAlgorithm(Matrix) - [columns, Q, R, d] = initializeGramSchmid(Matrix); - [Q, R] = factorizeColumnsOfQ(columns, Q, Matrix, R, d); - [Q, R] = normalizeColumns(columns, Q, R); -end - -function [columns, Q, R, d] = initializeGramSchmid(Matrix) - % We start with empty matrices - [rows, columns] = size(Matrix); - Q = zeros(rows, columns); - R = zeros(columns, columns); - d = zeros(1, columns); -end - -function [Q, R] = factorizeColumnsOfQ(columns, Q, Matrix, R, d) - for i = 1 : columns - Q(:, i) = Matrix(:, i); - R(i, i) = 1; - d(i) = Q(:, i)' * Q(:, i); - for i2 = i + 1 : columns - R(i, i2) = (Q(:, i)' * Matrix(:, i2)) / d(i); - Matrix(:, i2) = Matrix(:, i2) - R(i, i2) * Q(:, i); - end - end -end - -function [Q, R] = normalizeColumns(columns, Q, R) - for i = 1 : columns - dd = norm(Q(:, i)); - Q(:, i) = Q(:, i) / dd; - R(i, i:columns) = R(i, i : columns) * dd; - end -end \ No newline at end of file diff --git a/ENUME/projectA/projectA.aux b/ENUME/projectA/projectA.aux index 690d87a7..6b1f0cc1 100644 --- a/ENUME/projectA/projectA.aux +++ b/ENUME/projectA/projectA.aux @@ -22,10 +22,10 @@ \@writefile{toc}{\contentsline {section}{\numberline {1.1}Problem}{4}{section.1.1}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {1.2}Theoretical Introduction}{4}{section.1.2}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {1.2.1}Definition of machine epsilion}{4}{subsection.1.2.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.2}Practical applications of machine epsilion}{4}{subsection.1.2.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {1.2.2}Practical applications of machine epsilion}{5}{subsection.1.2.2}\protected@file@percent } \@writefile{toc}{\contentsline {section}{\numberline {1.3}Solution}{6}{section.1.3}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {1.3.1}Matlab code}{6}{subsection.1.3.1}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {1.4}Discussion of the result}{6}{section.1.4}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {1.4}Discussion of the result}{7}{section.1.4}\protected@file@percent } \@writefile{toc}{\contentsline {chapter}{\numberline {2}Problem 2 - Solving a system of n linear equations - indicated method}{8}{chapter.2}\protected@file@percent } \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} @@ -37,103 +37,108 @@ \@writefile{toc}{\contentsline {subsubsection}{Zeroing second column}{9}{section*.4}\protected@file@percent } \@writefile{toc}{\contentsline {subsubsection}{Zeroing next columns}{10}{section*.5}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.2.2}Backward substitution}{10}{subsection.2.2.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.3}Partial Pivoting}{10}{subsection.2.2.3}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {2.3}Results}{11}{section.2.3}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {2.4}Discussion of results}{14}{section.2.4}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {2.2.3}Partial Pivoting}{11}{subsection.2.2.3}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {2.3}Results}{12}{section.2.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {2.3.1}2a)}{12}{subsection.2.3.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {2.3.2}2b)}{14}{subsection.2.3.2}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {2.4}Discussion of results}{16}{section.2.4}\protected@file@percent } \@writefile{toc}{\contentsline {subsection}{\numberline {2.4.1}Errors in b)}{17}{subsection.2.4.1}\protected@file@percent } \@writefile{toc}{\newpage } -\@writefile{toc}{\contentsline {chapter}{\numberline {3}Problem 3 - Solving a system of n linear equations - iterative algorithm}{18}{chapter.3}\protected@file@percent } +\@writefile{toc}{\contentsline {chapter}{\numberline {3}Problem 3 - Solving a system of n linear equations - iterative algorithm}{19}{chapter.3}\protected@file@percent } \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {3.1}Problem}{18}{section.3.1}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {3.2}Theoretical introduction}{19}{section.3.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.1}Procedure}{19}{subsection.3.2.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Decomposing matrix}{19}{section*.6}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Jacobi's method}{20}{section*.7}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{Converging}{20}{section*.8}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Gauss-Seidel method}{21}{section*.9}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{Converging}{22}{section*.10}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Stop tests}{22}{section*.11}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{\textbf {A} and \textbf {b}}{23}{section*.12}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {3.3}Results}{23}{section.3.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {3.3.1}Jacobi method result}{23}{subsection.3.3.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Minimizing the demanded error}{26}{section*.13}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{For original system of equations:}{26}{section*.14}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{For task 2a) system of equations:}{26}{section*.15}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {3.3.2}Gauss-Seidel method result}{27}{subsection.3.3.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Minimizing the demanded error}{28}{section*.16}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{For original system of equations:}{28}{section*.17}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{For task 2a) system of equations:}{29}{section*.18}\protected@file@percent } -\@writefile{toc}{\contentsline {paragraph}{Table}{30}{section*.19}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {3.4}Discussion of results}{30}{section.3.4}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.1}Comparison based on table}{30}{subsection.3.4.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.2}Convergence}{30}{subsection.3.4.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{2b) task convergence }{31}{section*.20}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{Iterations as function of size of Matrix}{31}{section*.21}\protected@file@percent } -\@writefile{toc}{\contentsline {chapter}{\numberline {4}Problem 4 - QR method of finding eigenvalues}{34}{chapter.4}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {3.1}Problem}{19}{section.3.1}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {3.2}Theoretical introduction}{20}{section.3.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.2.1}Procedure}{20}{subsection.3.2.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Decomposing matrix}{20}{section*.6}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Jacobi's method}{21}{section*.7}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{Converging}{21}{section*.8}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Gauss-Seidel method}{22}{section*.9}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{Converging}{23}{section*.10}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Stop tests}{24}{section*.11}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{\textbf {A} and \textbf {b}}{25}{section*.12}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {3.3}Results}{26}{section.3.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.3.1}Jacobi method result}{26}{subsection.3.3.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Minimizing the demanded error}{28}{section*.13}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{For original system of equations:}{29}{section*.14}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{For task 2a) system of equations:}{30}{section*.15}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.3.2}Gauss-Seidel method result}{31}{subsection.3.3.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Minimizing the demanded error}{32}{section*.16}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{For original system of equations:}{32}{section*.17}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{For task 2a) system of equations:}{33}{section*.18}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {3.4}Discussion of results}{34}{section.3.4}\protected@file@percent } +\@writefile{toc}{\contentsline {paragraph}{Table}{34}{section*.19}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.1}Comparison based on table}{34}{subsection.3.4.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {3.4.2}Convergence}{35}{subsection.3.4.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{2b) task convergence }{35}{section*.20}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{Iterations as function of size of Matrix}{36}{section*.21}\protected@file@percent } +\@writefile{toc}{\contentsline {chapter}{\numberline {4}Problem 4 - QR method of finding eigenvalues}{39}{chapter.4}\protected@file@percent } \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {4.1}Problem}{34}{section.4.1}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {4.2}Theoretical introduction}{34}{section.4.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.2.1}Eigenvalues}{34}{subsection.4.2.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.2.2}QR method for finding eigenvalues}{34}{subsection.4.2.2}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {4.3}Results}{35}{section.4.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.1}Starting matrix}{35}{subsection.4.3.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.2}QR method with no shifts}{36}{subsection.4.3.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.3}QR method with shifts}{36}{subsection.4.3.3}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {4.4}Discussion of the result}{37}{section.4.4}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.1}Plot}{38}{subsection.4.4.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.2}Shift method superiority}{38}{subsection.4.4.2}\protected@file@percent } -\@writefile{toc}{\contentsline {chapter}{\numberline {5}Code appendix}{40}{chapter.5}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {4.1}Problem}{39}{section.4.1}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {4.2}Theoretical introduction}{39}{section.4.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.2.1}Eigenvalues}{39}{subsection.4.2.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.2.2}QR method for finding eigenvalues}{40}{subsection.4.2.2}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {4.3}Results}{41}{section.4.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.1}Starting matrix}{41}{subsection.4.3.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.2}QR method with no shifts}{42}{subsection.4.3.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.3.3}QR method with shifts}{42}{subsection.4.3.3}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {4.4}Discussion of the result}{43}{section.4.4}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.1}Plot}{43}{subsection.4.4.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {4.4.2}Shift method superiority}{44}{subsection.4.4.2}\protected@file@percent } +\@writefile{toc}{\newpage } +\@writefile{toc}{\contentsline {chapter}{\numberline {5}Code appendix}{45}{chapter.5}\protected@file@percent } \@writefile{lof}{\addvspace {10\p@ }} \@writefile{lot}{\addvspace {10\p@ }} -\@writefile{toc}{\contentsline {section}{\numberline {5.1}Task 2 Code}{40}{section.5.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.1}Main function}{40}{subsection.5.1.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.2}checkIfMatrixIsSquareMatrix}{41}{subsection.5.1.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.3}gaussianEliminationWithPartialPivoting}{42}{subsection.5.1.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.4}partialPivoting}{42}{subsection.5.1.4}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.5}partialPivotingSwapOneRow}{42}{subsection.5.1.5}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.6}swapRowMatrix}{43}{subsection.5.1.6}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.7}swapValueVector}{43}{subsection.5.1.7}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.8}gaussianElimination}{43}{subsection.5.1.8}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.9}substractRows}{44}{subsection.5.1.9}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.10}backSubstitutionPhase}{45}{subsection.5.1.10}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.11}iterativeResidualCorrection}{45}{subsection.5.1.11}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.12}improveSolution}{45}{subsection.5.1.12}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {5.2}Task 3 code}{46}{section.5.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.1}initializeValues}{46}{subsection.5.2.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.2}decomposeMatrix}{47}{subsection.5.2.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.3}jacobiLoop}{47}{subsection.5.2.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.4}jacobiInsideLoop}{48}{subsection.5.2.4}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.5}jacobiEquation}{48}{subsection.5.2.5}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.6}gaussSeidelLoop}{48}{subsection.5.2.6}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.7}gaussiInsideLoop}{49}{subsection.5.2.7}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.8}gaussSeidelEquation}{49}{subsection.5.2.8}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.9}checkError}{49}{subsection.5.2.9}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.10}endOfLoop}{50}{subsection.5.2.10}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.11}dispFinalResults}{50}{subsection.5.2.11}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.12}plotIterations}{51}{subsection.5.2.12}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.13}plotIterations}{52}{subsection.5.2.13}\protected@file@percent } -\@writefile{toc}{\contentsline {section}{\numberline {5.3}Task 4 Code}{53}{section.5.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.1}Gram-Schmid algorithm}{53}{subsection.5.3.1}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{initializeGramSchmid}{53}{section*.22}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{initializeGramSchmid}{53}{section*.23}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{initializeGramSchmid}{54}{section*.24}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.2}QRNoShifts}{54}{subsection.5.3.2}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{QRNoShiftsLoop}{55}{section*.25}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{QRNoShiftsInsideLoop}{55}{section*.26}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{displayResults}{56}{section*.27}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{initializeValues}{56}{section*.28}\protected@file@percent } -\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.3}QRShifts}{56}{subsection.5.3.3}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{initiateValues}{57}{section*.29}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{QRShiftLoop}{57}{section*.30}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{findEigenValue}{58}{section*.31}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{getEigenValueFromCorner}{58}{section*.32}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{shiftAndIterate}{58}{section*.33}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{deflateMatrix}{59}{section*.34}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{thresholdBreached}{59}{section*.35}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{solveCharactersticEquation}{59}{section*.36}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{calculateZeros}{60}{section*.37}\protected@file@percent } -\@writefile{toc}{\contentsline {subsubsection}{dispResults}{60}{section*.38}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {5.1}Task 2 Code}{45}{section.5.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.1}Main function}{45}{subsection.5.1.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.2}checkIfMatrixIsSquareMatrix}{46}{subsection.5.1.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.3}gaussianEliminationWithPartialPivoting}{47}{subsection.5.1.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.4}partialPivoting}{47}{subsection.5.1.4}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.5}partialPivotingSwapOneRow}{48}{subsection.5.1.5}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.6}swapRowMatrix}{48}{subsection.5.1.6}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.7}swapValueVector}{48}{subsection.5.1.7}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.8}gaussianElimination}{49}{subsection.5.1.8}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.9}substractRows}{49}{subsection.5.1.9}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.10}backSubstitutionPhase}{50}{subsection.5.1.10}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.11}iterativeResidualCorrection}{50}{subsection.5.1.11}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.12}improveSolution}{51}{subsection.5.1.12}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.1.13}plotErrorsGaussian}{52}{subsection.5.1.13}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {5.2}Task 3 Code}{53}{section.5.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.1}initializeValues}{54}{subsection.5.2.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.2}decomposeMatrix}{54}{subsection.5.2.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.3}jacobiLoop}{55}{subsection.5.2.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.4}jacobiInsideLoop}{55}{subsection.5.2.4}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.5}jacobiEquation}{55}{subsection.5.2.5}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.6}gaussSeidelLoop}{56}{subsection.5.2.6}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.7}gaussiInsideLoop}{56}{subsection.5.2.7}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.8}gaussSeidelEquation}{57}{subsection.5.2.8}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.9}checkError}{57}{subsection.5.2.9}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.10}endOfLoop}{58}{subsection.5.2.10}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.11}dispFinalResults}{58}{subsection.5.2.11}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.2.12}plotIterations}{59}{subsection.5.2.12}\protected@file@percent } +\@writefile{toc}{\contentsline {section}{\numberline {5.3}Task 4 Code}{60}{section.5.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.1}Gram-Schmid algorithm}{60}{subsection.5.3.1}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{initializeGramSchmid}{60}{section*.22}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{factorizeColumnsOfQ}{60}{section*.23}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{normalizeColumns}{61}{section*.24}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.2}task4}{61}{subsection.5.3.2}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.3}QRNoShifts}{61}{subsection.5.3.3}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{QRNoShiftsLoop}{62}{section*.25}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{QRNoShiftsInsideLoop}{62}{section*.26}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{displayResults}{63}{section*.27}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{initializeValues}{63}{section*.28}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.4}QRShifts}{64}{subsection.5.3.4}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{initiateValues}{64}{section*.29}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{QRShiftLoop}{65}{section*.30}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{findEigenValue}{65}{section*.31}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{getEigenValueFromCorner}{66}{section*.32}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{shiftAndIterate}{66}{section*.33}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{deflateMatrix}{66}{section*.34}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{thresholdBreached}{67}{section*.35}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{solveCharactersticEquation}{67}{section*.36}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{calculateZeros}{68}{section*.37}\protected@file@percent } +\@writefile{toc}{\contentsline {subsubsection}{dispResults}{68}{section*.38}\protected@file@percent } +\@writefile{toc}{\contentsline {subsection}{\numberline {5.3.5}task4Plot}{69}{subsection.5.3.5}\protected@file@percent } \bibcite{texbook}{1} -\gdef \@abspage@last{63} +\gdef \@abspage@last{71} diff --git a/ENUME/projectA/projectA.fdb_latexmk b/ENUME/projectA/projectA.fdb_latexmk index 658c814f..bede58ce 100644 --- a/ENUME/projectA/projectA.fdb_latexmk +++ b/ENUME/projectA/projectA.fdb_latexmk @@ -1,5 +1,5 @@ # Fdb version 3 -["pdflatex"] 1636706601 "projectA.tex" "projectA.pdf" "projectA" 1636706603 +["pdflatex"] 1636710441 "projectA.tex" "projectA.pdf" "projectA" 1636710442 "/etc/texmf/web2c/texmf.cnf" 1635008344 475 c0e671620eb5563b2130f56340a5fde8 "" "/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc" 1165713224 4850 80dc9bab7f31fb78a000ccfed0e27cab "" "/usr/share/texlive/texmf-dist/fonts/map/fontname/texfonts.map" 1577235249 3524 cb3e574dea2d1052e39280babc910dc8 "" @@ -150,14 +150,14 @@ "errorsA.eps" 1636686866 1613352 8726309b9c94c5647644a20db10b9a1f "" "errorsB.eps" 1636686908 1614432 a5ba1015251d54e816c9a68cee4a6856 "" "iterations.eps" 1636684222 67653 3e4ba61ec0de12fb403d5a37cff1a286 "" - "projectA.aux" 1636706602 14241 86ef663ab8073bc8bca811eae34925ff "pdflatex" - "projectA.out" 1636706602 4984 d11f91d75b715adaaddb49e174cbc6c9 "pdflatex" - "projectA.tex" 1636706600 60296 60cf8eeb53ed9870b6e63400c9f8d5b6 "" - "projectA.toc" 1636706602 8705 de5afb21a5f18673d63df94c69f3b031 "pdflatex" + "projectA.aux" 1636710442 14736 0e8136f42850528ca9e82371c2ed4504 "pdflatex" + "projectA.out" 1636710442 5226 601de7a66793ee6dcdaf6fe4f63c18a3 "pdflatex" + "projectA.tex" 1636710440 61167 e53d61c9affc7d47b8b078cd5603a2be "" + "projectA.toc" 1636710442 9018 7e431fac3e1d7284e4e4587ea1aa466a "pdflatex" "task4plot.eps" 1636705312 98748 9802a6c7907f806b5ce644a47c5442a5 "" (generated) - "projectA.aux" - "projectA.toc" - "projectA.out" - "projectA.log" "projectA.pdf" + "projectA.log" + "projectA.aux" + "projectA.out" + "projectA.toc" diff --git a/ENUME/projectA/projectA.fls b/ENUME/projectA/projectA.fls index 95a7906e..f4d2697a 100644 --- a/ENUME/projectA/projectA.fls +++ b/ENUME/projectA/projectA.fls @@ -813,9 +813,9 @@ INPUT /usr/share/texlive/texmf-dist/tex/latex/bera/t1fvm.fd INPUT /usr/share/texlive/texmf-dist/tex/latex/bera/t1fvm.fd INPUT /usr/share/texlive/texmf-dist/tex/latex/bera/t1fvm.fd INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/bera/fvmr8t.tfm -INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1200.tfm INPUT /usr/share/texlive/texmf-dist/fonts/vf/public/bera/fvmr8t.vf INPUT /usr/share/texlive/texmf-dist/fonts/tfm/public/bera/fvmr8r.tfm +INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/tcrm1200.tfm INPUT /usr/share/texlive/texmf-dist/fonts/tfm/jknappen/ec/ecti1200.tfm INPUT ./errorsA.eps INPUT ./errorsA.eps diff --git a/ENUME/projectA/projectA.log b/ENUME/projectA/projectA.log index 90374430..5dc24b30 100644 --- a/ENUME/projectA/projectA.log +++ b/ENUME/projectA/projectA.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=pdflatex 2021.10.23) 12 NOV 2021 09:43 +This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=pdflatex 2021.10.23) 12 NOV 2021 10:47 entering extended mode restricted \write18 enabled. file:line:error style messages enabled. @@ -470,7 +470,7 @@ File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./projectA.tocpdfTeX warning (ext4): destination with the same identifier (name{page.1}) has been already used, duplicate ignored \relax -l.22 \newpage +l.24 \newpage [1 ] [2]) @@ -482,35 +482,36 @@ Chapter 1. [4 ] [5] -LaTeX Font Info: Trying to load font information for T1+fvm on input line 65. +LaTeX Font Info: Trying to load font information for T1+fvm on input line 66. (/usr/share/texlive/texmf-dist/tex/latex/bera/t1fvm.fd File: t1fvm.fd 2004/09/07 scalable font definitions for T1/fvm. ) LaTeX Font Info: Font shape `T1/fvm/m/n' will be -(Font) scaled to size 10.20007pt on input line 65. +(Font) scaled to size 10.20007pt on input line 66. + [6] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 82. +(textcomp) Default family used instead on input line 83. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 84. +(textcomp) Default family used instead on input line 85. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 86. +(textcomp) Default family used instead on input line 87. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 86. +(textcomp) Default family used instead on input line 87. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 88. +(textcomp) Default family used instead on input line 89. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 88. - [6] [7] +(textcomp) Default family used instead on input line 89. + [7] Chapter 2. [8 -] [9] [10] [11] [12] [13] +] [9] [10] [11] [12] [13] [14] [15] Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 04:14:26 (epstopdf) size: 1613352 bytes @@ -518,19 +519,13 @@ Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 04:15:12 (epstopdf) size: 81360 bytes (epstopdf) Command: -(epstopdf) \includegraphics on input line 336. +(epstopdf) \includegraphics on input line 338. Package epstopdf Info: Output file is already uptodate. - + File: errorsA-eps-converted-to.pdf Graphic file (type pdf) -Package pdftex.def Info: errorsA-eps-converted-to.pdf used on input line 336. -(pdftex.def) Requested size: 517.93373pt x 534.49557pt. - -Overfull \hbox (127.93373pt too wide) in paragraph at lines 336--337 - [] - [] - -[14] +Package pdftex.def Info: errorsA-eps-converted-to.pdf used on input line 338. +(pdftex.def) Requested size: 345.28915pt x 356.33038pt. Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 04:15:08 (epstopdf) size: 1614432 bytes @@ -538,46 +533,42 @@ Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 04:15:13 (epstopdf) size: 80379 bytes (epstopdf) Command: -(epstopdf) \includegraphics on input line 340. +(epstopdf) \includegraphics on input line 342. Package epstopdf Info: Output file is already uptodate. - + File: errorsB-eps-converted-to.pdf Graphic file (type pdf) -Package pdftex.def Info: errorsB-eps-converted-to.pdf used on input line 340. -(pdftex.def) Requested size: 517.93373pt x 534.49557pt. - -Overfull \hbox (127.93373pt too wide) in paragraph at lines 340--341 - [] - [] - -[15 <./errorsA-eps-converted-to.pdf>] [16 <./errorsB-eps-converted-to.pdf>] [17] +Package pdftex.def Info: errorsB-eps-converted-to.pdf used on input line 342. +(pdftex.def) Requested size: 345.28915pt x 356.33038pt. + [16 <./errorsA-eps-converted-to.pdf>] [17 <./errorsB-eps-converted-to.pdf>] [18] Chapter 3. -[18 +[19 -] [19] [20] [21] [22] [23] [24] [25] -Overfull \hbox (35.55017pt too wide) in paragraph at lines 732--735 +] [20] [21] [22] [23] [24] [25] [26] [27] [28] +Overfull \hbox (35.55017pt too wide) in paragraph at lines 735--738 \T1/cmr/m/n/12 as low as $\OT1/cmr/m/n/12 1\OML/cmm/m/it/12 :\OT1/cmr/m/n/12 776356839400250\OML/cmm/m/it/12 e \OMS/cmsy/m/n/12 ^^@ \OT1/cmr/m/n/12 15$ \T1/cmr/m/n/12 with de-manded tol-er-ance = $\OT1/cmr/m/n/12 3\OML/cmm/m/it/12 :\OT1/cmr/m/n/12 202372833989376\OML/cmm/m/it/12 e \OMS/cmsy/m/n/12 ^^@ [] -[26] -Underfull \hbox (badness 10000) in paragraph at lines 774--776 +[29] [30] +Underfull \hbox (badness 10000) in paragraph at lines 779--781 [] -Underfull \hbox (badness 10000) in paragraph at lines 790--791 +Underfull \hbox (badness 10000) in paragraph at lines 795--796 [] -[27] +[31] Overfull \hbox (35.55017pt too wide) in paragraph at lines 820--823 \T1/cmr/m/n/12 as low as $\OT1/cmr/m/n/12 1\OML/cmm/m/it/12 :\OT1/cmr/m/n/12 776356839400250\OML/cmm/m/it/12 e \OMS/cmsy/m/n/12 ^^@ \OT1/cmr/m/n/12 15$ \T1/cmr/m/n/12 with de-manded tol-er-ance = $\OT1/cmr/m/n/12 1\OML/cmm/m/it/12 :\OT1/cmr/m/n/12 986027322597818\OML/cmm/m/it/12 e \OMS/cmsy/m/n/12 ^^@ [] -[28] [29] [30] +[32] [33] [34] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 921. +(textcomp) Default family used instead on input line 924. + [35] Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 03:30:22 (epstopdf) size: 67653 bytes @@ -585,25 +576,25 @@ Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 03:31:20 (epstopdf) size: 72847 bytes (epstopdf) Command: -(epstopdf) \includegraphics on input line 934. +(epstopdf) \includegraphics on input line 937. Package epstopdf Info: Output file is already uptodate. - + File: iterations-eps-converted-to.pdf Graphic file (type pdf) -Package pdftex.def Info: iterations-eps-converted-to.pdf used on input line 934. +Package pdftex.def Info: iterations-eps-converted-to.pdf used on input line 937. (pdftex.def) Requested size: 344.78728pt x 534.49557pt. - [31] [32 <./iterations-eps-converted-to.pdf>] [33] + [36] [37 <./iterations-eps-converted-to.pdf>] [38] Chapter 4. -[34 +[39 -] -LaTeX Font Info: Trying to load font information for TS1+fvm on input line 981. +] [40] +LaTeX Font Info: Trying to load font information for TS1+fvm on input line 986. (/usr/share/texlive/texmf-dist/tex/latex/bera/ts1fvm.fd File: ts1fvm.fd 2004/09/07 scalable font definitions for TS1/fvm. ) LaTeX Font Info: Font shape `TS1/fvm/m/n' will be -(Font) scaled to size 10.20007pt on input line 981. - [35] [36] +(Font) scaled to size 10.20007pt on input line 986. + [41] [42] Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 09:21:52 (epstopdf) size: 98748 bytes @@ -611,165 +602,166 @@ Package epstopdf Info: Source file: (epstopdf) date: 2021-11-12 09:22:18 (epstopdf) size: 16119 bytes (epstopdf) Command: -(epstopdf) \includegraphics on input line 1069. +(epstopdf) \includegraphics on input line 1075. Package epstopdf Info: Output file is already uptodate. - + File: task4plot-eps-converted-to.pdf Graphic file (type pdf) -Package pdftex.def Info: task4plot-eps-converted-to.pdf used on input line 1069. +Package pdftex.def Info: task4plot-eps-converted-to.pdf used on input line 1075. (pdftex.def) Requested size: 345.28915pt x 356.33038pt. - [37] [38 <./task4plot-eps-converted-to.pdf>] [39] + [43 <./task4plot-eps-converted-to.pdf>] [44] Chapter 5. -[40 +[45 -] [41] [42] [43] +] [46] [47] [48] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1203. +(textcomp) Default family used instead on input line 1212. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1205. - [44] +(textcomp) Default family used instead on input line 1214. + [49] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1216. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1217. +(textcomp) Default family used instead on input line 1225. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. (textcomp) Default family used instead on input line 1226. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1238. +(textcomp) Default family used instead on input line 1235. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1249. - [45] +(textcomp) Default family used instead on input line 1247. + [50] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1252. +(textcomp) Default family used instead on input line 1259. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1253. - [46] +(textcomp) Default family used instead on input line 1262. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1284. +(textcomp) Default family used instead on input line 1263. + [51] [52] [53] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1285. +(textcomp) Default family used instead on input line 1338. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1299. +(textcomp) Default family used instead on input line 1339. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1310. - [47] -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1332. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1343. - [48] +(textcomp) Default family used instead on input line 1353. + [54] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. (textcomp) Default family used instead on input line 1365. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1366. - [49] +(textcomp) Default family used instead on input line 1387. + [55] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1379. +(textcomp) Default family used instead on input line 1398. + [56] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1381. - [50] +(textcomp) Default family used instead on input line 1421. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1416. +(textcomp) Default family used instead on input line 1422. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1418. +(textcomp) Default family used instead on input line 1435. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1420. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1448. - [51] [52] [53] -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1534. - [54] -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1581. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1596. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1597. - [55] [56] -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1660. +(textcomp) Default family used instead on input line 1437. [57] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1698. +(textcomp) Default family used instead on input line 1473. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1698. +(textcomp) Default family used instead on input line 1475. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1712. +(textcomp) Default family used instead on input line 1477. [58] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1725. -Package textcomp Info: Symbol \textminus not provided by -(textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1737. +(textcomp) Default family used instead on input line 1506. [59] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1758. +(textcomp) Default family used instead on input line 1553. + [60] [61] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1758. +(textcomp) Default family used instead on input line 1601. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1772. +(textcomp) Default family used instead on input line 1616. Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1773. +(textcomp) Default family used instead on input line 1617. + [62] [63] Package textcomp Info: Symbol \textminus not provided by (textcomp) font family fvm in TS1 encoding. -(textcomp) Default family used instead on input line 1777. - [60] [61] [62 +(textcomp) Default family used instead on input line 1682. + [64] [65] +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1722. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1722. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1736. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1749. + [66] +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1762. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1783. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1783. + [67] +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1797. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1798. +Package textcomp Info: Symbol \textminus not provided by +(textcomp) font family fvm in TS1 encoding. +(textcomp) Default family used instead on input line 1802. + [68] [69] [70 ] (./projectA.aux) Package rerunfilecheck Info: File `projectA.out' has not changed. -(rerunfilecheck) Checksum: D11F91D75B715ADAADDB49E174CBC6C9;4984. +(rerunfilecheck) Checksum: 601DE7A66793EE6DCDAF6FE4F63C18A3;5226. ) Here is how much of TeX's memory you used: - 13219 strings out of 479304 - 228365 string characters out of 5869778 - 881796 words of memory out of 5000000 - 29490 multiletter control sequences out of 15000+600000 + 13256 strings out of 479304 + 228926 string characters out of 5869778 + 873846 words of memory out of 5000000 + 29497 multiletter control sequences out of 15000+600000 423928 words of font info for 77 fonts, out of 8000000 for 9000 1141 hyphenation exceptions out of 8191 - 81i,17n,88p,715b,2253s stack positions out of 5000i,500n,10000p,200000b,80000s + 81i,17n,88p,715b,2251s stack positions out of 5000i,500n,10000p,200000b,80000s {/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-t1.enc}{/usr/share/texmf/fonts/enc/dvips/cm-super/cm-super-ts1.enc}{/usr/share/texlive/texmf-dist/fonts/enc/dvips/base/8r.enc} -Output written on projectA.pdf (63 pages, 604733 bytes). +Output written on projectA.pdf (71 pages, 609625 bytes). PDF statistics: - 1465 PDF objects out of 1728 (max. 8388607) - 1350 compressed objects within 14 object streams - 700 named destinations out of 1000 (max. 500000) - 589 words of extra memory for PDF output out of 10000 (max. 10000000) + 1544 PDF objects out of 1728 (max. 8388607) + 1420 compressed objects within 15 object streams + 730 named destinations out of 1000 (max. 500000) + 621 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/ENUME/projectA/projectA.out b/ENUME/projectA/projectA.out index 5ae88752..a3aa82ac 100644 --- a/ENUME/projectA/projectA.out +++ b/ENUME/projectA/projectA.out @@ -13,59 +13,63 @@ \BOOKMARK [2][-]{subsection.2.2.2}{Backward substitution}{section.2.2}% 13 \BOOKMARK [2][-]{subsection.2.2.3}{Partial Pivoting}{section.2.2}% 14 \BOOKMARK [1][-]{section.2.3}{Results}{chapter.2}% 15 -\BOOKMARK [1][-]{section.2.4}{Discussion of results}{chapter.2}% 16 -\BOOKMARK [2][-]{subsection.2.4.1}{Errors in b\)}{section.2.4}% 17 -\BOOKMARK [0][-]{chapter.3}{Problem 3 - Solving a system of n linear equations - iterative algorithm}{}% 18 -\BOOKMARK [1][-]{section.3.1}{Problem}{chapter.3}% 19 -\BOOKMARK [1][-]{section.3.2}{Theoretical introduction}{chapter.3}% 20 -\BOOKMARK [2][-]{subsection.3.2.1}{Procedure}{section.3.2}% 21 -\BOOKMARK [1][-]{section.3.3}{Results}{chapter.3}% 22 -\BOOKMARK [2][-]{subsection.3.3.1}{Jacobi method result}{section.3.3}% 23 -\BOOKMARK [2][-]{subsection.3.3.2}{Gauss-Seidel method result}{section.3.3}% 24 -\BOOKMARK [1][-]{section.3.4}{Discussion of results}{chapter.3}% 25 -\BOOKMARK [2][-]{subsection.3.4.1}{Comparison based on table}{section.3.4}% 26 -\BOOKMARK [2][-]{subsection.3.4.2}{Convergence}{section.3.4}% 27 -\BOOKMARK [0][-]{chapter.4}{Problem 4 - QR method of finding eigenvalues}{}% 28 -\BOOKMARK [1][-]{section.4.1}{Problem}{chapter.4}% 29 -\BOOKMARK [1][-]{section.4.2}{Theoretical introduction}{chapter.4}% 30 -\BOOKMARK [2][-]{subsection.4.2.1}{Eigenvalues}{section.4.2}% 31 -\BOOKMARK [2][-]{subsection.4.2.2}{QR method for finding eigenvalues}{section.4.2}% 32 -\BOOKMARK [1][-]{section.4.3}{Results}{chapter.4}% 33 -\BOOKMARK [2][-]{subsection.4.3.1}{Starting matrix}{section.4.3}% 34 -\BOOKMARK [2][-]{subsection.4.3.2}{QR method with no shifts}{section.4.3}% 35 -\BOOKMARK [2][-]{subsection.4.3.3}{QR method with shifts}{section.4.3}% 36 -\BOOKMARK [1][-]{section.4.4}{Discussion of the result}{chapter.4}% 37 -\BOOKMARK [2][-]{subsection.4.4.1}{Plot}{section.4.4}% 38 -\BOOKMARK [2][-]{subsection.4.4.2}{Shift method superiority}{section.4.4}% 39 -\BOOKMARK [0][-]{chapter.5}{Code appendix}{}% 40 -\BOOKMARK [1][-]{section.5.1}{Task 2 Code}{chapter.5}% 41 -\BOOKMARK [2][-]{subsection.5.1.1}{Main function}{section.5.1}% 42 -\BOOKMARK [2][-]{subsection.5.1.2}{checkIfMatrixIsSquareMatrix}{section.5.1}% 43 -\BOOKMARK [2][-]{subsection.5.1.3}{gaussianEliminationWithPartialPivoting}{section.5.1}% 44 -\BOOKMARK [2][-]{subsection.5.1.4}{partialPivoting}{section.5.1}% 45 -\BOOKMARK [2][-]{subsection.5.1.5}{partialPivotingSwapOneRow}{section.5.1}% 46 -\BOOKMARK [2][-]{subsection.5.1.6}{swapRowMatrix}{section.5.1}% 47 -\BOOKMARK [2][-]{subsection.5.1.7}{swapValueVector}{section.5.1}% 48 -\BOOKMARK [2][-]{subsection.5.1.8}{gaussianElimination}{section.5.1}% 49 -\BOOKMARK [2][-]{subsection.5.1.9}{substractRows}{section.5.1}% 50 -\BOOKMARK [2][-]{subsection.5.1.10}{backSubstitutionPhase}{section.5.1}% 51 -\BOOKMARK [2][-]{subsection.5.1.11}{iterativeResidualCorrection}{section.5.1}% 52 -\BOOKMARK [2][-]{subsection.5.1.12}{improveSolution}{section.5.1}% 53 -\BOOKMARK [1][-]{section.5.2}{Task 3 code}{chapter.5}% 54 -\BOOKMARK [2][-]{subsection.5.2.1}{initializeValues}{section.5.2}% 55 -\BOOKMARK [2][-]{subsection.5.2.2}{decomposeMatrix}{section.5.2}% 56 -\BOOKMARK [2][-]{subsection.5.2.3}{jacobiLoop}{section.5.2}% 57 -\BOOKMARK [2][-]{subsection.5.2.4}{jacobiInsideLoop}{section.5.2}% 58 -\BOOKMARK [2][-]{subsection.5.2.5}{jacobiEquation}{section.5.2}% 59 -\BOOKMARK [2][-]{subsection.5.2.6}{gaussSeidelLoop}{section.5.2}% 60 -\BOOKMARK [2][-]{subsection.5.2.7}{gaussiInsideLoop}{section.5.2}% 61 -\BOOKMARK [2][-]{subsection.5.2.8}{gaussSeidelEquation}{section.5.2}% 62 -\BOOKMARK [2][-]{subsection.5.2.9}{checkError}{section.5.2}% 63 -\BOOKMARK [2][-]{subsection.5.2.10}{endOfLoop}{section.5.2}% 64 -\BOOKMARK [2][-]{subsection.5.2.11}{dispFinalResults}{section.5.2}% 65 -\BOOKMARK [2][-]{subsection.5.2.12}{plotIterations}{section.5.2}% 66 -\BOOKMARK [2][-]{subsection.5.2.13}{plotIterations}{section.5.2}% 67 -\BOOKMARK [1][-]{section.5.3}{Task 4 Code}{chapter.5}% 68 -\BOOKMARK [2][-]{subsection.5.3.1}{Gram-Schmid algorithm}{section.5.3}% 69 -\BOOKMARK [2][-]{subsection.5.3.2}{QRNoShifts}{section.5.3}% 70 -\BOOKMARK [2][-]{subsection.5.3.3}{QRShifts}{section.5.3}% 71 +\BOOKMARK [2][-]{subsection.2.3.1}{2a\)}{section.2.3}% 16 +\BOOKMARK [2][-]{subsection.2.3.2}{2b\)}{section.2.3}% 17 +\BOOKMARK [1][-]{section.2.4}{Discussion of results}{chapter.2}% 18 +\BOOKMARK [2][-]{subsection.2.4.1}{Errors in b\)}{section.2.4}% 19 +\BOOKMARK [0][-]{chapter.3}{Problem 3 - Solving a system of n linear equations - iterative algorithm}{}% 20 +\BOOKMARK [1][-]{section.3.1}{Problem}{chapter.3}% 21 +\BOOKMARK [1][-]{section.3.2}{Theoretical introduction}{chapter.3}% 22 +\BOOKMARK [2][-]{subsection.3.2.1}{Procedure}{section.3.2}% 23 +\BOOKMARK [1][-]{section.3.3}{Results}{chapter.3}% 24 +\BOOKMARK [2][-]{subsection.3.3.1}{Jacobi method result}{section.3.3}% 25 +\BOOKMARK [2][-]{subsection.3.3.2}{Gauss-Seidel method result}{section.3.3}% 26 +\BOOKMARK [1][-]{section.3.4}{Discussion of results}{chapter.3}% 27 +\BOOKMARK [2][-]{subsection.3.4.1}{Comparison based on table}{section.3.4}% 28 +\BOOKMARK [2][-]{subsection.3.4.2}{Convergence}{section.3.4}% 29 +\BOOKMARK [0][-]{chapter.4}{Problem 4 - QR method of finding eigenvalues}{}% 30 +\BOOKMARK [1][-]{section.4.1}{Problem}{chapter.4}% 31 +\BOOKMARK [1][-]{section.4.2}{Theoretical introduction}{chapter.4}% 32 +\BOOKMARK [2][-]{subsection.4.2.1}{Eigenvalues}{section.4.2}% 33 +\BOOKMARK [2][-]{subsection.4.2.2}{QR method for finding eigenvalues}{section.4.2}% 34 +\BOOKMARK [1][-]{section.4.3}{Results}{chapter.4}% 35 +\BOOKMARK [2][-]{subsection.4.3.1}{Starting matrix}{section.4.3}% 36 +\BOOKMARK [2][-]{subsection.4.3.2}{QR method with no shifts}{section.4.3}% 37 +\BOOKMARK [2][-]{subsection.4.3.3}{QR method with shifts}{section.4.3}% 38 +\BOOKMARK [1][-]{section.4.4}{Discussion of the result}{chapter.4}% 39 +\BOOKMARK [2][-]{subsection.4.4.1}{Plot}{section.4.4}% 40 +\BOOKMARK [2][-]{subsection.4.4.2}{Shift method superiority}{section.4.4}% 41 +\BOOKMARK [0][-]{chapter.5}{Code appendix}{}% 42 +\BOOKMARK [1][-]{section.5.1}{Task 2 Code}{chapter.5}% 43 +\BOOKMARK [2][-]{subsection.5.1.1}{Main function}{section.5.1}% 44 +\BOOKMARK [2][-]{subsection.5.1.2}{checkIfMatrixIsSquareMatrix}{section.5.1}% 45 +\BOOKMARK [2][-]{subsection.5.1.3}{gaussianEliminationWithPartialPivoting}{section.5.1}% 46 +\BOOKMARK [2][-]{subsection.5.1.4}{partialPivoting}{section.5.1}% 47 +\BOOKMARK [2][-]{subsection.5.1.5}{partialPivotingSwapOneRow}{section.5.1}% 48 +\BOOKMARK [2][-]{subsection.5.1.6}{swapRowMatrix}{section.5.1}% 49 +\BOOKMARK [2][-]{subsection.5.1.7}{swapValueVector}{section.5.1}% 50 +\BOOKMARK [2][-]{subsection.5.1.8}{gaussianElimination}{section.5.1}% 51 +\BOOKMARK [2][-]{subsection.5.1.9}{substractRows}{section.5.1}% 52 +\BOOKMARK [2][-]{subsection.5.1.10}{backSubstitutionPhase}{section.5.1}% 53 +\BOOKMARK [2][-]{subsection.5.1.11}{iterativeResidualCorrection}{section.5.1}% 54 +\BOOKMARK [2][-]{subsection.5.1.12}{improveSolution}{section.5.1}% 55 +\BOOKMARK [2][-]{subsection.5.1.13}{plotErrorsGaussian}{section.5.1}% 56 +\BOOKMARK [1][-]{section.5.2}{Task 3 Code}{chapter.5}% 57 +\BOOKMARK [2][-]{subsection.5.2.1}{initializeValues}{section.5.2}% 58 +\BOOKMARK [2][-]{subsection.5.2.2}{decomposeMatrix}{section.5.2}% 59 +\BOOKMARK [2][-]{subsection.5.2.3}{jacobiLoop}{section.5.2}% 60 +\BOOKMARK [2][-]{subsection.5.2.4}{jacobiInsideLoop}{section.5.2}% 61 +\BOOKMARK [2][-]{subsection.5.2.5}{jacobiEquation}{section.5.2}% 62 +\BOOKMARK [2][-]{subsection.5.2.6}{gaussSeidelLoop}{section.5.2}% 63 +\BOOKMARK [2][-]{subsection.5.2.7}{gaussiInsideLoop}{section.5.2}% 64 +\BOOKMARK [2][-]{subsection.5.2.8}{gaussSeidelEquation}{section.5.2}% 65 +\BOOKMARK [2][-]{subsection.5.2.9}{checkError}{section.5.2}% 66 +\BOOKMARK [2][-]{subsection.5.2.10}{endOfLoop}{section.5.2}% 67 +\BOOKMARK [2][-]{subsection.5.2.11}{dispFinalResults}{section.5.2}% 68 +\BOOKMARK [2][-]{subsection.5.2.12}{plotIterations}{section.5.2}% 69 +\BOOKMARK [1][-]{section.5.3}{Task 4 Code}{chapter.5}% 70 +\BOOKMARK [2][-]{subsection.5.3.1}{Gram-Schmid algorithm}{section.5.3}% 71 +\BOOKMARK [2][-]{subsection.5.3.2}{task4}{section.5.3}% 72 +\BOOKMARK [2][-]{subsection.5.3.3}{QRNoShifts}{section.5.3}% 73 +\BOOKMARK [2][-]{subsection.5.3.4}{QRShifts}{section.5.3}% 74 +\BOOKMARK [2][-]{subsection.5.3.5}{task4Plot}{section.5.3}% 75 diff --git a/ENUME/projectA/projectA.pdf b/ENUME/projectA/projectA.pdf index 69485d6e..83d15c94 100644 Binary files a/ENUME/projectA/projectA.pdf and b/ENUME/projectA/projectA.pdf differ diff --git a/ENUME/projectA/projectA.synctex.gz b/ENUME/projectA/projectA.synctex.gz index def5ec69..57ca04a7 100644 Binary files a/ENUME/projectA/projectA.synctex.gz and b/ENUME/projectA/projectA.synctex.gz differ diff --git a/ENUME/projectA/projectA.tex b/ENUME/projectA/projectA.tex index 7a351dcb..a2da8960 100755 --- a/ENUME/projectA/projectA.tex +++ b/ENUME/projectA/projectA.tex @@ -51,12 +51,13 @@ Write a program finding macheps in the MATLAB environment \subsection{Definition of machine epsilion} Machine epsilion is the maximal possible relative error of the floating-point representation. (Tatjewski, p.14) Machine epsilion is equal to $2^{-t}$ where t is number of bits in the mantissa. -In our case when We use IEEE Standard 754, mantissa is 53 bits long with first bit omitted as it is always equal to '1', so We technicaly work with 52 bits mantissa which makes the machine epsilion equal to: $2^{-52} = 2.220446\mathrm{e}{-16}$ +In our case where we use IEEE Standard 754, mantissa is 53 bits long with first bit omitted as it is always equal to '1', so we technicaly work with 52 bits mantissa which makes the machine epsilion equal to: $2^{-52} = 2.220446\mathrm{e}{-16}$ +\newpage \subsection{Practical applications of machine epsilion} Since macheps is connected to IEEE754 standard it is always equal to the same number, which means that we can safely compare results from different machines without worrying about their individual errors. Before standards, everyone could use any way of representing floats. -Macheps is also essential when We calculate cumulation of errors of given mathematical operation. +Macheps is also essential when we calculate cumulation of errors of given mathematical operation. \newpage \section{Solution} @@ -68,8 +69,8 @@ while 1.0 + macheps / 2 > 1.0 macheps = macheps/2; end \end{lstlisting} -Code above shifts macheps one bit to the right each iteration (by dividing by 2), it ends when We run out of mantissa bits which renders us unable to save smaller number. Due to underflow the value of macheps becomes 0 and therefore 1.0 > (macheps / 2) > 1.0 will become false. - +Code above shifts macheps one bit to the right each iteration (by dividing by 2), it ends when we run out of mantissa bits which renders us unable to save smaller number. Due to underflow the value of macheps becomes 0 and therefore 1.0 > (macheps / 2) > 1.0 will become false. +\newpage \section{Discussion of the result} \begin{simplechar} \begin{lstlisting} @@ -144,9 +145,9 @@ We will denote rows as '$w_i$' where 'i' is number of the row. We start transforming the system by "zeroing" elements in first column excluding first row element. We do it by multiplying first row by $l_{i1}$, where: \[ l_{i1} = \frac{ a_{i1}^{(1)} } { a_{11}^{(1)} } \] -And then substracting what We got ($ l_{i1}w_1 $), from \textit{i} row. +And then substracting what we got ($ l_{i1}w_1 $), from \textit{i} row. -Doing so We obtain a system of linear equations: +Doing so we obtain a system of linear equations: \[ \begin{matrix} @@ -163,16 +164,16 @@ Doing so We obtain a system of linear equations: \] \subsubsection{Zeroing second column} -We continue onto the second column, this time We will zero all elements except first and second rows. +We continue onto the second column, this time we will zero all elements except first and second rows. Row multiplier becomes: \[ l_{i2} = \frac{ a_{i2}^{(2)} }{ a_{22}^{(2)} } \] - Where: \[ a_{22}^{(2)} = (a_{22} - a_{12}l_{21}) \] And: \[ a_{i2}^{(2)} = (a_{i2} - a_{12}l_{i1}) \] +\newpage They are modified values obtained from previous step. -We continue as in the first step and We end up with: +We continue as in the first step and we end up with: \[ \begin{matrix} @@ -189,7 +190,7 @@ We continue as in the first step and We end up with: \] \subsubsection{Zeroing next columns} -We repeat this process $n-1$ times and We end up with upper triangular matrix: +We repeat this process $n-1$ times and we end up with upper triangular matrix: \[ \begin{matrix} @@ -206,31 +207,34 @@ We repeat this process $n-1$ times and We end up with upper triangular matrix: \] \subsection{Backward substitution} -After transforming the system We solve the system from last to first. \\ -First We calculate value of last element: +After transforming the system we solve the system from last to first. \\ +First we calculate value of last element: \[ x_n = \frac{b_n}{a_{nn}} \] Then one "above": \[ x_{n-1} = \frac{ b_{n-1} - a_{n-1, n}x_n}{a_{n-1, n-1}} \] And so on, for $x_k$: \[ x_{k} = \frac{b_k - \sum_{j = k + 1}^n a_{kj}x_j}{a_{kk}} \] +\newpage \subsection{Partial Pivoting} Gaussian elimination method has one flaw, where it can come into halt if: \[ a_{kk}^{(k)} = 0 \] -To avoid it We use method of pivoting, in our case We will use partial pivoting method. +To avoid it we use method of pivoting, in our case we will use partial pivoting method. We do it before each Gaussian elimination step since this will lead to smaller error. \\We first find a row $i$ such that: \[ |{a_{ik}^{k}}| = \underset{j}{max} \{ |{a_{kk}^{k}}|, |{a_{k+1, k}^{k}}|, \cdots, |{a_{nk}^{k}}|\} \] -Then We swap this row with k-th row. Since the matrix We use is assumed to be nonsingular then $|{a_{ik}^{k}}| \neq 0$ will be always true. After that We continue with the Gaussian elimination method. +Then we swap this row with k-th row. Since the matrix we use is assumed to be nonsingular then $|{a_{ik}^{k}}| \neq 0$ will be always true. After that we continue with the Gaussian elimination method. Let's compare full pivoting to partial pivoting. Full pivoting carries more computational load. It comes from the fact that: In full pivoting we need to compare absolute values of the matrix elements. (Which gives us $ k^2-1$ comparisons every step as opposed to $k-1$ for partial pivoting). We also have column interchanges and corresponsing interchanges in the order of elements of \textbf{x}. Therefore when it comes to speed, partial pivoting is faster than full pivoting. +\newpage \section{Results} -Solutions vectors for matrix A and vector A and n = 10 +\subsection{2a)} +Solutions vectors for matrix A and vector A and n = 10 \\ Without residual correction: \[ x_{algorithm} = \left(\begin{array}{cc} -0.930024655110760 \\ @@ -245,7 +249,6 @@ Without residual correction: -0.450125157623323 \end{array} \right) \] - With residual correction: \[ x_{algorithm} = \left(\begin{array}{cc} -0.930024655110760 \\ @@ -275,11 +278,11 @@ x_{Matlab Method} = \left( = \begin{array}{cc} -0.450125157623323 \end{array} \right) \] - Error for 'A' system of equations for algorithm before residual correction: \[ 1.986027322597818e-15 \] Error for 'A' system of equations for algorithm after residual correction: \[ 1.986027322597818e-15 \] Error for 'A' system of equations for matlab method: \[ 3.383918772654241 \] \newpage +\subsection{2b)} Solutions vectors for matrix B and vector B and n = 10 Without residual correction: \[ x_{algorithm} = 10^{14} * \left(\begin{array}{cc} @@ -295,7 +298,6 @@ Without residual correction: 0.131884594651908 \\ \end{array} \right) \] - With residual correction: \[ x_{algorithm} = 10^{14} * \left(\begin{array}{cc} -0.000050600463347 \\ @@ -325,19 +327,19 @@ x_{Matlab Method} = 10^{14} * \left( = \begin{array}{cc} 0.131915987214953 \\ \end{array} \right) \] - Error for 'B' system of equations for algorithm before residual correction: \[ 3.775702543583306e-04 \] Error for 'B' system of equations for algorithm after residual correction: \[ 7.395459186003887e-04 \] Error for 'B' system of equations for matlab method: \[ 2.611906929269057e-04 \] +\newpage \section{Discussion of results} As we can see error for 'B' system of equations increased after our residual correction. But that's just one matrix and vector pair, after testing more pairs we get following graphs (Tested on systems of equations from a) and b) respectively, with maximum size of matrices and vectors equal to 100): \begin{center} - \includegraphics[scale=0.75]{errorsA.eps} + \includegraphics[scale=0.5]{errorsA.eps} \end{center} \begin{center} - \includegraphics[scale=0.75]{errorsB.eps} + \includegraphics[scale=0.5]{errorsB.eps} \end{center} As we can see our residual correction method \textbf{does} work for Matrix B and Vector B and decreases the error drastically. @@ -389,22 +391,20 @@ We are given following system: \systeme{10x_1-4x_2+x_3+2x_4=-8, 2x_1-6x_2+3x_3-x_4=-12, x_1+4x_2-12x_3+x_4=4, 2x_1+3x_2-3x_3-10x_4=1} \] -Then We need to compare the results of iterations plotting norm of the solution error versus the iteration number \textbf{k}, untill We get accuracy better than $10^{-10}$. +Then we need to compare the results of iterations plotting norm of the solution error versus the iteration number \textbf{k}, untill we get accuracy better than $10^{-10}$. We should also try to solve the equations from problem 2a) and 2b) for n = 10 using iterative method of our choice. \section{Theoretical introduction} - We should also answer the question what happens if the sufficient condition is not fullfiled. - -Itertaive methods differ from the Gauss elimination method since they are iterative, which means that our solution will improve with each iteration. Building on that We can cnclude that the number of iterations will depend on what accuracy We want to achieve. Since We are using iterative method We don't have the guarantee of how many iterations will be neeeded before We reach the solution, +Itertaive methods differ from the Gauss elimination method since they will improve with each iteration and we don't have the guarantee of how many iterations will be neeeded before we reach the solution. Increasing iterations, decreases error of solution. In general: We start with: \textbf{$x^{(0)}$ } - being the best known approximation of the solution point -And We generate next vectors \textbf{$x^{i+1}$} in such way: +And we generate next vectors \textbf{$x^{i+1}$} in such way: \[ \mathbf{x^{i+1}} = \mathbf{M}\mathbf{x^{(i)}} + \mathbf{w} \] Where $\mathbf{M}$ is some matrix. @@ -412,7 +412,7 @@ Where $\mathbf{M}$ is some matrix. \subsection{Procedure} \subsubsection{Decomposing matrix} -For both Jacobi and Gauss-Seidel method We first decompose starting matrix $ \mathbf{A} $ to: +For both Jacobi and Gauss-Seidel method we first decompose starting matrix $ \mathbf{A} $ to: \[ \mathbf{A} = \mathbf{L} + \mathbf{D} + \mathbf{U} \] where: $ \mathbf{L} $ - Subdiagonal matrix @@ -479,13 +479,13 @@ so: \] \subsubsection{Jacobi's method} -After decomposing matrix We can write the system of equations +After decomposing matrix we can write the system of equations \[ \mathbf{A}\mathbf{x} = \mathbf{b} \] in the form: \[ \mathbf{D}\mathbf{x} = -(\mathbf{L}+\mathbf{U})\mathbf{x}+\mathbf{b} \] -If We assume that diagonal entries of matrix \textbf{A} are nonzero, then matrix \textbf{D} is nonsingular therefore We can propose such an iterative method: +If we assume that diagonal entries of matrix \textbf{A} are nonzero, then matrix \textbf{D} is nonsingular therefore we can propose such an iterative method: \[ \mathbf{x}^{i+1} = -\mathbf{D}^{-1}(\mathbf{L}+\mathbf{U})\mathbf{x}^{(i)}+\mathbf{D}^{-1}\mathbf{x} \] This is the Jacobi's method. @@ -497,23 +497,24 @@ We can rewritte this equation in the form of \textit{n} independent scalar equat ) \] Where $d_{jj}$; $l_{jk}$; $u_{jk}$ are the elements of the respective matrixes \textbf{D}, \textbf{L}, \textbf{U} -Thanks to this We can do those computations in paraller, totally or partially if We are using a computer that enables a parallelization of the computations. +Thanks to this we can do those computations in paraller, totally or partially if we are using a computer that enables a parallelization of the computations. \paragraph{Converging} -Jacobi's method is convergent if We have strong diagonal dominance of the matrix \textbf{A} +Jacobi's method is convergent if we have strong diagonal dominance of the matrix \textbf{A}. (More on that in discussion of results) \subsubsection{Gauss-Seidel method} -After decomposing matrix We can write the system of equations +After decomposing matrix we can write the system of equations \[ \mathbf{A}\mathbf{x} = \mathbf{b} \] in the form: \[ (\mathbf{L}+\mathbf{D})\mathbf{x} = -\mathbf{U}\mathbf{x}+\mathbf{b} \] -Again We assume that \textbf{D} is nonsingular, in doing so We propose following iterative method: +Again, we assume that \textbf{D} is nonsingular, in doing so we propose following iterative method: \[ \mathbf{D}\mathbf{x}^{(i+1)} = -\mathbf{L}\mathbf{x}^{(i+1)}-\mathbf{U}\mathbf{x}^{(i)}+\mathbf{b} \] -Since matrix \textbf{L} is subdiagonal, provided that We organse the calculation of elements of the vector $x^{(i_1)}$ in a proper way, it does not hurt that $x^{(i_1)}$ is on the right side of the equation. -In order to organise the calculation in the correct way We: +Since matrix \textbf{L} is subdiagonal, provided that we organise the calculation of elements of the vector $x^{(i_1)}$ in a proper way, it does not hurt that $x^{(i_1)}$ is on the right side of the equation. +\newpage +In order to organise the calculation in the correct way we: First take into account the structure of matrixes \textbf{D} and \textbf{L}: \[ \begin{bmatrix} @@ -544,8 +545,6 @@ x_n^{(i_1)} \] Where \[ \mathbf{w}^{(i)} = \mathbf{U}\mathbf{x}^{(i)} - \mathbf{b} \] - -\newpage So the order of calculations is as follows: \[ x_1^{(i+1)} = -\frac{w_1^{(i)}}{d_{11}} \] \[ x_2^{(i+1)} = -\frac{-l_{21}x_1^{(i+1)} - w_2^{(i)}}{d_{22}} \] @@ -557,21 +556,23 @@ As opposed to Jacobi's method, Gauss-Seidel method computations must be performe \paragraph{Converging} Gauss-Seidel method is convergent if the matrix \textbf{A} is strongly row or column diagonnaly dominant. If the matrix is symmetric, the method is also convergent if the matrix \textbf{A} is positive definite. This method is also usually faster convergent compared to Jacobi's method. +\newpage \subsubsection{Stop tests} -There are two ways to check when to terminate iterations of the methods We just discussed: +There are two ways to check when to terminate iterations of the methods we just discussed: \begin{enumerate} \item Check differences between two subsequent iteration points \[ \| \mathbf{x}^{(i+1)} - \mathbf{x}^{(i)} \| \leq \delta \] -Where $\delta$ is an assumed tolerance, (in our case $10^{-10}$). What We are really interested in though is whether the solution of the system of equation has required accuracy. If We want to check that We can additionaly check (higher level, more computationally demanding test): +Where $\delta$ is an assumed tolerance, (in our case $10^{-10}$). What we are really interested in though is whether the solution of the system of equation has required accuracy. If we want to check that we can additionaly check (higher level, more computationally demanding test): \item Check differences between two subsequent iteration points \[ \| \mathbf{A}\mathbf{x}^{(i+1)} - \mathbf{b}\| \leq \delta_2 \] -Where $\delta_2$ is an assumed tolerance. If this test is not passed then We can diminish the value of $\delta_2$ and continue with the iterations. Value of $\delta_2$ can not be too small since We are limited by the numerical errors. +Where $\delta_2$ is an assumed tolerance. If this test is not passed then we can diminish the value of $\delta_2$ and continue with the iterations. Value of $\delta_2$ can not be too small since we are limited by the numerical errors. \end{enumerate} +\newpage \subsubsection{\textbf{A} and \textbf{b}} We have been given the following system: \[ @@ -623,10 +624,10 @@ So: \end{bmatrix} \] +\newpage \section{Results} - \subsection{Jacobi method result} -For system of equations We got in this task We got following results: +For system of equations we got in this task we got following results: \\ Without the change in demanded tolerance: \[ x = \left( \begin{array}{cc} @@ -638,7 +639,7 @@ Without the change in demanded tolerance: \] Error: \[ r = \| \mathbf{A}\mathbf{x} - \mathbf{b}\| = 1.154375287358407e-10 \] -We managed to do this in \textbf{38} iterations of our loop, and the demanded tolerance did not change. (This required small change in code where We ommited the part of code responsible for changing demandedTolerance if $ \| \mathbf{A}x-b \| > \delta_2) $ ) +We managed to do this in \textbf{38} iterations of our loop, and the demanded tolerance did not change. (This required small change in code where I ommited the part of code responsible for changing demandedTolerance if $ \| \mathbf{A}x-b \| > \delta_2) $ ) With the change in demanded tolerance: \[ x = \left( \begin{array}{cc} @@ -663,7 +664,8 @@ Compared to matlab function Matlab error: \[ r = \| \mathbf{A}\mathbf{x} - \mathbf{b}\| = 4.070144838902081e-15 \] -For data from task 2a We got: \\ +\newpage +For data from task 2a we got: \\ Without change in demanded tolerance: \[ x_a = \left( \begin{array}{cc} -0.930024655108186 \\ @@ -719,15 +721,16 @@ Matlab error: For Matrix and Vector from task 2b) error of \[ \| x^{(i+1)} - x^{(i)} \| \] -grew to infinity, therefore We could never achieve demanded tolerance, therefore the program executed infinite loop. +grew to infinity, therefore we could never achieve demanded tolerance, therefore the program executed infinite loop. \subsubsection{Minimizing the demanded error} -We tried to minimize the demanded error using this steps: +I tried to minimize the demanded error using this steps: \begin{enumerate} -\item We copied error from matlab function and pasted it into demanded tolerance. -\item If We did not get infinite loop We copied the newly acquired error and pasted it into demanded tolerance. -\item If We got inifinite loop We used the previous error as "minimal" demanded error. +\item I copied error from matlab function and pasted it into demanded tolerance. +\item If I did not get infinite loop I copied the newly acquired error and pasted it into demanded tolerance. +\item If I got inifinite loop I used the previous error as "minimal" demanded error. \end{enumerate} +\newpage \paragraph{For original system of equations:} We managed to get results with error as low as $1.776356839400250e-15$ with demanded tolerance = $3.202372833989376e-15$ for lower values program went into infinite loop. Results for demanded tolerance = $3.202372833989376e-15$ @@ -743,6 +746,7 @@ Error: \[ r = \| \mathbf{A}\mathbf{x} - \mathbf{b}\| = 3.108624468950438e-15 \] We got this result in \textbf{53} iterations and demanded tolerance did not change. +\newpage \paragraph{For task 2a) system of equations:} We managed to get results with error as low as \[ 3.108624468950438e-15 \] with demanded tolerance: @@ -770,8 +774,9 @@ Error: We managed to do this in \textbf{84} iterations of our loop, and the demanded tolerance did not change. We managed to achieve slightly better (as in, the error was smaller) results than Matlab custom function. +\newpage \subsection{Gauss-Seidel method result} -For system of equations We got in this task We got following results: +For system of equations we got in this task we got following results: \\ \[ x = \left( \begin{array}{cc} -0.076776098752996 \\ @@ -787,7 +792,7 @@ Error: \[ r = \| \mathbf{A}\mathbf{x} - \mathbf{b}\| = 6.999102842719934e-10 \] We got this result in \textbf{19} iterations and demanded tolerance was equal to $2*10^{-10}$ -For data from task 2a We got: \\ +For data from task 2a we got: \\ \[ x_a = \left( \begin{array}{cc} -0.930024655049330 \\ -1.223407298590161 \\ @@ -807,15 +812,10 @@ We managed to do this in \textbf{28} iterations of our loop, and the demanded to For Matrix and Vector from task 2b) error of \[ \| x^{(i+1)} - x^{(i)} \| \] -grew to infinity, therefore We could never achieve demanded tolerance, therefore the program executed infinite loop. +grew to infinity, therefore we could never achieve demanded tolerance, therefore the program executed infinite loop. \subsubsection{Minimizing the demanded error} -I tried to minimize the demanded error using this steps: -\begin{enumerate} -\item I copied error from matlab function and pasted it into demanded tolerance. -\item If I did not get infinite loop I copied the newly acquired error and pasted it into demanded tolerance. -\item If I got inifinite loop I used the previous error as "minimal" demanded error. -\end{enumerate} +I tried to minimize the demanded error using procedure from before \paragraph{For original system of equations:} We managed to get results with error as low as $1.776356839400250e-15$ with demanded tolerance = $ 1.986027322597818e-15 $ for lower values program went into infinite loop. Results for demanded tolerance = $1.986027322597818e-15$ @@ -831,6 +831,7 @@ Error: \[ r = \| \mathbf{A}\mathbf{x} - \mathbf{b}\| = 1.776356839400250e-15 \] We got this result in \textbf{30} iterations and demanded tolerance did not change. +\newpage \paragraph{For task 2a) system of equations:} We managed to get results with error as low as \[ 1.538370149106851e-15 \] with demanded tolerance: @@ -858,6 +859,9 @@ Error: We managed to do this in \textbf{42} iterations of our loop, and the demanded tolerance did not change. We managed to achieve slightly better (as in, the error was smaller) results than Matlab custom function. + +\newpage +\section{Discussion of results} \paragraph{Table} \begin{center} @@ -893,11 +897,10 @@ We managed to achieve slightly better (as in, the error was smaller) results tha \end{tabular}} \end{center} - -\section{Discussion of results} \subsection{Comparison based on table} Gaussian-Seidel method takes less iterations, can achieve smaller error and works under smaller demanded tolerance, that being said Jacobi method has one crucial advantage - it can be run in parallel. That means that even when Jacobi method takes twice or thrice amount of iteration us Gaussian-Seidel one if we just run it in paraller we can diminish this difference. In the examples we worked in, just two jacobi method running in paraller provide us with similar amount of iterations per one process as in Gaussian-Seidel one, and three or more processes give the edge to Jacobi method. With modern CPU's with at least 5 cores and correct implementation of algorithm, jacobi method reigns supreme. +\newpage \subsection{Convergence} The biggest problem is of course the fact that those iterative methods do not work on every system of equation. Like the one from task 2b). For Jacobi's method the matrix is convergent if it has strong diagonal dominance. \textbf{A}, i.e: @@ -933,7 +936,7 @@ I have used matrix from task 2a), demanded tolerance equal to 10e-10, and max si \begin{center} \includegraphics[scale=0.75]{iterations.eps} \end{center} -Gauss Seidel method again requires fewer iterations, around half the amount for jacobi method. For both methods number of iterations acts like logarithmic function. Therefore we can assume that for big matrices required number of iterations will not change so drastically. +Gauss Seidel method again requires fewer iterations, around half the amount for Jacobi method. For both methods function of number of iterations acts like logarithmic function. Therefore we can assume that for big matrices required number of iterations will \textbf{not} change rapidly. \chapter{Problem 4 - QR method of finding eigenvalues} @@ -948,6 +951,7 @@ This can be rewritten as: And further we get characteristic equation: \[ det(\mathbf{A} - \lambda\mathbf{I}) = 0 \] +\newpage \subsection{QR method for finding eigenvalues} First we start by transforming matrix \textbf{A} into tridiagonal form. It increases the effectiveness of calculations. @@ -972,6 +976,7 @@ Since this method can be slowly convergent we use shifts. Single iteration of QR Wher $p_k$ should be chosen as a best estimate of $\lambda_{i+1}$ +\newpage \section{Results} \subsection{Starting matrix} I decided to generate random symmetric matrix using following code: @@ -1009,7 +1014,7 @@ Putting it through Matlab eig function I got eigen values equal to: \end{bmatrix} \] - +\newpage \subsection{QR method with no shifts} Putting this matrix to my functions QRNoShifts and QRShifts I got: for qr method with no shifts: @@ -1061,13 +1066,15 @@ Eigen values: It took \textbf{12} iterations to get those values. +\newpage \section{Discussion of the result} -Following plot was generated using task4Plot function, using maxMatrixSize = 25 and generating random symmetrical matrix of size i x i in each loop. Both QR methods were given exactly the same matrices. +Following plot was generated using \hyperlink{function4}{task4Plot} function, using maxMatrixSize = 25 and generating random symmetrical matrix of size i x i in each loop. Both QR methods were given exactly the same matrices. \subsection{Plot} \begin{center} \includegraphics[scale=0.5]{task4plot.eps} \end{center} +\newpage \subsection{Shift method superiority} As we can see: QR method with shifts is much more efficient and reliable. @@ -1084,7 +1091,7 @@ QR method with shifts is much more efficient and reliable. - +\addtocontents{toc}{\protect\newpage} \chapter{Code appendix} \section{Task 2 Code} @@ -1149,6 +1156,7 @@ end % end function \end{lstlisting} \end{simplechar} +\newpage \subsection{partialPivotingSwapOneRow} \begin{simplechar} \begin{lstlisting} @@ -1184,6 +1192,7 @@ end % end function \end{lstlisting} \end{simplechar} +\newpage \subsection{gaussianElimination} \begin{simplechar} \begin{lstlisting} @@ -1214,18 +1223,18 @@ end % end function \begin{lstlisting} function [Matrix, Vector, x] = backSubstitutionPhase(Columns, Matrix, Vector) for k = Columns : -1 : 1 - % Start at final column and move by -1 each iteration until We reach 1 + % Start at final column and move by -1 each iteration until we reach 1 equation = 0; for j = k+1 : Columns equation = equation + Matrix(k,j) * x(j, 1); - % even though x is a vector We still need to put '1' to ensure + % even though x is a vector we still need to put '1' to ensure % that number of columns in the first matrix matches number of % rows in second matrix end % end for x(k, 1) = (Vector(k,1) - equation) / Matrix(k,k); - % even though x is a vector We still need to put '1' to ensure - % that We do not exceed array bounds + % even though x is a vector we still need to put '1' to ensure + % that we do not exceed array bounds end % end for end % end function \end{lstlisting} @@ -1242,6 +1251,7 @@ end % end function \end{lstlisting} \end{simplechar} +\newpage \subsection{improveSolution} \begin{simplechar} \begin{lstlisting} @@ -1259,7 +1269,50 @@ end % end function \end{lstlisting} \end{simplechar} -\section{Task 3 code} +\newpage +\subsection{plotErrorsGaussian} +\begin{simplechar} +\begin{lstlisting} +function plotErrorsGaussian(maxMatrixSize) + + errorsA = zeros(maxMatrixSize); + errorsB = zeros(maxMatrixSize); + errorsAR = zeros(maxMatrixSize); + errorsBR = zeros(maxMatrixSize); + for i = 1 : maxMatrixSize + [~, errorBeforeResidualCorrection, errorAfterResidualCorrection] = indicatedMethod(matrixA(i), vectorA(i)); + errorsA(i) = errorBeforeResidualCorrection; + errorsAR(i) = errorAfterResidualCorrection; + [~, errorBeforeResidualCorrection, errorAfterResidualCorrection] = indicatedMethod(matrixB(i), vectorB(i)); + errorsB(i) = errorBeforeResidualCorrection; + errorsBR(i) = errorAfterResidualCorrection; + end + nexttile + plot(errorsA, '.'); + title('Errors before residual correction for task 2a:'); + xlabel('Size of matrix A'); + ylabel('Errors'); + nexttile + plot(errorsAR, '.'); + title('Errors after residual correction for task 2a:'); + xlabel('Size of matrix A'); + ylabel('Errors'); + nexttile + plot(errorsB, '.'); + title('Errors before residual correction for task 2b:'); + xlabel('Size of matrix A'); + ylabel('Errors'); + nexttile + plot(errorsBR, '.'); + title('Errors after residual correction for task 2b:'); + xlabel('Size of matrix A'); + ylabel('Errors'); +end +\end{lstlisting} +\end{simplechar} + + +\section{Task 3 Code} \begin{simplechar} \begin{lstlisting} function [x_j, x_g] = iterative(Matrix, Vector) @@ -1272,6 +1325,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsection{initializeValues} \begin{simplechar} \begin{lstlisting} @@ -1294,15 +1348,16 @@ end function [L, D, U] = decomposeMatrix(Matrix) D = diag(diag(Matrix)); U = triu(Matrix, 1); % Generates upper triangular part of matrix - % where the second variable denotes on which diagonal of matrix should we + % where the second variable denotes on which diagonal of matrix should be % start L = tril(Matrix, -1); % Generates lower triangular part of matrix - % where the second variable denotes on which diagonal of matrix should we + % where the second variable denotes on which diagonal of matrix should be % start end \end{lstlisting} \end{simplechar} +\newpage \subsection{jacobiLoop} \begin{simplechar} \begin{lstlisting} @@ -1358,6 +1413,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsection{gaussSeidelEquation} \begin{simplechar} \begin{lstlisting} @@ -1389,6 +1445,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsection{endOfLoop} \begin{simplechar} \begin{lstlisting} @@ -1426,6 +1483,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsection{plotIterations} \begin{simplechar} \begin{lstlisting} @@ -1453,47 +1511,8 @@ end \end{lstlisting} \end{simplechar} -\subsection{plotIterations} -\begin{simplechar} -\begin{lstlisting} -function plotErrorsGaussian(maxMatrixSize) - - errorsA = zeros(maxMatrixSize); - errorsB = zeros(maxMatrixSize); - errorsAR = zeros(maxMatrixSize); - errorsBR = zeros(maxMatrixSize); - for i = 1 : maxMatrixSize - [~, errorBeforeResidualCorrection, errorAfterResidualCorrection] = indicatedMethod(matrixA(i), vectorA(i)); - errorsA(i) = errorBeforeResidualCorrection; - errorsAR(i) = errorAfterResidualCorrection; - [~, errorBeforeResidualCorrection, errorAfterResidualCorrection] = indicatedMethod(matrixB(i), vectorB(i)); - errorsB(i) = errorBeforeResidualCorrection; - errorsBR(i) = errorAfterResidualCorrection; - end - nexttile - plot(errorsA, '.'); - title('Errors before residual correction for task 2a:'); - xlabel('Size of matrix A'); - ylabel('Errors'); - nexttile - plot(errorsAR, '.'); - title('Errors after residual correction for task 2a:'); - xlabel('Size of matrix A'); - ylabel('Errors'); - nexttile - plot(errorsB, '.'); - title('Errors before residual correction for task 2b:'); - xlabel('Size of matrix A'); - ylabel('Errors'); - nexttile - plot(errorsBR, '.'); - title('Errors after residual correction for task 2b:'); - xlabel('Size of matrix A'); - ylabel('Errors'); -end -\end{lstlisting} -\end{simplechar} +\newpage \section{Task 4 Code} \subsection{Gram-Schmid algorithm} @@ -1521,7 +1540,7 @@ end \end{lstlisting} \end{simplechar} -\subsubsection{initializeGramSchmid} +\subsubsection{factorizeColumnsOfQ} \begin{simplechar} \begin{lstlisting} function [Q, R] = factorizeColumnsOfQ(columns, Q, Matrix, R, d) @@ -1538,7 +1557,7 @@ end \end{lstlisting} \end{simplechar} -\subsubsection{initializeGramSchmid} +\subsubsection{normalizeColumns} \begin{simplechar} \begin{lstlisting} function [Q, R] = normalizeColumns(columns, Q, R) @@ -1551,7 +1570,7 @@ end \end{lstlisting} \end{simplechar} - +\subsection{task4} \begin{simplechar} \begin{lstlisting} function [eigenValuesNoShifts, iterationsNoShifts, finalMatrixNoShifts, eigenValuesShifts, iterationsShifts, finalMatrixShifts] = task4(Matrix) @@ -1574,6 +1593,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsubsection{QRNoShiftsLoop} \begin{simplechar} \begin{lstlisting} @@ -1607,6 +1627,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsubsection{displayResults} \begin{simplechar} \begin{lstlisting} @@ -1637,6 +1658,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsection{QRShifts} \begin{simplechar} \begin{lstlisting} @@ -1663,6 +1685,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsubsection{QRShiftLoop} \begin{simplechar} \begin{lstlisting} @@ -1691,6 +1714,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsubsection{getEigenValueFromCorner} \begin{simplechar} \begin{lstlisting} @@ -1729,6 +1753,7 @@ end \end{lstlisting} \end{simplechar} +\newpage \subsubsection{thresholdBreached} \begin{simplechar} \begin{lstlisting} @@ -1798,6 +1823,32 @@ end \end{lstlisting} \end{simplechar} +\newpage +\hypertarget{function4}{\subsection{task4Plot}} +\begin{simplechar} +\begin{lstlisting} +function task4Plot(maxMatrixSize) + iterationsNoShiftsVector = zeros(maxMatrixSize); + iterationsShiftsVector = zeros(maxMatrixSize); + for i = 1 : maxMatrixSize + [~, iterationsNoShifts, ~, ~, iterationsShifts, ~] = task4(matrix4(i)); + iterationsNoShiftsVector(i) = iterationsNoShifts; + iterationsShiftsVector(i) = iterationsShifts; + end + nexttile + plot(iterationsNoShiftsVector, '.'); + title('Number of iterations for different sizes of matrices for no shift method'); + xlabel('Size of matrix A'); + ylabel('Number of iterations'); + nexttile + plot(iterationsShiftsVector, '.'); + title('Number of iterations for different sizes of matrices for shift method'); + xlabel('Size of matrix A'); + ylabel('Number of iterations'); +end +\end{lstlisting} +\end{simplechar} + \begin{thebibliography}{9} \bibitem{texbook} diff --git a/ENUME/projectA/projectA.toc b/ENUME/projectA/projectA.toc index a9cf8014..dc759866 100644 --- a/ENUME/projectA/projectA.toc +++ b/ENUME/projectA/projectA.toc @@ -2,10 +2,10 @@ \contentsline {section}{\numberline {1.1}Problem}{4}{section.1.1}% \contentsline {section}{\numberline {1.2}Theoretical Introduction}{4}{section.1.2}% \contentsline {subsection}{\numberline {1.2.1}Definition of machine epsilion}{4}{subsection.1.2.1}% -\contentsline {subsection}{\numberline {1.2.2}Practical applications of machine epsilion}{4}{subsection.1.2.2}% +\contentsline {subsection}{\numberline {1.2.2}Practical applications of machine epsilion}{5}{subsection.1.2.2}% \contentsline {section}{\numberline {1.3}Solution}{6}{section.1.3}% \contentsline {subsection}{\numberline {1.3.1}Matlab code}{6}{subsection.1.3.1}% -\contentsline {section}{\numberline {1.4}Discussion of the result}{6}{section.1.4}% +\contentsline {section}{\numberline {1.4}Discussion of the result}{7}{section.1.4}% \contentsline {chapter}{\numberline {2}Problem 2 - Solving a system of n linear equations - indicated method}{8}{chapter.2}% \contentsline {section}{\numberline {2.1}Problem}{8}{section.2.1}% \contentsline {section}{\numberline {2.2}Theoretical Introduction}{8}{section.2.2}% @@ -15,95 +15,100 @@ \contentsline {subsubsection}{Zeroing second column}{9}{section*.4}% \contentsline {subsubsection}{Zeroing next columns}{10}{section*.5}% \contentsline {subsection}{\numberline {2.2.2}Backward substitution}{10}{subsection.2.2.2}% -\contentsline {subsection}{\numberline {2.2.3}Partial Pivoting}{10}{subsection.2.2.3}% -\contentsline {section}{\numberline {2.3}Results}{11}{section.2.3}% -\contentsline {section}{\numberline {2.4}Discussion of results}{14}{section.2.4}% +\contentsline {subsection}{\numberline {2.2.3}Partial Pivoting}{11}{subsection.2.2.3}% +\contentsline {section}{\numberline {2.3}Results}{12}{section.2.3}% +\contentsline {subsection}{\numberline {2.3.1}2a)}{12}{subsection.2.3.1}% +\contentsline {subsection}{\numberline {2.3.2}2b)}{14}{subsection.2.3.2}% +\contentsline {section}{\numberline {2.4}Discussion of results}{16}{section.2.4}% \contentsline {subsection}{\numberline {2.4.1}Errors in b)}{17}{subsection.2.4.1}% \newpage -\contentsline {chapter}{\numberline {3}Problem 3 - Solving a system of n linear equations - iterative algorithm}{18}{chapter.3}% -\contentsline {section}{\numberline {3.1}Problem}{18}{section.3.1}% -\contentsline {section}{\numberline {3.2}Theoretical introduction}{19}{section.3.2}% -\contentsline {subsection}{\numberline {3.2.1}Procedure}{19}{subsection.3.2.1}% -\contentsline {subsubsection}{Decomposing matrix}{19}{section*.6}% -\contentsline {subsubsection}{Jacobi's method}{20}{section*.7}% -\contentsline {paragraph}{Converging}{20}{section*.8}% -\contentsline {subsubsection}{Gauss-Seidel method}{21}{section*.9}% -\contentsline {paragraph}{Converging}{22}{section*.10}% -\contentsline {subsubsection}{Stop tests}{22}{section*.11}% -\contentsline {subsubsection}{\textbf {A} and \textbf {b}}{23}{section*.12}% -\contentsline {section}{\numberline {3.3}Results}{23}{section.3.3}% -\contentsline {subsection}{\numberline {3.3.1}Jacobi method result}{23}{subsection.3.3.1}% -\contentsline {subsubsection}{Minimizing the demanded error}{26}{section*.13}% -\contentsline {paragraph}{For original system of equations:}{26}{section*.14}% -\contentsline {paragraph}{For task 2a) system of equations:}{26}{section*.15}% -\contentsline {subsection}{\numberline {3.3.2}Gauss-Seidel method result}{27}{subsection.3.3.2}% -\contentsline {subsubsection}{Minimizing the demanded error}{28}{section*.16}% -\contentsline {paragraph}{For original system of equations:}{28}{section*.17}% -\contentsline {paragraph}{For task 2a) system of equations:}{29}{section*.18}% -\contentsline {paragraph}{Table}{30}{section*.19}% -\contentsline {section}{\numberline {3.4}Discussion of results}{30}{section.3.4}% -\contentsline {subsection}{\numberline {3.4.1}Comparison based on table}{30}{subsection.3.4.1}% -\contentsline {subsection}{\numberline {3.4.2}Convergence}{30}{subsection.3.4.2}% -\contentsline {subsubsection}{2b) task convergence }{31}{section*.20}% -\contentsline {subsubsection}{Iterations as function of size of Matrix}{31}{section*.21}% -\contentsline {chapter}{\numberline {4}Problem 4 - QR method of finding eigenvalues}{34}{chapter.4}% -\contentsline {section}{\numberline {4.1}Problem}{34}{section.4.1}% -\contentsline {section}{\numberline {4.2}Theoretical introduction}{34}{section.4.2}% -\contentsline {subsection}{\numberline {4.2.1}Eigenvalues}{34}{subsection.4.2.1}% -\contentsline {subsection}{\numberline {4.2.2}QR method for finding eigenvalues}{34}{subsection.4.2.2}% -\contentsline {section}{\numberline {4.3}Results}{35}{section.4.3}% -\contentsline {subsection}{\numberline {4.3.1}Starting matrix}{35}{subsection.4.3.1}% -\contentsline {subsection}{\numberline {4.3.2}QR method with no shifts}{36}{subsection.4.3.2}% -\contentsline {subsection}{\numberline {4.3.3}QR method with shifts}{36}{subsection.4.3.3}% -\contentsline {section}{\numberline {4.4}Discussion of the result}{37}{section.4.4}% -\contentsline {subsection}{\numberline {4.4.1}Plot}{38}{subsection.4.4.1}% -\contentsline {subsection}{\numberline {4.4.2}Shift method superiority}{38}{subsection.4.4.2}% -\contentsline {chapter}{\numberline {5}Code appendix}{40}{chapter.5}% -\contentsline {section}{\numberline {5.1}Task 2 Code}{40}{section.5.1}% -\contentsline {subsection}{\numberline {5.1.1}Main function}{40}{subsection.5.1.1}% -\contentsline {subsection}{\numberline {5.1.2}checkIfMatrixIsSquareMatrix}{41}{subsection.5.1.2}% -\contentsline {subsection}{\numberline {5.1.3}gaussianEliminationWithPartialPivoting}{42}{subsection.5.1.3}% -\contentsline {subsection}{\numberline {5.1.4}partialPivoting}{42}{subsection.5.1.4}% -\contentsline {subsection}{\numberline {5.1.5}partialPivotingSwapOneRow}{42}{subsection.5.1.5}% -\contentsline {subsection}{\numberline {5.1.6}swapRowMatrix}{43}{subsection.5.1.6}% -\contentsline {subsection}{\numberline {5.1.7}swapValueVector}{43}{subsection.5.1.7}% -\contentsline {subsection}{\numberline {5.1.8}gaussianElimination}{43}{subsection.5.1.8}% -\contentsline {subsection}{\numberline {5.1.9}substractRows}{44}{subsection.5.1.9}% -\contentsline {subsection}{\numberline {5.1.10}backSubstitutionPhase}{45}{subsection.5.1.10}% -\contentsline {subsection}{\numberline {5.1.11}iterativeResidualCorrection}{45}{subsection.5.1.11}% -\contentsline {subsection}{\numberline {5.1.12}improveSolution}{45}{subsection.5.1.12}% -\contentsline {section}{\numberline {5.2}Task 3 code}{46}{section.5.2}% -\contentsline {subsection}{\numberline {5.2.1}initializeValues}{46}{subsection.5.2.1}% -\contentsline {subsection}{\numberline {5.2.2}decomposeMatrix}{47}{subsection.5.2.2}% -\contentsline {subsection}{\numberline {5.2.3}jacobiLoop}{47}{subsection.5.2.3}% -\contentsline {subsection}{\numberline {5.2.4}jacobiInsideLoop}{48}{subsection.5.2.4}% -\contentsline {subsection}{\numberline {5.2.5}jacobiEquation}{48}{subsection.5.2.5}% -\contentsline {subsection}{\numberline {5.2.6}gaussSeidelLoop}{48}{subsection.5.2.6}% -\contentsline {subsection}{\numberline {5.2.7}gaussiInsideLoop}{49}{subsection.5.2.7}% -\contentsline {subsection}{\numberline {5.2.8}gaussSeidelEquation}{49}{subsection.5.2.8}% -\contentsline {subsection}{\numberline {5.2.9}checkError}{49}{subsection.5.2.9}% -\contentsline {subsection}{\numberline {5.2.10}endOfLoop}{50}{subsection.5.2.10}% -\contentsline {subsection}{\numberline {5.2.11}dispFinalResults}{50}{subsection.5.2.11}% -\contentsline {subsection}{\numberline {5.2.12}plotIterations}{51}{subsection.5.2.12}% -\contentsline {subsection}{\numberline {5.2.13}plotIterations}{52}{subsection.5.2.13}% -\contentsline {section}{\numberline {5.3}Task 4 Code}{53}{section.5.3}% -\contentsline {subsection}{\numberline {5.3.1}Gram-Schmid algorithm}{53}{subsection.5.3.1}% -\contentsline {subsubsection}{initializeGramSchmid}{53}{section*.22}% -\contentsline {subsubsection}{initializeGramSchmid}{53}{section*.23}% -\contentsline {subsubsection}{initializeGramSchmid}{54}{section*.24}% -\contentsline {subsection}{\numberline {5.3.2}QRNoShifts}{54}{subsection.5.3.2}% -\contentsline {subsubsection}{QRNoShiftsLoop}{55}{section*.25}% -\contentsline {subsubsection}{QRNoShiftsInsideLoop}{55}{section*.26}% -\contentsline {subsubsection}{displayResults}{56}{section*.27}% -\contentsline {subsubsection}{initializeValues}{56}{section*.28}% -\contentsline {subsection}{\numberline {5.3.3}QRShifts}{56}{subsection.5.3.3}% -\contentsline {subsubsection}{initiateValues}{57}{section*.29}% -\contentsline {subsubsection}{QRShiftLoop}{57}{section*.30}% -\contentsline {subsubsection}{findEigenValue}{58}{section*.31}% -\contentsline {subsubsection}{getEigenValueFromCorner}{58}{section*.32}% -\contentsline {subsubsection}{shiftAndIterate}{58}{section*.33}% -\contentsline {subsubsection}{deflateMatrix}{59}{section*.34}% -\contentsline {subsubsection}{thresholdBreached}{59}{section*.35}% -\contentsline {subsubsection}{solveCharactersticEquation}{59}{section*.36}% -\contentsline {subsubsection}{calculateZeros}{60}{section*.37}% -\contentsline {subsubsection}{dispResults}{60}{section*.38}% +\contentsline {chapter}{\numberline {3}Problem 3 - Solving a system of n linear equations - iterative algorithm}{19}{chapter.3}% +\contentsline {section}{\numberline {3.1}Problem}{19}{section.3.1}% +\contentsline {section}{\numberline {3.2}Theoretical introduction}{20}{section.3.2}% +\contentsline {subsection}{\numberline {3.2.1}Procedure}{20}{subsection.3.2.1}% +\contentsline {subsubsection}{Decomposing matrix}{20}{section*.6}% +\contentsline {subsubsection}{Jacobi's method}{21}{section*.7}% +\contentsline {paragraph}{Converging}{21}{section*.8}% +\contentsline {subsubsection}{Gauss-Seidel method}{22}{section*.9}% +\contentsline {paragraph}{Converging}{23}{section*.10}% +\contentsline {subsubsection}{Stop tests}{24}{section*.11}% +\contentsline {subsubsection}{\textbf {A} and \textbf {b}}{25}{section*.12}% +\contentsline {section}{\numberline {3.3}Results}{26}{section.3.3}% +\contentsline {subsection}{\numberline {3.3.1}Jacobi method result}{26}{subsection.3.3.1}% +\contentsline {subsubsection}{Minimizing the demanded error}{28}{section*.13}% +\contentsline {paragraph}{For original system of equations:}{29}{section*.14}% +\contentsline {paragraph}{For task 2a) system of equations:}{30}{section*.15}% +\contentsline {subsection}{\numberline {3.3.2}Gauss-Seidel method result}{31}{subsection.3.3.2}% +\contentsline {subsubsection}{Minimizing the demanded error}{32}{section*.16}% +\contentsline {paragraph}{For original system of equations:}{32}{section*.17}% +\contentsline {paragraph}{For task 2a) system of equations:}{33}{section*.18}% +\contentsline {section}{\numberline {3.4}Discussion of results}{34}{section.3.4}% +\contentsline {paragraph}{Table}{34}{section*.19}% +\contentsline {subsection}{\numberline {3.4.1}Comparison based on table}{34}{subsection.3.4.1}% +\contentsline {subsection}{\numberline {3.4.2}Convergence}{35}{subsection.3.4.2}% +\contentsline {subsubsection}{2b) task convergence }{35}{section*.20}% +\contentsline {subsubsection}{Iterations as function of size of Matrix}{36}{section*.21}% +\contentsline {chapter}{\numberline {4}Problem 4 - QR method of finding eigenvalues}{39}{chapter.4}% +\contentsline {section}{\numberline {4.1}Problem}{39}{section.4.1}% +\contentsline {section}{\numberline {4.2}Theoretical introduction}{39}{section.4.2}% +\contentsline {subsection}{\numberline {4.2.1}Eigenvalues}{39}{subsection.4.2.1}% +\contentsline {subsection}{\numberline {4.2.2}QR method for finding eigenvalues}{40}{subsection.4.2.2}% +\contentsline {section}{\numberline {4.3}Results}{41}{section.4.3}% +\contentsline {subsection}{\numberline {4.3.1}Starting matrix}{41}{subsection.4.3.1}% +\contentsline {subsection}{\numberline {4.3.2}QR method with no shifts}{42}{subsection.4.3.2}% +\contentsline {subsection}{\numberline {4.3.3}QR method with shifts}{42}{subsection.4.3.3}% +\contentsline {section}{\numberline {4.4}Discussion of the result}{43}{section.4.4}% +\contentsline {subsection}{\numberline {4.4.1}Plot}{43}{subsection.4.4.1}% +\contentsline {subsection}{\numberline {4.4.2}Shift method superiority}{44}{subsection.4.4.2}% +\newpage +\contentsline {chapter}{\numberline {5}Code appendix}{45}{chapter.5}% +\contentsline {section}{\numberline {5.1}Task 2 Code}{45}{section.5.1}% +\contentsline {subsection}{\numberline {5.1.1}Main function}{45}{subsection.5.1.1}% +\contentsline {subsection}{\numberline {5.1.2}checkIfMatrixIsSquareMatrix}{46}{subsection.5.1.2}% +\contentsline {subsection}{\numberline {5.1.3}gaussianEliminationWithPartialPivoting}{47}{subsection.5.1.3}% +\contentsline {subsection}{\numberline {5.1.4}partialPivoting}{47}{subsection.5.1.4}% +\contentsline {subsection}{\numberline {5.1.5}partialPivotingSwapOneRow}{48}{subsection.5.1.5}% +\contentsline {subsection}{\numberline {5.1.6}swapRowMatrix}{48}{subsection.5.1.6}% +\contentsline {subsection}{\numberline {5.1.7}swapValueVector}{48}{subsection.5.1.7}% +\contentsline {subsection}{\numberline {5.1.8}gaussianElimination}{49}{subsection.5.1.8}% +\contentsline {subsection}{\numberline {5.1.9}substractRows}{49}{subsection.5.1.9}% +\contentsline {subsection}{\numberline {5.1.10}backSubstitutionPhase}{50}{subsection.5.1.10}% +\contentsline {subsection}{\numberline {5.1.11}iterativeResidualCorrection}{50}{subsection.5.1.11}% +\contentsline {subsection}{\numberline {5.1.12}improveSolution}{51}{subsection.5.1.12}% +\contentsline {subsection}{\numberline {5.1.13}plotErrorsGaussian}{52}{subsection.5.1.13}% +\contentsline {section}{\numberline {5.2}Task 3 Code}{53}{section.5.2}% +\contentsline {subsection}{\numberline {5.2.1}initializeValues}{54}{subsection.5.2.1}% +\contentsline {subsection}{\numberline {5.2.2}decomposeMatrix}{54}{subsection.5.2.2}% +\contentsline {subsection}{\numberline {5.2.3}jacobiLoop}{55}{subsection.5.2.3}% +\contentsline {subsection}{\numberline {5.2.4}jacobiInsideLoop}{55}{subsection.5.2.4}% +\contentsline {subsection}{\numberline {5.2.5}jacobiEquation}{55}{subsection.5.2.5}% +\contentsline {subsection}{\numberline {5.2.6}gaussSeidelLoop}{56}{subsection.5.2.6}% +\contentsline {subsection}{\numberline {5.2.7}gaussiInsideLoop}{56}{subsection.5.2.7}% +\contentsline {subsection}{\numberline {5.2.8}gaussSeidelEquation}{57}{subsection.5.2.8}% +\contentsline {subsection}{\numberline {5.2.9}checkError}{57}{subsection.5.2.9}% +\contentsline {subsection}{\numberline {5.2.10}endOfLoop}{58}{subsection.5.2.10}% +\contentsline {subsection}{\numberline {5.2.11}dispFinalResults}{58}{subsection.5.2.11}% +\contentsline {subsection}{\numberline {5.2.12}plotIterations}{59}{subsection.5.2.12}% +\contentsline {section}{\numberline {5.3}Task 4 Code}{60}{section.5.3}% +\contentsline {subsection}{\numberline {5.3.1}Gram-Schmid algorithm}{60}{subsection.5.3.1}% +\contentsline {subsubsection}{initializeGramSchmid}{60}{section*.22}% +\contentsline {subsubsection}{factorizeColumnsOfQ}{60}{section*.23}% +\contentsline {subsubsection}{normalizeColumns}{61}{section*.24}% +\contentsline {subsection}{\numberline {5.3.2}task4}{61}{subsection.5.3.2}% +\contentsline {subsection}{\numberline {5.3.3}QRNoShifts}{61}{subsection.5.3.3}% +\contentsline {subsubsection}{QRNoShiftsLoop}{62}{section*.25}% +\contentsline {subsubsection}{QRNoShiftsInsideLoop}{62}{section*.26}% +\contentsline {subsubsection}{displayResults}{63}{section*.27}% +\contentsline {subsubsection}{initializeValues}{63}{section*.28}% +\contentsline {subsection}{\numberline {5.3.4}QRShifts}{64}{subsection.5.3.4}% +\contentsline {subsubsection}{initiateValues}{64}{section*.29}% +\contentsline {subsubsection}{QRShiftLoop}{65}{section*.30}% +\contentsline {subsubsection}{findEigenValue}{65}{section*.31}% +\contentsline {subsubsection}{getEigenValueFromCorner}{66}{section*.32}% +\contentsline {subsubsection}{shiftAndIterate}{66}{section*.33}% +\contentsline {subsubsection}{deflateMatrix}{66}{section*.34}% +\contentsline {subsubsection}{thresholdBreached}{67}{section*.35}% +\contentsline {subsubsection}{solveCharactersticEquation}{67}{section*.36}% +\contentsline {subsubsection}{calculateZeros}{68}{section*.37}% +\contentsline {subsubsection}{dispResults}{68}{section*.38}% +\contentsline {subsection}{\numberline {5.3.5}task4Plot}{69}{subsection.5.3.5}%