$"></p><pre class="codeinput">dx = 0.05; dt = 0.001;
T = round(1 / dt);
X = round(1 / dx);
x = 1; t = 1;
M = x * X; N = t * T;
</pre><p>Let <img src="hw_2_6_3_eq06762107967089031058.png" alt="$r = \nu \frac{\Delta t}{\Delta x^2}$"></p><pre class="codeinput">r = nu * dt / dx / dx;
</pre><p>Let <img src="hw_2_6_3_eq03108255636336939824.png" alt="$s = a \frac{\Delta t}{2 \Delta x}$"></p><pre class="codeinput">s = a * dt / dx / 2;
</pre><p>Setting domain and boundary value</p><pre class="codeinput">x_ = 0 : dx 