Aufgabe 1

Teil a

$$ M = \begin{pmatrix} 1 & -1 & 0 & \cdots & 0 \\ -1 & 2 & \ddots & \ddots & \vdots \\ 0 & \ddots & \ddots & & 0 \\ \vdots & \ddots & & 2 & -1 \\ 0 & \cdots & 0 & -1 & 1 \\ \end{pmatrix} $$

Teil b


In [1]:
function M(N)
    side = vcat(zeros(1,N), eye(N-1, N))
    diag = -2 * eye(N,N)
    diag[1,1] = -1
    diag[N,N] = -1
    return diag + side + side'
end


Out[1]:
M (generic function with 1 method)

In [4]:
N = 10
a = M(N)
a_ew = eigvals(a)
a_ev = eigvecs(a)
k = m = 1
omega = sqrt(k/m*abs(a_ew))
omega


Out[4]:
10-element Array{Float64,1}:
 1.97538   
 1.90211   
 1.78201   
 1.61803   
 1.41421   
 1.17557   
 0.907981  
 0.618034  
 0.312869  
 3.33811e-9

Teil c

$$ \xi(0) = \sum_{n=1}^N \vec a_n \alpha_n = \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix} = A\vec\alpha \\ mit\ A = (\vec a_1, \vec a_2, \cdots, \vec a_N)\\ \dot \xi(0) = \sum_{n=1}^N \vec a_n \beta_n \omega_n = \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 0 \end{pmatrix} = B\vec\beta \\ mit\ B = (\omega_1 \vec a_1, \omega_2 \vec a_2, \cdots, \omega_N \vec a_N) \\ \\ \Leftrightarrow \vec \alpha = A^{-1} \begin{pmatrix} 1 \\ 0 \\ \vdots \\ 0 \end{pmatrix}\ und\ \vec \beta = B^{-1} \begin{pmatrix} 0 \\ 0 \\ \vdots \\ 0 \end{pmatrix} $$

In [25]:
A = copy(a_ev)
B = copy(a_ev)
for i in 1:N
    B[i,:] = B[i,:] .* a_ew[i]
end
xi_0 = zeros(N)
xi_0[1] = 1
dot_xi_0 = zeros(N)
alpha = inv(A)*xi_0


Out[25]:
10-element Array{Float64,1}:
 -0.0699596
  0.138197 
  0.203031 
 -0.262866 
  0.316228 
 -0.361803 
 -0.39847  
 -0.425325 
 -0.441708 
  0.316228 

In [17]:
beta = inv(B)*dot_xi_0


Out[17]:
10-element Array{Float64,1}:
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0
 0.0