# How can solve this partial differential equation (PDE) and plot?

How can plot and solve this partial differential equation in mathematica?

$$K \frac{\partial^2 T}{\partial x^2}- h (T-T_m) = \frac{\partial T}{\partial t}$$

$$Tm = 25$$

$$k= 47$$

$$h= 1.5$$

this equation is for a bar 1 meter long the boundary conditions

$$T(0,t) = 0 °C$$

$$T(L,t) = 0 °C$$

And the initial conditions are

$$T(x,0) = 42 °C$$

And how can solve whit the finite difference method?

I try with this

Ecuacion = D[\[Theta][x, s], x, x] - (h + s)/k \[Theta][x, s] == -(1/ s) (h Ta + 41)

SolED = DSolve[{Ecuacion, \[Theta][0, s] == 0, \[Theta][L, s] == 0}, \[Theta][x, s], x]

• Could you please give us your code so that people can use it to answer your question. Oct 31, 2018 at 23:23
• Yes I put the code in the question Oct 31, 2018 at 23:28

Try this:

Clear[x, Ecuacion, s];

Ecuacion = D[\[Theta][x, s], {x,2}] == -(1/s) (h Ta + 41) + (h + s)/k \[Theta][x, s];
SolED    = DSolve[{Ecuacion, \[Theta][0, s] == 0, \[Theta][L, s] == 0}, \[Theta][x,s], x]
//FullSimplify

(*
The solution is:
{{\[Theta][x, s] -> -((
E^(-((Sqrt[h + s] x)/Sqrt[
k])) (-1 + E^((Sqrt[h + s] x)/Sqrt[
k])) (-E^(((L Sqrt[h + s])/Sqrt[k])) + E^((Sqrt[h + s] x)/Sqrt[
k])) k (41 + h Ta))/((1 + E^((L Sqrt[h + s])/Sqrt[k])) s (h +
s)))}}
*)

• Yes, but when I do the Laplace transfform dont give me a solution. thanks for the answer. Nov 5, 2018 at 20:28
• @Conan: Please post the code you applied so that I can try to answer. Nov 5, 2018 at 20:42
• the code is in my question, what I did was to use Laplace and solve the equation, once the equation was solved I used inverse transform in Mathematica to be able to return to the time domain. Thanks :) Nov 7, 2018 at 21:52
• I try to use this: pde = 47* D[T[x, t], {x, 2}] - D[T[x, t], t] - 47*(T[x, t] - 25) == 0 S2 = NDSolve[{pde, T[0, t] == 0 , T[1.5, t] == 0, T[x, 0] == 42}, T[x, t], {x, t}] Nov 10, 2018 at 17:56
• @Conan: You have a second order differential equation, therefore, you need to give the required first order initial values, otherwise, you system of ODEs will be undetermined. The reason is that the number of equations is less than the number of dependent variables. Nov 10, 2018 at 21:42