Lecture 6 Solutions to PDEs over Bounded and...
Transcript of Lecture 6 Solutions to PDEs over Bounded and...
![Page 1: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/1.jpg)
BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs over Bounded and Unbounded Domains References Haberman APDE, Ch. 2. Haberman APDE, Ch. 3. Haberman APDE, Ch. 10.
![Page 2: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/2.jpg)
![Page 3: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/3.jpg)
![Page 4: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/4.jpg)
![Page 5: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/5.jpg)
![Page 6: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/6.jpg)
![Page 7: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/7.jpg)
![Page 8: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/8.jpg)
![Page 9: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/9.jpg)
![Page 10: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/10.jpg)
![Page 11: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/11.jpg)
![Page 12: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/12.jpg)
![Page 13: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/13.jpg)
![Page 14: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/14.jpg)
![Page 15: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/15.jpg)
![Page 16: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/16.jpg)
![Page 17: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/17.jpg)
![Page 18: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/18.jpg)
![Page 19: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/19.jpg)
function linanal(ns)% Homogeneous PDE: Linear (1 D) Diffusion% Analytical solutions on bounded and infinite domain% BENG 221 example, 10/8/2013%% ns: number of terms in the infinite series%% e.g.:% >> linanal(30);% % diffusion constantglobal DD = 0.001; % domaindx = 0.02; % step size in x dimensiondt = 0.1; % step size in t dimensionxmesh = 1:dx:1; % domain in x; L/2 = 1tmesh = 0:dt:10; % domain in tnx = length(xmesh); % number of points in x dimensionnt = length(tmesh); % number of points in t dimension % solution on bounded domain using separation of variablessol_sep = zeros(nt, nx);for n = 0:ns 1 k = (2*n+1)*pi/2; % L = 2 sol_sep = sol_sep + exp( D*(k^2)*tmesh)’ * cos(k*xmesh);end figure(1)surf(tmesh,xmesh,sol_sep’)title([’Separation of variables on bounded domain (first ’, num2str(ns), ’ terms in series)’])xlabel(’t’)ylabel(’x’)zlabel(’u(x,t)’) % solution on infinite domain using Fouriersol_inf = (4*pi*D*tmesh’ * ones(1,nx)).^( .5) .* exp( (4*D*tmesh).^( 1)’ * xmesh.^2); figure(2)surf(tmesh,xmesh,sol_inf’)title(’Gaussian solution on infinite domain’)xlabel(’t’)ylabel(’x’)zlabel(’u(x,t)’)
![Page 20: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/20.jpg)
02
46
810
1
0.5
0
0.5
12
1
0
1
2
3
4
5
t
Separation of variables on bounded domain (first 5 terms in series)
x
u(x,
t)
![Page 21: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/21.jpg)
02
46
810
1
0.5
0
0.5
15
0
5
10
15
20
25
30
t
Separation of variables on bounded domain (first 30 terms in series)
x
u(x,
t)
![Page 22: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/22.jpg)
02
46
810
1
0.5
0
0.5
10
5
10
15
20
25
30
t
Gaussian solution on infinite domain
x
u(x,
t)
![Page 23: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/23.jpg)
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 110
5
0
5
10
15
20
25
30
x
u(x,
0)
Gibbs phenomenon in truncated series expansion: t=0
![Page 24: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/24.jpg)
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 11
0
1
2
3
4
5
6
7
8
9
x
u(x,
1)
Gibbs phenomenon in truncated series expansion: t=1
![Page 25: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/25.jpg)
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 11
0
1
2
3
4
5
6
x
u(x,
3)
Gibbs phenomenon in truncated series expansion: t=3
![Page 26: Lecture 6 Solutions to PDEs over Bounded and …isn.ucsd.edu/courses/beng221/lectures/beng221-lecture6...BENG 221: Mathematical Methods in Bioengineering Lecture 6 Solutions to PDEs](https://reader031.fdocuments.us/reader031/viewer/2022022607/5b84c7557f8b9aef498d00af/html5/thumbnails/26.jpg)
1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 10.5
0
0.5
1
1.5
2
2.5
3
x
u(x,
10)
Gibbs phenomenon in truncated series expansion: t=10