Please consider the assignment I have uploaded on the picture.

enter image description here

I am confused about the functions $g_L(t)$, $g_R(t)$ and $\eta(x)$. What are they and how do I find them... My question:

Is it possbile to find out how $g_L(t)$, $g_R(t)$ and $\eta(x)$ look like purely based on this formulation?

In order to solve this problem I need to know what the functions look like but unfortunately I don't how to determine the functions.

(EDIT: If those are not given; How can I find suitable function so I can make an numeric implementation?)

I am using the book Finite Difference Methods for Ordinary and Partial Differential equations by LeVeque. In chapter 9 it is presented how to solve the Heat equation but all the methods are based on knowing $g_L(t)$, $g_R(t)$ and $\eta(x)$ beforehand, which means I have overlooked some simple theory about Dirichlet boundary conditions?.

  • $\begingroup$ Those boundary condition and initial condition functions are part of the definition of the specific problem that you are solving. That is, you must know (or be given) these functions in order to have a complete, solvable problem definition. The equations you show above show the general form of a 1D heat transfer problem-- not a specific solvable problem. $\endgroup$ May 12, 2019 at 11:32

1 Answer 1


No, you did not overlook anything. You actually have to know specific

  • $g_L(t)$ - boundary condition at the left boundary ($x=-1$)
  • $g_R(t)$ - boundary condition at the right boundary ($x=1$)
  • $\eta(x)$ - initial condition at $t=0$

So, depending on what those functions are, you will get different solutions. The assignment is just given in general terms. When you would be asked to do a numerical implementation, you will be either given those boundary conditions, or you will come up with your own selection.

One simple choice would be to keep outer boundaries at a constant temperature: $$ g_L(t)=g_R(t) = T $$ and make the initial temperature at all the interior of the problem $T_0\neq T$, except the boundaries (to not contradict the boundary conditions above): $$ \eta(x) = \begin{cases} T_0,&x\in(-1,1),\\ T, &x\in \{-1,1\} \end{cases} $$

Then, you start with two "walls" kept at a constant temperature of $T$, and with time, your domain should reach the equilibrium state from $T_0$ to $T$.

  • $\begingroup$ My problem is that this is information is all I have. LeVeque's book does not really provide information on how to come up with those condition. I have now edited my question $\endgroup$
    – k.dkhk
    May 12, 2019 at 12:38
  • $\begingroup$ @k.dkhk I updated the answer with a sample setup. $\endgroup$
    – Anton Menshov
    May 12, 2019 at 12:50
  • $\begingroup$ Thanks! I did implement FTCS and got decent results $\endgroup$
    – k.dkhk
    May 12, 2019 at 14:33

Your Answer

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

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