MATH3271 - FW03

Assignment 2

Question 1(b)(i)

 > restart;

 > u1:=0.1*sin(2*Pi*x)*cos(2*Pi*t);

 > for i from 0 to 5 do

 > t:=i/10;

 > s||i:=u1;

 > od;

 >

 > plot([s0,s1,s2,s3,s4,s5],x=0..1,colour=black);

 > t:='t';

Question 1(b)(ii)

 > u2:=sin(Pi*x)*sin(Pi*t)/(2*Pi)-8/Pi^3*sum(sin(2*k*Pi*x)*sin(2*k*Pi*t)/(2*k-1)^2/(2*k+1)^2,k=1..10):

 > for i from 0 to 5 do

 > t:=i/10:

 > s||i:=u2:

 > od:

 >

 > plot([s0,s1,s2,s3,s4,s5],x=0..1,colour=black);

 > t:='t';

Question 1 (b)(iii)

 > u3:=-16/Pi*sum(sin((2*k+1)*Pi*x)*cos((2*k+1)*Pi*t)/(2*k-1)/(2*k+1)/(2*k+3), k = 0..10) + 5/6/Pi^3*sum(sin(0.4*n*Pi)*sin(n*Pi*x)*sin(n*Pi*t)/n^3,n=1..10):

 > for i from 0 to 10 do

 > t:=i/20:

 > s[i]:=u3:

 > od:

 >

 > plot([s[j] \$ j = 0..10],x=0..1,colour=black);

 > t:='t';

Question 3(b)(i)

 > u31:=20-10*x+240/Pi^3*sum(sin((2*k+1)*Pi*x)*exp(-(2*k+1)^2*Pi^2*t)/(2*k+1)^3,k=0..10);

 > for i from 0 to 5 do t:=i/20: s[i]:=u31: od:

 > plot([s[j]\$j=0..5],x=0..1,colour=black);

 > t:='t';

Question 3 (b)(ii)

 > u32:=20-30/Pi^2*sum(cos(2*k*Pi*x)*exp(-4*k^2*Pi^2*t)/k^2,k=1..5)+40/Pi^2*sum(cos((2*k+1)*Pi*x)*exp(-(2*k+1)^2*Pi^2*t)/(2*k+1)^2,k=0..5):

 > for i from 0 to 5 do t:=i/20: s[i]:=u32: od:

 > plot([s[j]\$j=0..5],x=0..1,colour=black);

Question 4

 > for i from 1 to 5 do fsolve(tan(x)+x,x,(2*i-1)*Pi/2..(2*i+1)*Pi/2);od;

Question 5 (c)

 > t:='t';

 > u5:=sin(Pi*x)*sin(2*Pi*y)*cos(sqrt(5)*Pi*t);

 > t:=0;

 > plot3d(u5,x=0..1,y=0..1);

 > t:=1/sqrt(20);

 > plot3d(u5,x=0..1,y=0..1);

 > t:=1/2;

 > plot3d(u5,x=0..1,y=0..1);

 >