{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"# Heat Equation \n",
" \n",
"\n",
"Date: **Apr 7, 2021** Deadline: **Apr 26, 2021**"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 1) \n",
"\n",
"Check whether the superposition principle holds in the following examples of PDE problems. That is, assuming that $u(x,t)$ and $v(x,t)$ are solutions of the given problems, you have to check whether $u+v$ and $c\\cdot u$ are still solutions. Note that when boundary conditions are specified you have to check whether __both__ the equation and the boundary conditions are satisfied.\n",
"\n",
"__a)__ $\\frac{\\partial^3 u}{\\partial t^3}=x^2 \\frac{\\partial^2 u}{\\partial x^2}$.\n",
"\n",
"__b)__ $\\frac{\\partial u}{\\partial t} = u\\frac{\\partial u}{\\partial x}$.\n",
"\n",
"__c)__ $\\frac{\\partial^2 u}{\\partial t\\partial x}=t\\frac{\\partial u}{\\partial t}$ with boundary conditions $u(0,t)=0 , \\frac{\\partial u}{\\partial x}(1,t)=0$. \n",
"\n",
"__d)__ $\\frac{\\partial u}{\\partial t} = \\frac{\\partial^2 u}{\\partial x^2}$ with boundary conditions $u(0,t)=0 , u(1,t)=5t$.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 2)\n",
"\n",
"__a)__ Find the solution to the heat equation (with $c=1$) \n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial t} = \\frac{\\partial^2 u}{\\partial x^2}\n",
"$$\n",
"\n",
"on the interval $[0,L]$ satisfying homogeneous Dirichlet boundary condition (that is, $u(0,t)=0$ and $u(L,t)=0$ for all $t$) and with initial datum \n",
"\n",
"$$\n",
"u(x,0) = 4\\sin(\\frac{5\\pi x}{L})+7\\sin(\\frac{11\\pi x}{L}).\n",
"$$\n",
"\n",
"__b)__ Find the solution to the non-homogeneous heat equation \n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial t} - \\frac{\\partial^2 u}{\\partial x^2}=1\n",
"$$\n",
"\n",
"satisfying the same boundary and initial conditions as in part __a)__. \n",
"\n",
"__Hint:__ Consider $v(x,t)=u(x,t)+x(x-L)/2$."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 3)\n",
"The goal of this problem is to solve the heat equation with mixed boundary conditions. You will do it in steps.\n",
"\n",
"__a)__ Show that for $n, m$ positive integers\n",
"\n",
"$$\n",
"\\int_0^{\\pi}\\cos\\left(\\left(n+\\frac{1}{2}\\right)x\\right)\\cos\\left(\\left(m+\\frac{1}{2}\\right)x\\right)=\\begin{cases}\n",
" \\frac{\\pi}{2} \\quad m=n\\\\\n",
" 0 \\quad m\\neq n\n",
" \\end{cases}.\n",
"$$\n",
"\n",
"__b)__ Solve the heat equation ($c=1$)\n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial t} = \\frac{\\partial^2 u}{\\partial x^2}\n",
"$$\n",
"\n",
"with boundary conditions \n",
"\n",
"$$\n",
"\\frac{\\partial u}{\\partial x}(0,t)=u(\\pi,t)=0 \\quad \\text{for all } t\n",
"$$\n",
"\n",
"and initial condition \n",
"\n",
"$$\n",
"u(x,0)=\\begin{cases}\n",
" x \\qquad 0\\leq x \\leq \\frac{\\pi}{2}\\\\\n",
" \\pi-x \\quad \\frac{\\pi}{2}\\leq x \\leq \\pi\n",
" \\end{cases}.\n",
"$$\n",
"\n",
"To do this, repeat the separation of variables approach discussed in the lectures; you should use part __a)__ at some point. Note that the meaning of part __a)__ is finding an orthonormal basis for $[0,\\pi]$ that satisfies mixed boundary conditions. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 4)\n",
"\n",
"The goal of this problem is to find the steady state temperature in a thin square plate. Find the solution to the following Dirichlet problem in the square $[0,a]\\times [0,a]$:\n",
"\n",
"$$\n",
"\\frac{\\partial^2 u}{\\partial x^2}+\\frac{\\partial^2 u}{\\partial y^2}=0\n",
"$$\n",
"\n",
"with boundary conditions \n",
"\n",
"$$\n",
"\\begin{align*}\n",
"&u(x,0)=20 \\quad 0\\leq x