This is my problem: This is the transient heat transfer problem in 1D.
and this is my code:
I can’t get the analytic solution.
Anyone could help me? Thank you very much!
Workaround:
First we solve PDE only with first two ic’s.
$Version
(*12.1.0 for Microsoft Windows (64-bit) (March 14, 2020)*)
Heat = D[T[y, t], t] - α*D[T[y, t], {y, 2}] == 0;
ic = {T[y, 0] == 0, T[0, t] == 1};
sol = DSolve[{Heat, ic}, T[y, t], {y, t}, Assumptions -> {α > 0, t > 0, y > 0}]
(*{{T[y, t] -> (
y Inactive[Integrate][
E^(-(y^2/(4 t α - 4 α K[2])))/(t - K[2])^(
3/2), {K[2], 0, t}, Assumptions -> True])/(
2 Sqrt[π] Sqrt[α])}}*)
sol // Activate (* Mathematica Can't find Integral ? *)
(*{{T[y, t] -> (
y Inactive[Integrate][
E^(-(y^2/(4 t α - 4 α K[2])))/(t - K[2])^(
3/2), {K[2], 0, t}, Assumptions -> True])/(
2 Sqrt[π] Sqrt[α])}}*)
Workaround to solve integral:
FullSimplify[
InverseMellinTransform[
Integrate[
MellinTransform[(
y E^(-((A*y^2)/(4 t α - 4 α K[2])))/(t - K[2])^(
3/2))/(2 Sqrt[π] Sqrt[α]), A, s], {K[2], 0, t},
Assumptions -> {t > 0, α > 0, y > 0}], s, A] /. A -> 1,
Assumptions -> {t > 0, y > 0, α > 0}] // Expand
(*Erfc[y/(2 Sqrt[t α])]*)
We check if this solution fulfills Boundary Condition T(\infty ,t)=0
Limit[Erfc[y/(2 Sqrt[t α])], y -> Infinity,
Assumptions -> {α > 0, y > 0, t > 0}]
(* 0 *) (*Check OK*)
We check if this solution fulfills Initial Condition T(0 ,t)=1
Limit[Erfc[y/(2 Sqrt[t α])], y -> 0, Assumptions -> {t > 0, α > 0}]
(*1 *)
We check if this solution fulfills Initial Condition T(y ,0)=0
Limit[Erfc[y/(2 Sqrt[t α])], t -> 0, Assumptions -> {y > 0, α > 0}, Direction -> -1]
(* 0 *)
Check if solution is true:
Heat /. {T -> Function[{y, t}, Erfc[y/(2 Sqrt[t α])]]}
(*True*)
Then solution is:
Thank you very much!
In your problem, both boundary conditions are with constant temperature but what is the analytical solution if you have a boundary condition with constant heat flow?
I think this could be done like this
heateq = D[fT[x, t], t] - a D[fT[x, t], x, x]
Do a Laplace-Transformation, giving an ODE for the PDE
fLT = LaplaceTransform[heateq, t, s]
Solve the equivalent ODE
sol = DSolve[-T0 + s fTL[x] - a D[fTL[x], x, x] == 0, fTL[x], x] // Flatten
fT1 = fTL[x] /. sol
The solution must be finite
fT2 = fT1 /. C[1] -> 0
Constant flow of heat at x = 0 gives
c2 = Solve[-a D[fT2, x] == a/s /. x -> 0, C[2]] // Flatten
and
fT4 = fT2 /. c2
Transform back in the x-t-domain
f1xt = FullSimplify[InverseLaplaceTransform[fT4, s, t], x > 0 && t > 0]
and show the result for different times
t1 =.
werte = {a -> .1, k -> .1, T0 -> 2};
f1xtn = f1xt /. werte /. t -> t1
t1 = 100;
Plot[f1xtn, {x, 0, 5}, PlotRange -> {0, 10}]
Info: