Skip to main content
1-Visitor
March 29, 2011
Question

Iterating through a function

  • March 29, 2011
  • 2 replies
  • 5352 views

Why does this not work?

See what is in red in the attached file.

2 replies

19-Tanzanite
March 29, 2011

Renwick Preston wrote:

Why does this not work?

See what is in red in the attached file.

1. Because although you allocated zzi values for i from 100 to 1000, Mathcad automatically created a vector going from 0 to 1000. Because you didn't specify values for i going from 0 to 99 Mathcad set them to zero. Your attempted calculation then threw up a divide by zero error.

2. Better to supply the Mathcad worksheet than a pdf.

Alan

1-Visitor
March 29, 2011

Ok...I changed i to 1..100 and it still doesn't work.

See attached.

19-Tanzanite
March 29, 2011

Renwick Preston wrote:

Ok...I changed i to 1..100 and it still doesn't work.

See attached.

That's because Mathcad starts counting at zero by default. You can change the origin if you want to. If you are only interested in i from 100 nto 1000 and then you could set ORIGIN:=100. (This is possible, but unusual! I often set ORIGIN:=1).

Alan

23-Emerald I
March 29, 2011

What Alan said.

See attached.