Added July 6, 2019 Solve the heat equation for \(x>0,t>0\)
The boundary conditions are \(u(0,t)=A\) and initial conditions \(u(x,0)=0\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == A; ic = u[x, 0] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {k>0,x > 0,t>0}], 60*10]];
Maple ✓
restart; interface(showassumed=0); pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=0; bc := u(0,t)=A; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming k>0,x>0,t>0),output='realtime'));
Hand solution
Solving
And \(u\left ( x,t\right ) <\infty \) as \(x\rightarrow \infty \). This means \(u\left ( x,t\right ) \) is bounded. This conditions is always needed to solve these problems.
Let \(U\left ( x,s\right ) \) be the Laplace transform of \(u\left ( x,t\right ) \). Defined as
Applying Laplace transform to the original PDE (1) gives
But \(u\left ( x,0\right ) =0\), therefore the above becomes
The solution to this differential equation is
Since \(u\left ( x,t\right ) \) is bounded in the limit as \(x\rightarrow \infty \) and \(k>0\), therefore it must be that \(c_{1}=0\) to keep the solution bounded. The above simplifies to
At \(x=0\,,u\left ( 0,t\right ) =A\). Therefore \(U\left ( 0,s\right ) =\mathcal {L}\left ( u\left ( 0,t\right ) \right ) =\mathcal {L}\left ( A\right ) =\frac {1}{s}A\). Hence at \(x=0\) the above gives
Therefore (2) becomes
From tables, the inverse Laplace transform of the above is (since \(x>0,k>0\))
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added July 6, 2019 Solve the heat equation for \(x>0,t>0\)
The boundary conditions are \(u(0,t)=A\) and initial conditions \(u(x,0)=0\), using
Mathematica ✓
ClearAll["Global`*"]; k=1/10; A=60; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == A; ic = u[x, 0] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}], 60*10]];
Maple ✓
restart; k:=1/10; A:=60; pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=0; bc := u(0,t)=A; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming x>0),output='realtime'));
Hand solution
Solving on semi-infinite domain
With \(A=60,k=\frac {1}{10}\)
The general problem above was solved in 3.1.6.1 on page 679 and the solution is
Substituting the specific values given above into this solution gives
Animation is below
Source code used for the above
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
This is problem at page 76 from David J Logan text book.
Solve the heat equation for \(x>0,t>0\)
The boundary conditions are \(u(0,t)=f(t)\) and initial conditions \(u(x,0)=0\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == f[t]; ic = u[x, 0] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, x > 0,k>0}], 60*10]]; sol = sol /. {K[2] -> z}
Maple ✓
restart; interface(showassumed=0); pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=0; bc := u(0,t)=f(t); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming t>0,x>0,k>0),output='realtime'));
Hand solution
Solving on semi-infinite domain
With \(k>0\) and \(u\left ( x,t\right ) <\infty \) as \(x\rightarrow \infty \). This means \(u\left ( x,t\right ) \) is bounded. This conditions is always needed to solve these problems.
Let \(U\left ( x,s\right ) \) be the Laplace transform of \(u\left ( x,t\right ) \). Defined as
Applying Laplace transform to the original PDE (1) gives
But \(u\left ( x,0\right ) =0\), therefore the above becomes
The solution to this differential equation is
Since \(u\left ( x,t\right ) \) is bounded in the limit as \(x\rightarrow \infty \) and \(k>0\), therefore it must be that \(c_{1}=0\) to keep the solution bounded. The above simplifies to
At \(x=0\,,u\left ( 0,t\right ) =f\left ( t\right ) \). Therefore \(U\left ( 0,s\right ) =\mathcal {L}\left ( f\left ( t\right ) \right ) =F\left ( s\right ) \). Hence at \(x=0\) the above gives
Therefore (2) becomes
By convolution, the above becomes
Where \(G\left ( x,t\right ) \) is the inverse transform of \(e^{-\sqrt {\frac {s}{k}}x}\) which is \(\frac {xe^{\frac {-x^{2}}{4kt}}}{2\sqrt {k\pi }t^{\frac {3}{2}}}\). Hence (4) becomes
For \(k=1\)
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added July 7, 2019 Solve the heat equation for \(x>0,t>0\)
The boundary conditions are \(u(0,t)=\sin (t)\) and initial conditions \(u(x,0)=0\) using \(k=\frac {1}{10}\)
Mathematica ✓
ClearAll["Global`*"]; k=1/10; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == Sin[t]; ic = u[x, 0] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, x > 0}], 60*10]];
Maple ✓
restart; interface(showassumed=0); k:=1/10; pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=0; bc := u(0,t)=sin(t); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t)) assuming t>0,x>0),output='realtime'));
Hand solution
Solving
Using \(k=\frac {1}{10}\) and \(f\left ( t\right ) =\sin \left ( t\right ) \).
The general solution was solved in problem 3.1.6.3 on page 691 and the solution was found to be
Replacing the given values above, the solution becomes
We could also use the following form of the solution
Animation is below
Source code used for the above
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Solve the heat equation
For \(x>0\) and \(t>0\). The boundary conditions is \(u(0,t)=1\) and And initial condition \(u(x,0)=0\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == 1; ic = u[x, 0] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, k > 0, x > 0}], 60*10]];
Maple ✓
restart; interface(showassumed=0); pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=0: bc := u(0,t)=1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t),HINT = boundedseries) assuming t>0,x>0,k>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added December 20, 2018.
Solve the heat equation for \(u(x,t)\)
With initial condition
And boundary conditions
For \(x>|x_0|\) and \(t>|t_0|\).
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == (1/4)*D[u[x, t], {x, 2}]; bc = u[-x0, t] == 0; ic = u[x, t0] == 10; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], x, t, Assumptions -> {t > Abs[t0], x > Abs[x0]}], 60*10]];
Maple ✓
restart; pde := diff(u(x, t), t) = (1/4)*(diff(u(x, t), x$2)); bc := u(-x0, t) = 0; ic := u(x, t0) = 10; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde, bc,ic],u(x,t)) assuming x>abs(x0), t>abs(t0)),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Solve the heat equation
For \(x>0\) and \(t>0\). The boundary conditions is \(u(0,t)=\mu \) and And initial condition \(u(x,0)=\lambda \)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; bc = u[0, t] == lambda; ic = u[x, 0] == mu; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, bc, ic}, u[x, t], {x, t}, Assumptions -> {t > 0, k > 0, x > 0}], 60*10]];
Maple ✓
restart; interface(showassumed=0); pde := diff(u(x,t),t)=k*diff(u(x,t),x$2); ic := u(x,0)=mu: bc := u(0,t)=lambda; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde,ic,bc],u(x,t),HINT = boundedseries) assuming t>0,x>0,k>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
From Mathematica DSolve help pages. Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\)
With initial condition
And boundary conditions
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == D[u[x, t], {x, 2}]; ic = u[x, 0] == Cos[x]; bc = u[0, t] == 1; sol = AbsoluteTiming[TimeConstrained[FullSimplify[DSolve[{pde, ic, bc}, u[x, t], {x, t}]], 60*10]];
Maple ✓
restart; pde := diff(u(x, t), t)=diff(u(x, t), x$2); ic := u(x,0)=cos(x); bc := u(0,t)=1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t)) assuming t>0 and x>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\)
With initial condition
And boundary conditions \(u(0,t)=t\). Solution is bounded at infinity.
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == k*D[u[x, t], {x, 2}]; ic = u[x, 0] == 0; bc = u[0, t] == t; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {k > 0, x > 0, t > 0}], 60*10]];
Maple ✓
restart; interface(showassumed=0); pde := diff(u(x, t), t)=k*diff(u(x, t), x$2); ic := u(x,0)=0; bc := u(0,t)=t; assume(x>0); assume(t>0); assume(k>0); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t))),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
From Mathematica DSolve help pages. Solve the heat equation for \(u(x,t)\) on half the line \(x>0\) and \(t>0\)
With initial condition
And boundary conditions
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == D[u[x, t], {x, 2}]; ic = u[x, 0] == UnitTriangle[x - 3]; bc = Derivative[1, 0][u][0, t] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}], 60*10]];
Maple ✓
restart; pde := diff(u(x, t), t)=diff(u(x, t), x$2); ic := u(x,0)=piecewise( x>2 and x<3,-2+x, x>3 and x<4, 4-x, 0); bc:=(D[1](u))(0,t)=0; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t)) assuming t>0 and x>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added December 20, 2018.
Solve for \(u(x,t)\) for \(t>0,x>0\)
With initial condition
And boundary conditions
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == (1*D[u[x, t], {x, 2}])/4; ic = u[x, t0] == 10*Exp[-x^2]; bc = Derivative[1, 0][u][x0, t] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {x > 0, t > 0}], 60*10]];
Maple ✓
restart; pde := diff(u(x, t), t) = 1/4*(diff(u(x, t), x$2)); bc := eval( diff(u(x,t),x),x=x0)=0; ic := u(x,t0)=10*exp(-x^2); cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde, bc,ic],u(x,t)) assuming x>0,t>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added April 5, 2019.
Solve for \(u(x,t)\) in
For \(t>0,x>0\). With boundary conditions \(u(0,t)=0\) and intitial conditions \(u(x,0)=f(x)\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == D[u[x, t], {x, 2}] - D[u[x, t], x]; ic = u[x, 0] == f[x]; bc = u[0, t] == 0; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde, ic, bc}, u[x, t], {x, t}, Assumptions -> {x > 0, t > 0}], 60*10]];
Maple ✓
restart; pde := diff(u(x,t),t)=diff(u(x,t),x$2)- diff(u(x,t),x); ic := u(x,0)=f(x); bc := u(0,t)=0; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol', pdsolve([pde, ic, bc], u(x, t))assuming t>0,x>0),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Added May 23, 2019.
From Math 5587 midterm I, Fall 2016, practice exam, problem 13.
Solve for \(u(x,t)\) with IC \(u(x,0)=x^2+1\) and BC \(u_t(0,t)=1\) for \(x>0,t>0\)
Mathematica ✓
ClearAll["Global`*"]; pde = D[u[x, t], t] == D[u[x,t],{x,2}]; ic = u[x,0]==x^2+1; bc = u[0,t]==1; sol = AbsoluteTiming[TimeConstrained[DSolve[{pde,ic,bc}, u[x, t], {x, t}], 60*10]];
Maple ✓
restart; pde := diff(u(x,t),t)= diff(u(x,t),x$2); ic := u(x,0)=x^2+1; bc :=u(0,t)=1; cpu_time := timelimit(60*10,CodeTools[Usage](assign('sol',pdsolve([pde,ic,bc],u(x,t))),output='realtime'));
___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________