I am trying to run the code but at this section
I get this error. Why?
You use k(q) as an index into the array depsj. An index must be an integer value, so you need to make sure that k(q) is an integer for every value of q you feed to it.
Note that when q is not an integer, chances are high that for at least one value of q, k(q) will not be an integer, due to limited accuracy of numeric values (Mathcad has only about 15 digits of precision...). Making use of the round(), floor() or ceil() functions may help.
Success!
Luc