I have used a difference scheme and Fourier Analysis to find an expression for the solution to the heat Equation. My problem is plotting my solution.
$w_{k,j,m}=(1-\Delta t\mu_k)^msin(k\pi x_j)$
$\mu_k=\frac{4}{(\Delta x)^2}sin^2(k\pi \Delta x/2)$
$X_{k,j}=sin(k\pi x_j) , j=1,...n$
$v=\sum\limits_{k=1}^n\gamma_kw_k$
The coefficients ${\gamma_k}$ are ditermined by using the initial condition: $v_{j,0}$ (meaning $t=0$) for $j=1,...,n.$ Since $w_k=X_k$ at $t=0$, we want to determine ${\gamma_k}$ such that : $\sum\limits_{k=1}^n\gamma_k X_{k,j}=f(x_j)$ for $j=1,...,n$.
To get to the equation below, there are some more equations that needs to be listed:
$g=\sum_{k=1}^n c_k v_k$ where $c_1,c_2,...c_n$ are real coefficients. It is also given that: $<g,v_m>_h=\sum_{k=1}^n c_k<v_k,v_m>_h=\frac{c_m}{2}$ Where $<g,v_m>_h$ is the discrete inner Product of g and $v_m$. Since $v_k=sin(k\pi x_j)$, $g$ can be expressed in the following way: $g(x_j)=\sum\limits_{k=1}^n2<g,v_k>_hsin(k\pi x_j), j=1,...,n$. From the expressions above, the expression for $\gamma_k$ can be found:
$\gamma_k=2\Delta x\sum\limits_{j=1}^nf(x_j)X_{k,j}$
I am supposed to plot $v$, but I have some problems: - How can we get a value for $f(x_j)$? In the book it says that $f(x_j)=v_{j,0}$,meaning t=0. The problem is that v is a function of $\gamma_k$ which again is a function of $f(x_j)$. Does anyone know how to get a value for $ f(x_j)$, without going in an infinite loop? David