Omniadisce

Computational physics 14.2: The rod as an array

Lesson Beginner

Join free to take this lesson

Anyone can look around, but taking a lesson needs a free account. With one, your answers are checked step by step and your progress is saved, so you can stop and pick up where you left off on any device.

11 steps ยท about 30 min

By the end you can

  • Make an array of n temperatures with np.full(n, 20.0)
  • Change one element: T[0] = 100, T[-1] = 0
  • Take a slice: T[1:4], T[1:-1], T[2:], T[:-2]
  • Line up every inner piece with its left and right neighbours

Who it is for: Anyone who has done lesson 14.1, and unit 4 of this course (arrays).

The steps

  1. A row of temperatures
  2. How long is a piece?
  3. Change one element
  4. Hot end, cold end
  5. Slices
  6. The inner pieces
  7. Every piece and its neighbours
  8. Left neighbour minus piece
  9. The whole bracket
  10. How many?
  11. Why the ends are left out

Discussion 0 comments

Log in to join the discussion.

× Enlarged view