Change n=6 to n=10
This commit is contained in:
parent
d6e0090fb8
commit
8d7c20f919
@ -1,18 +1,18 @@
|
|||||||
\section*{Problem 6}
|
\section*{Problem 6}
|
||||||
|
|
||||||
\subsection*{a)}
|
\subsection*{a)}
|
||||||
The plot in Figure \ref{fig:eigenvector_6} is showing the discretization of $\hat{x}$ with $n=6$.
|
The plot in Figure \ref{fig:eigenvector_10} is showing the discretization of $\hat{x}$ with $n=10$.
|
||||||
The eigenvectors and corresponding analytical eigenvectors have a complete overlap suggesting the implementation of the algorithm is correct.
|
The eigenvectors and corresponding analytical eigenvectors have a complete overlap suggesting the implementation of the algorithm is correct.
|
||||||
We have included the boundary points for each vector to show a complete solution.
|
We have included the boundary points for each vector to show a complete solution.
|
||||||
\begin{figure}[h]
|
\begin{figure}[h]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=0.8\textwidth]{images/eigenvector_6.pdf}
|
\includegraphics[width=0.8\textwidth]{images/eigenvector_10.pdf}
|
||||||
\caption{The plot is showing the elements of eigenvector $\vec{v}_{1}, \vec{v}_{2}, \vec{v}_{3}$, corresponding to the three lowest eigenvalues of matrix $\boldsymbol{A} (6 \cross 6)$, against the position $\hat{x}$. The analytical eigenvectors $\vec{v}^{(1)}, \vec{v}^{(2)}, \vec{v}^{(3)}$ are also included in the plot.}
|
\caption{The plot is showing the elements of eigenvector $\vec{v}_{1}, \vec{v}_{2}, \vec{v}_{3}$, corresponding to the three lowest eigenvalues of matrix $\boldsymbol{A} (10 \cross 10)$, against the position $\hat{x}$. The analytical eigenvectors $\vec{v}^{(1)}, \vec{v}^{(2)}, \vec{v}^{(3)}$ are also included in the plot.}
|
||||||
\label{fig:eigenvector_6}
|
\label{fig:eigenvector_10}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\subsection*{b)}
|
\subsection*{b)}
|
||||||
For the discretization with $n=100$ the solution is visually close to a continous curve, with a complete overlap of the analytical eigenvectors, presented in Figure \ref{fig:eigenvector_100}.
|
For the discretization with $n=100$ the solution is visually close to a continuous curve, with a complete overlap of the analytical eigenvectors, presented in Figure \ref{fig:eigenvector_100}.
|
||||||
\begin{figure}
|
\begin{figure}
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width=0.8\textwidth]{images/eigenvector_100.pdf}
|
\includegraphics[width=0.8\textwidth]{images/eigenvector_100.pdf}
|
||||||
|
|||||||
@ -156,9 +156,9 @@ void write_eigenvec(int N)
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// write_transformation_tridiag(100);
|
write_transformation_tridiag(100);
|
||||||
// write_transformation_dense(100);
|
write_transformation_dense(100);
|
||||||
write_eigenvec(6);
|
write_eigenvec(10);
|
||||||
write_eigenvec(100);
|
write_eigenvec(100);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,7 +24,6 @@ def plot_transformations(save: bool=False) -> None:
|
|||||||
fig.savefig("../latex/images/transform.pdf")
|
fig.savefig("../latex/images/transform.pdf")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def plot_eigenvectors(N: int, save: bool=False) -> None:
|
def plot_eigenvectors(N: int, save: bool=False) -> None:
|
||||||
# Load data based on matrix size
|
# Load data based on matrix size
|
||||||
path = f"../latex/output/eigenvector_{N}.csv"
|
path = f"../latex/output/eigenvector_{N}.csv"
|
||||||
@ -46,10 +45,7 @@ def plot_eigenvectors(N: int, save: bool=False) -> None:
|
|||||||
fig.savefig(f"../latex/images/eigenvector_{N}.pdf")
|
fig.savefig(f"../latex/images/eigenvector_{N}.pdf")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# plot_transformations(True)
|
plot_transformations(True)
|
||||||
plot_eigenvectors(6, True)
|
plot_eigenvectors(10, True)
|
||||||
plot_eigenvectors(100, True)
|
plot_eigenvectors(100, True)
|
||||||
# plt.show()
|
|
||||||
Loading…
Reference in New Issue
Block a user