added lec 35 and fixed some audio stuff
This commit is contained in:
parent
c3d7ab95f6
commit
541827e168
|
@ -174,7 +174,7 @@ then:
|
|||
$$\bar{f}(x)=\frac{2}{\pi}+\frac{2}{\pi}\sum_{k=1}^\infty\left( \frac{1}{2k+1}-\frac{1}{2k-1} \right)\cos(2k\pi x)$$
|
||||
Even with 10 terms, we get a pretty good approximation:
|
||||
![fouriercosineofsin.png](drawings/fouriercosineofsin.png)
|
||||
Here's a little script I wrote to generate an audible waveform of this Fourier series!
|
||||
Here's a little script that generates an audible waveform of this Fourier series!
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
#start of lec 35
|
||||
last problem of the course which we will finish today.
|
||||
$\frac{ \partial^2 u }{ \partial t^2 }=\frac{ \partial^2 u }{ \partial x^2 }+tx, 0\leq x\leq \pi$ $t>0$
|
||||
thats a driven wave equation. tx is the source term.
|
||||
$u(0,t)=u(\pi,t)=0 \quad t>0$
|
||||
$u(x,0)=\sin(x) \quad 0\leq x\leq \pi$
|
||||
$\frac{ \partial u }{ \partial t }(x,0)=5\sin(2x)-3\sin(5x)\quad 0\leq x\leq \pi$
|
||||
if any of the boundary conditions are non zero, then we have to split(?) into X and T.
|
||||
in this case there's a $\sin(x)$ term so its a nonhomogenous equation (?)
|
||||
|
||||
when $tx$ wasn't there in last problem we had the solution:
|
||||
$u(t,x)=\sum_{n=1}^\infty \underbrace{ (a_{n}\cos(nt)+b_{n}\sin(nt)) }_{ u_{n}(t) }\sin(nt)$ notice $L=\pi$
|
||||
if we expand $tx$:
|
||||
$tx=\sum_{n=1}^\infty h_{n}\sin(nx)$ (this is called a formal expansion, the two arent exactly equal due to the discontinuouity in tx.)
|
||||
$h_{n}=\frac{2}{\pi}\int _{0} ^\pi tx\sin(nx)\, dx$
|
||||
![draw](drawings/2023-12-06-13.14.28.excalidraw.png)
|
||||
|
||||
continuous between 0 and pi but on the edge ponts, the foureir sin series will converge to the midpoint of the two edge points.
|
||||
$h_{n}=\frac{2t}{\pi}\int _{0}^\pi x\sin(nx)\, dx=- \frac{2t}{\pi n}\left( x\cos(nx)|_{0}^\pi-\int _{0}^\pi \cancel{ \cos(nx) }\, dx \right)$
|
||||
$h_{n(t)}=\frac{2t}{n}(-1)^{n+1}$
|
||||
$h(x,t)=tx=\sum_{n=1}^\infty h_{n}\sin(nx)=\sum_{n=1}^\infty \frac{2t}{n}(-1)^{n+1}\sin(nx)$
|
||||
$\frac{ \partial^2 u }{ \partial t^2 }=\sum_{n=1}^\infty u_{n}''(t)\sin(nx)$
|
||||
$\frac{ \partial^2 u }{ \partial x^2 }=\sum_{n=1}^\infty -u_{n}(t)n^2\sin(nx)$
|
||||
$\sum_{n=1}^\infty \underbrace{ \left( u_{n}''+n^2u_{n}+\frac{2t}{n}(-1)^n \right) }_{ =0 }\sin(nx)=0$
|
||||
$u''_{n}+n^2u_{n}=\frac{2}{n}(-1)^{n+1}t, \quad n=1,2,\dots$
|
||||
use #mouc (or laplace, but that'll take much longer.)
|
||||
characteristic eq:
|
||||
$r^2+n^2=0$
|
||||
$r_{1,2}=\pm in$
|
||||
$u_{n}^h(t)=a_{n}\cos(nt)+b_{n}\sin(nt)$
|
||||
$u_{n}^p(t)=At+B$
|
||||
$B=0$ because there's no constant term on the RHS
|
||||
$A=\frac{2(-1)^{n+1}}{n^3}$
|
||||
$u_{n}(t)=a_{n}\cos(nt)+b_{n}\sin(nt)+\frac{2(-1)^{n+1}}{n^3}t$
|
||||
$u(x,t)=\sum_{n=1}^\infty(a_{n}\cos(nt)+b_{n}\sin(nt)+\frac{2(-1)^{n+1}}{n^3}t)\sin(nx)$
|
||||
This is the last problem I'll be solving in my career. This is the last time he's teaching math 201 :( or any course for that matter.
|
||||
$u(x,0)=\sum_{n=1}^\infty a_{n}\sin(nx)=\sin(x)$
|
||||
$a_{1}=1, \quad a_{k}=0, \quad k=2,3,\dots$
|
||||
*audio recording started*
|
||||
$\frac{ \partial u }{ \partial t }(x,0)=\sum_{n=1}^\infty\left( b_{n}n+\frac{2(-1)^{n+1}}{n^3} \right)\sin(nx)=5\sin(2x)-3\sin(5x)$
|
||||
coefficients =0 if $n\ne_{2},5$
|
||||
$\implies b_{n}=\frac{2}{n^4}(-1)^n, \quad n\ne_{2},5$
|
||||
$b_{2}=\frac{5}{2}+\frac{2(-1)^2}{2^4}$
|
||||
$b_{5}=-\frac{3}{5}+\frac{2(-1)^5}{5^4}$
|
||||
$u(x,t)=\cos(t)\sin(x)+\frac{5}{2}\sin(2t)\sin(2x)-\frac{3}{5}\sin(5t)\sin(5x)+2\sum_{n=1}^\infty \frac{(-1)^{n+1}}{n^3}\left( t-\frac{\sin(nt)}{n} \right)\sin(nx)$
|
||||
finished the solution
|
||||
#end of lec 35
|
||||
|
||||
man I got teary eyed from this lecture.
|
|
@ -26,6 +26,8 @@ I have written these notes for myself, I thought it would be cool to share them.
|
|||
[Separation of variables & Eigen value problems (lec 26-28)](separation-of-variables-eigen-value-problems-lec-26-28.html)
|
||||
[Fourier series (lec 28-29)](fourier-series-lec-28-29.html)
|
||||
[Partial differential equations (lec 30-34)](partial-differential-equations-lec-30-34.html) (raw notes, not reviewed or revised yet.)
|
||||
[Wave equations (lec 35)](wave-equations-lec-35.html) (raw notes, not reviewed or revised yet.)
|
||||
|
||||
</br>
|
||||
[How to solve any DE, a flow chart](Solve-any-DE.png) (Last updated Oct 1st, needs revision. But it gives a nice overview.)
|
||||
[Big LT table (.png)](drawings/bigLTtable.png)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
|
@ -22,7 +22,7 @@ var cspec = document.getElementById('spectrum'),
|
|||
|
||||
sliderFreq.oninput = function() {
|
||||
textFreq.innerHTML=this.value;
|
||||
osc.frequency.value=this.value;
|
||||
osc.frequency.value=this.value/2;
|
||||
}
|
||||
// Update the current slider value (each time you drag the slider handle)
|
||||
slider.oninput = function() {
|
||||
|
@ -43,7 +43,7 @@ slider.oninput = function() {
|
|||
real[2*i] = (2/Math.PI) *( 1/(2*i+1)-1/(2*i-1) );
|
||||
}
|
||||
|
||||
osc.frequency.value = textFreq.innerHTML;
|
||||
osc.frequency.value = textFreq.innerHTML/2;
|
||||
//var imag= new Float32Array([0,0,0,0,0]); // sine
|
||||
//var real = new Float32Array(imag.length); // cos
|
||||
var customWave = context.createPeriodicWave(real, imag); // cos,sine
|
||||
|
@ -181,7 +181,7 @@ function playSound(h){
|
|||
//var real = new Float32Array(imag.length); // cos
|
||||
var customWave = context.createPeriodicWave(real, imag); // cos,sine
|
||||
osc.setPeriodicWave(customWave);
|
||||
osc.frequency.value = textFreq.innerHTML;
|
||||
osc.frequency.value = textFreq.innerHTML/2;
|
||||
osc.connect(masterGain);
|
||||
osc.start();
|
||||
isPlaying = true;
|
||||
|
|
Loading…
Reference in New Issue