#start of lec 26 We start with some thermodynamics # Heat equation Heat equation not only describes thermodynamics but it can also model the diffusion of gasses. It is a partial differential equation. Strikingly, it can also model option prices in the stock market. However, using it as a strategy to make money is not so simple, because if it worked then everyone would try to use it to make money, which would cause the overall strategy to be less effective as the option prices start to get priced to accommodate for the prediction (🤯). ![draw](drawings/Drawing-2023-11-08-13.07.19.excalidraw.png) We assume that the tube is perfectly insulating along its surface, this helps reduce the problem into a one dimensional problem. Heat can only travel inside and along the x axis. Fourier figured out that: $\text{Heat flux} = -k(x)a\frac{\partial u}{\partial x}(t,x) \Delta t$ heat flux is in the positive $x$ direction where du/dx is the opposite sign of the flux (because hot flows to cold.) where $u(t,x)$ is a function that describes the temperature in the tube. $-k(x+\Delta x)a\frac{\partial u}{\partial x}(t,x+\Delta x) \Delta t$ $\Delta u=u(t+\Delta t,x)-u(t,x)$ Amount of heat to change temperature over $\Delta t$ with $\Delta u$ is $\underbrace{ C(x) }_{ \text{specific heat capacity } }\underbrace{ \rho(x) }_{ \text{density} }\Delta u\underbrace{ a\Delta x }_{ \text{volume} }$ $c(x)\rho(x)a\Delta x(u(t+\Delta t,x)-u(t,x))=a\Delta t(k(x+\Delta x) \frac{\partial u}{\partial x}(t_{1}x+\Delta x)-k(x) \frac{\partial u}{\partial x}(t,x))+Q(t,x)\Delta xa\Delta t$ divide by $a\Delta x\Delta t$ $c(x)\rho(x)\frac{(u(t+\Delta t,x)-u(t,x))}{\Delta t}=a\Delta t\left( k(x+\Delta x) \frac{\partial u}{\partial x}(t,x+\Delta x)-k(x) \frac{\partial u}{\partial x}(t,x) \right)+Q(t,x)$ $\lim_{ \Delta x,\Delta t \to 0 }: c(x)\rho(x)\frac{ \partial u }{ \partial t }(t,x)=\frac{ \partial }{ \partial x }\left( k(x)\frac{ \partial u }{ \partial x }(t,x) \right)+Q(t,x)$ Any differential equation, to his knowledge, is to balance some volume and to take the limit to produce a pointwise / instantaneous balance (in the form of a differential equation) the Maxwell equations that describes magnetic and electric fields are a system of partial differential equations. thermodynamics can be very important for electrical engineers, for instance the heat produced in a transformer, or a battery. It has applications. $\frac{ \partial u }{ \partial t }=D \frac{ \partial^2 u }{ \partial x^2 }, \quad 0\leq x\leq L, \quad t>0$ boundary conditions: $u(t,0)=u(t,L)=0 , \quad t>0$ (simple case) $u(0,x)=f(x) , \quad 0\leq x\leq L$ These three equations form an IBVP (initial boundary value problem) we will work on this equation next lecture: $u(t,x)=T(t)X(x)$ $T'x=DTx''$ divide by DTx: $\frac{T'}{DT}=\frac{x''}{x}$ on the left is a function of time only, on the right is a function of x only. $\frac{T'}{DT}=\frac{x''}{x}=-\lambda$ where $\lambda$ is a constant $x''+\lambda x=0$ $u(t,0)=\cancel{ T(t) } \quad x(0)=0$ $x(0)=x(L)=0$ this is called an eigen value problem. #end of lec 26 #start of lec 27 Recall from last lec: $\frac{ \partial u }{ \partial t }=D \frac{ \partial^2 u }{ \partial x^2 }, \quad 0\leq x\leq L, \quad t>0$ boundary conditions: $u(t,0)=u(t,L)=0 , \quad t>0$ (simple case) $u(0,x)=f(x) , \quad 0\leq x\leq L$ This is an IBVP $\frac{T'}{DT}=\frac{x''}{x}=-\lambda$ $x''+\lambda x=0$ (called an eigen value problem on a second derivative operator) $x(0)=x(L)=0$ its an eigen value problem because lambda is not fixed, it can be any number. recall in linear algebra $Ax+\lambda x=0$ where A is a matrix eigen is a germanic word meaning intrinsic, important (i)$\lambda<0$ $r^2+\lambda=0 \implies r_{1,2}=\pm \sqrt{ -\lambda }$ $X(x)=c_{1}e^{\sqrt{ -\lambda }x}+c_{2}^{-\sqrt{ -\lambda }x}$ but we have a boundary condition: $c_{1}+c_{2}=0$ $X(L)=c_{1}e^{\sqrt{ -\lambda }L}+c_{2}^{-\sqrt{ -\lambda }L}=0$ this has a solution, as the determinant $\ne 0$ the solution is $c_{1}=0,\ c_{2}=0$ which gives $X(x)=0$ for all $x\in[0,L]$ very boring solution! other option: (ii) $\lambda=0$ $x''=0$ integrate both sides twice: $X(x)=c_{1}x+c_{2}$ boundary conditions: $X(0)=0\implies c_{2}=0$ $X(L)=0=c_{1}L \implies c_{1}=0$ again a boring solution! $X(x)=0$ this is called a trivial solution. We are looking for non-trival solutions. try the last other possible case: (iii) $\lambda>0$ $r_{1,2}=\pm \sqrt{ \lambda }i$ $X(x)=c_{1}\cos(\sqrt{ \lambda }x)+c_{2}\sin(\sqrt{ \lambda }x)$ boundary conditions: $X(0)=0\implies c_{1}=0$ $X(L)=0 \implies c_{2}\sin(\sqrt{ \lambda }L)=0$ if you take $c_{2}=0$ you lose, another boring solution. but if $\sin(\sqrt{ \lambda }L)=0 \implies \sqrt{ \lambda }L=n\pi$ where $n=1,2,3,\dots$ notice that $n\ne 0$ becuase that implies lambda=0 but lambda is >0 so that cant be. $\lambda_{n}=\frac{n\pi}{L}$ $X_{n}(x)=c_{2}\sin(\sqrt{ \lambda }x)=\sin\left( \frac{n\pi}{L}x \right)$ this is an eigen function. It's the only non-trivial solution. lets go back to the problem: $\frac{T'}{DT}=\frac{x''}{x}=-\lambda$ $\frac{T'}{T}=-\left( \frac{n\pi}{L} \right)^2D$ this is a separable equation. $T_{n}(t)=c_{n}e^{-(n\pi/2)^2Dt}$ you might have thought you could forget the material before the midterm to make more space in your brain, your brains are a lot more emptier than mine, mine is filled with garbage [...] so don't forget anything you learned before the midterm! you'll see that as you continue in education, you'll see a lot of completely new things and you'll have to find shortcuts and tricks to make the content fit what you already know. okay enough with life stuff, back to mathematics: $\implies u_{n}(t,x)=c_{n}e^{-(n\pi/2)^2Dt}\sin\left( \frac{n\pi x}{L} \right)$ $n=1,2,3,\dots$ applying superposition (sum of any solutions is also a solution) $u(t,x)=\sum_{n=1}^\infty c_{n}e^{-(n\pi/L)^2Dt}\sin\left( \frac{n\pi x}{L} \right)$ this is the most general form of the solution. $u(0,x)=f(x)=\sum_{n=1}^\infty c_{n}\sin\left( \frac{n\pi x}{L} \right),\ 0\leq x\leq L$ we have never seen anything like this before, an infinite number of sin terms added together, usually its polynonmials we sum. this is when fourier (?) steps in. he proved that you can represent various functions as a sum of sines. fun stories about pioncre and cauchy euler: cauchy euler was an engineer, and pioncre had his theorem released around 2008 and it was really long, like 400 pages, he posted it online and asked if anyone wanted to prove it, after a while 4-5 or so mathematicians checked his proof and said, yep okay the proof looks correct. His theorem has a lot to do with the material world. f doesn't even have to be analytic in order for it to be expressed as a sum of sines. take $f(x)=\sin(x)$ and $L=\pi$ can we pick the coefficients $c_{n}$ to make the expressian above true? of course $c_{1}=1$ and all the other coefficients equals 0 done with class! more history time: why is this important? in 1979 a team of engineers and mathematicians from a company philips they discovered, or practically implemented: that an audio signal has billions of datapoints over time if you represent it as a fourier seriers, and truncate some of the coeffecients we can represent many signals really well. which condenses down the data to just a handful of coefficients this is how EQ's are made too to filter out noise, just set the c_n of the frequencies you dont want to 0 so philips used math, math that is simillar to what we are discussing in the lecture, to make a digital record, the first digital cd. Not only that but fourier series are used for image and video compression as well, although they often use a sum of wavelets instead of a sum of trigonometric functions. #end of lec 27 reading week #start of lec 28 (Nov 20) $y''-2y'+\lambda y=0 \qquad y(0)=0, \quad y'(\pi)+y(\pi)=0$ eigen value problem, find $\lambda$ such that the initial conditions are true. find the characteristic polynomial. $r^2-2r+\lambda=0$ $r_{1,2}=\frac{2\pm \sqrt{ 4-4\lambda }}{2}=1\pm \sqrt{ 1-\lambda }$ case 1: $1-\lambda>0$ $y(x)=c_{1}e^{(1+\sqrt{ 1-\lambda })x}+c_{2}e^{ (1-\sqrt{ 1-\lambda })x }$ $y(0)=0=c_{1}+c_{2}$ $c_{1}(1+\sqrt{ 1-\lambda })e^{(1+\sqrt{ 1-\lambda })\pi}+c_{2}(1-\sqrt{ 1-\lambda })e^{ (1-\sqrt{ 1-\lambda })\pi }+c_{1}e^{(1+\sqrt{ 1-\lambda })\pi}+c_{2}e^{ (1-\sqrt{ 1-\lambda })\pi }=0$ $-c_{2}(1+\sqrt{ 1-\lambda })e^{(1+\sqrt{ 1-\lambda })\pi}+c_{2}(1-\sqrt{ 1-\lambda })e^{ (1-\sqrt{ 1-\lambda })\pi }-c_{2}e^{(1+\sqrt{ 1-\lambda })\pi}+c_{2}e^{ (1-\sqrt{ 1-\lambda })\pi }=0$ $c_{2}=0=c_{1}$ boring solution :( (also called a trivial solution) case 2: $1-\lambda=0$ $y(x)=c_{1}e^x+c_{2}xe^x$ $y(0)=0=c_{1}$ $y'(\pi)+y(\pi)=c_{2}(\pi e^\pi+e^\pi+\pi e^\pi)=0 \implies c_{2}=0$ (same trivial solution.) case 3: $1-\lambda<0$ $r_{1,2}=1\pm i\sqrt{\lambda-1}$ $y(x)=e^x(c_{1}\cos(\sqrt{ \lambda-1 }x)+c_{2}\sin(\sqrt{ \lambda-1 }x))$ $y(0)=0=c_{1}$ $y(x)=c_{2}e^x\sin \sqrt{ \lambda-1 }x$ $y'(\pi)+y(\pi)=0=c_{2}(e^\pi \sin \sqrt{ \lambda-1 }\pi+e^\pi \cos( \sqrt{ x-1 }\pi)\sqrt{ \lambda-1 })+c_{2}e^\pi \sin \sqrt{ \lambda-1 }\pi$ $$2\sin(\sqrt{ \lambda-1 }\pi)-\sqrt{ \lambda-1 }\cos(\sqrt{ \lambda-1 }\pi)=0$$ This is a transcendental equation, non algebraic, cannot be solved explicitly. Only option we have is to approximate the eigen values. there are an infinite number of them. We have to use software in order to obtain a finite number of approximations. I like software, software is good, as long as your being mindful of how you're using it. "engineers over design things." first they use software and add a 50%, sometimes 300% margin on it. But if your using that big of a margin I can just tell you how far you need to build your house away from the river. -Prof We are done.