Example 8.1
| > | restart:with(inttrans):with(plots): |
The governing equation is entered here:
| > |
| > | eq:=diff(u(x,t),t)+v*diff(u(x,t),x); |
| (1) |
The initial and boundary conditions are entered here.
| > | u(x,0):=1; |
| (2) |
| > | bc1:=u(0,t)=0; |
| (3) |
The governing equation and the boundary condition are converted to the Laplace domain:
| > | eqs:=laplace(eq,t,s); |
| (4) |
| > | eqs:=subs(laplace(u(x,t),t,s)=U(x),eqs); |
| (5) |
| > | bc1:=laplace(bc1,t,s); |
| (6) |
| > | bc1:=subs(laplace(u(0,t),t,s)=U(0),bc1); |
| (7) |
| > | U(x):=rhs(dsolve({eqs,bc1},U(x))); |
| (8) |
The solution obtained in the Laplace domain is converted to the time domain here:
| > | u:=invlaplace(U(x),s,t); |
| (9) |
The following plots can be obtained:
| > | plot3d(subs(v=1.,u),x=0..1,t=1e-6..1,axes=boxed,title="Figure Exp. 8.1.",labels=[x,t,"u"],orientation=[-137,50]); |
![]() |
| > | plot([subs(v=1,t=0.1,u),subs(v=1,t=0.25,u),subs(v=1,t=0.5,u),subs(v=1,t=1,u)],x=0..1,axes=boxed,title="Figure Exp. 8.2.",thickness=5,labels=[x,"u"]); |
![]() |
| > |