Subjects partial differential equations

Heat Equation Ftcs 7C8Ce2

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Use the AI math solver

1. **Problem statement:** Solve the 2D heat equation $$\frac{\partial u}{\partial t} = \alpha \left( \frac{\partial^2 u}{\partial x^2} + \frac{\partial^2 u}{\partial y^2} \right)$$ with $$\alpha = 1$$ on the domain $$0 < x < 1, 0 < y < 1$$, initial condition $$u(x,y,0) = 0$$, and boundary conditions $$u(0,y,t) = 100$$, $$u(1,y,t) = 100$$, $$u(x,0,t) = 0$$, $$u(x,1,t) = 0$$. 2. **Method:** Use the Forward Time Centered Space (FTCS) finite difference scheme. 3. **Discretization:** Let $$\Delta x$$ and $$\Delta y$$ be spatial steps, $$\Delta t$$ the time step, and define grid points $$u_{i,j}^n$$ approximating $$u(x_i,y_j,t_n)$$. 4. **FTCS scheme:** $$ u_{i,j}^{n+1} = u_{i,j}^n + r_x (u_{i+1,j}^n - 2u_{i,j}^n + u_{i-1,j}^n) + r_y (u_{i,j+1}^n - 2u_{i,j}^n + u_{i,j-1}^n) $$ where $$r_x = \frac{\Delta t}{(\Delta x)^2}$$ and $$r_y = \frac{\Delta t}{(\Delta y)^2}$$. 5. **Matrix form:** Flatten the 2D grid into a vector $$\mathbf{U}^n$$ of length $$M = (N_x - 1)(N_y - 1)$$ excluding boundary points. 6. The update can be written as: $$ \mathbf{U}^{n+1} = \mathbf{U}^n + r_x \mathbf{A}_x \mathbf{U}^n + r_y \mathbf{A}_y \mathbf{U}^n + \mathbf{b}^n $$ where $$\mathbf{A}_x$$ and $$\mathbf{A}_y$$ are matrices representing second differences in $$x$$ and $$y$$ directions, and $$\mathbf{b}^n$$ incorporates boundary conditions. 7. **Constructing $$\mathbf{A}_x$$ and $$\mathbf{A}_y$$:** - $$\mathbf{A}_x = I_y \otimes T_x$$ where $$T_x$$ is the tridiagonal matrix for second difference in $$x$$, - $$\mathbf{A}_y = T_y \otimes I_x$$ where $$T_y$$ is the tridiagonal matrix for second difference in $$y$$, - $$I_x$$ and $$I_y$$ are identity matrices of size $$N_x - 1$$ and $$N_y - 1$$ respectively. 8. **Example for $$T_x$$:** $$ T_x = \begin{bmatrix} -2 & 1 & 0 & \cdots & 0 \\ 1 & -2 & 1 & \cdots & 0 \\ 0 & 1 & -2 & \cdots & 0 \\ \vdots & \vdots & \vdots & \ddots & 1 \\ 0 & 0 & 0 & 1 & -2 \end{bmatrix} $$ 9. **Boundary vector $$\mathbf{b}^n$$:** Accounts for fixed boundary values at edges, e.g., for $$u(0,y,t) = 100$$ and $$u(1,y,t) = 100$$, add terms to $$\mathbf{b}^n$$ corresponding to these known values multiplied by $$r_x$$ or $$r_y$$. 10. **Summary:** The FTCS update in matrix form is: $$ \mathbf{U}^{n+1} = \left( I + r_x \mathbf{A}_x + r_y \mathbf{A}_y \right) \mathbf{U}^n + \mathbf{b}^n $$ where $$I$$ is the identity matrix. This formulation allows iterative computation of $$u$$ at each time step respecting initial and boundary conditions.