1
$\begingroup$

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]
$\endgroup$
2
  • $\begingroup$ Could you please give us your code so that people can use it to answer your question. $\endgroup$ Oct 31, 2018 at 23:23
  • 1
    $\begingroup$ Yes I put the code in the question $\endgroup$
    – Conan
    Oct 31, 2018 at 23:28

1 Answer 1

3
$\begingroup$

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)))}}
*)
$\endgroup$
6
  • $\begingroup$ Yes, but when I do the Laplace transfform dont give me a solution. thanks for the answer. $\endgroup$
    – Conan
    Nov 5, 2018 at 20:28
  • $\begingroup$ @Conan: Please post the code you applied so that I can try to answer. $\endgroup$ Nov 5, 2018 at 20:42
  • $\begingroup$ 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 :) $\endgroup$
    – Conan
    Nov 7, 2018 at 21:52
  • $\begingroup$ 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}] $\endgroup$
    – Conan
    Nov 10, 2018 at 17:56
  • $\begingroup$ @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. $\endgroup$ Nov 10, 2018 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.