← Main book chapter 12
Contents / index
Browser back
← Previous chapter
Next chapter →
Laboratory
Memory
Cards
Sort
Match
Visuals
Coding
Quiz
Programming practice
Explicit heat step — Chapter 12
Fix the heat equation update so it uses old-time values.
Language:
JavaScript
Student code
for(let i=1;i<N-1;i++){ u[i] = u[i] + mu*(u[i-1]-2*u[i]+u[i+1]); }
Check code
Show corrected code
Reset buggy code
Feedback
Corrected code