> restart;
Exercise 3.5.1 (1) :
> f1:= (x,y)-> 2*x-10*y;
> plot3d( f1(x,y), x=-2..2, y=0..1, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patchcontour);
The black lines in the above plot show the characteristic lines.
>
Exercise 3.5.1 (2) :
> f2:= (x,y)-> (x+3*y)^2 - 2*(x+3*y)+1;
>
> plot3d( f2(x,y), x=-2..2, y=0..1, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patchcontour);
Exercise 3.5.1 (3) :
> f3:= (x,y)-> cos(x+y)*exp(-6*y);
>
> plot3d( f3(x,y), x=-2..2, y=0..1, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patch);
>
Exercise 3.5.1 (4) :
> f4:= (x,y)-> sin(x-4*y)*exp(2*y);
>
> plot3d( f4(x,y), x=-7..7, y=0..1, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patch);
Exercise 3.6.3
>
h:= (x,y)-> piecewise(x<-1-y, 0, -1-y<x and x<1-y and x<y-1 ,0.5*exp(-(x+y)), y-1<x and x<1-y, 0.5*(exp(-(x+y)) + exp(-(x-y))), y-1<x and x > 1-y and x< 1+y, 0.5*exp(-(x-y)), x>1+y, 0);
> plot3d( h(x,y), x=-2..2, y=0..1, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patch);
>
Exercise 3.6.7
>
> u:= (x,y)-> piecewise(x+0.5*y<-Pi, 0, x-0.5*y<-Pi and x+0.5*y> - Pi and x+0.5*y< Pi, -1-cos(x+0.5*y), x-0.5*y>-Pi and x+0.5*y<Pi, cos(x-0.5*y)-cos(x+0.5*y), x-0.5*y>-Pi and x-0.5*y < Pi and x+0.5*y>Pi, 1+cos(x-0.5*y), x-0.5*y>Pi, 0) ;
> plot3d( u(x,y), x=-8..8, y=0..10, labels =[`x`, `time`, `z(x,t)`], axes=FRAMED, style=patch);
>