Next array element is a function of the previous array element
- January 25, 2012
- 4 replies
- 2357 views
I've reduced an engineering problem down to it's basic form. In this case, I have a repeated series of equations. If there's 10 things being evaluated (the number of "things" is the variable num), then there's 10 equations and 10 unknowns. Each equation has the same form and the solution of the next one is the result of the previous answer (as well as a few other parameters which are mixed in there...these are all assumed constant for this simplified version of what I was trying to do).
So basically, I've been working for a couple hours and reading a few resources and I can't figure out what I'm doing wrong. I tried both recursive and iterative formulations and failed on both. The thing that stumps me is that if this was MATLAB, I would just so something like a for loop where X(i) = aouter(i-1) + ainner(i-1) +X(i-1) and just loop through the i values.
So my troubles might boil down to a few different problems. Maybe I'm confusing ranges/arrays/vectors or maybe I didn't set up the loop properly. At the end, I should be able to print a table where I say "X :=".
Thanks in advance for your help.

