# Understanding a basic scheme for the heat equation

I'm studying the parabolic PDE

$$\begin{cases} v_{xx} = c v_t, & x \in (0,1), t > 0 \\ v(x,0)=f(x)\\v(0,t)=a(t)\\v(1,t)=b(t)\\f(0)=a(0), f(1)=b(0) \end{cases}$$

Using Taylor approximation we have

$$u_k^n = u_{k}^{n-1} + \rho( u_{k+1}^n - 2 u_k^n + u_{k-1}^n )$$ where $$u_k^n = v(k \Delta x, n \Delta t )$$. and $$\rho = \dfrac{ c \Delta t }{\Delta x^2}$$.

If we are given that $$a=b=0$$ and $$\Delta t = 0.02$$ and to take $$10$$ nodal points.

So, I know I will have $$x_0, x_1, ..., x_{10}$$. My question is, how do we tell how many time steps to take? Do I need to choose this?

Say I'm given to find the solution at $$t = 0.06$$, then I would have to take $$n=3$$ so this means that we only want to compute

$$u_k^3 = u_k^{2} + \rho( u_{k+1}^2 - 2u_k^2 + u_{k-1}^2 )$$

and this equation would determine my solution for this time $$t=0.06$$, say if I want to find out the value of $$v(0.5, 0.06)$$, then in my scheme I would look for

$$u_5^3 = u( 5 \Delta x, 3 \Delta t )$$

Is this correct interpretation? apologies is this question sounds really stupid, but Im learning this for the first time and I just want to understand the concept.

Short answer: you’re correct. There is the time interval of interest or the final time moment (0.06 in your case) and there is a numerical scheme. Since the scheme is discrete in its nature, you have two parameters for it, space and time steps ($$h$$ and $$\tau$$). Usually, their values are chosen as dictated by accuracy and stability properties of the scheme (which together give the property of convergence). Sometimes, of course, more subtle properties are taken into account. In your case, the scheme is absolutely stable and thus has no stability restriction. So, in general you’re free to choose any $$h$$ and $$\tau$$ which allow you to compute the solution at the required point. Unless someone fixes their values as it is done by the problem formulation in your case.