Question: Maple doesn't evalute multidimensional Arrays in nested loops?

Hi all,

I'm currently writing a code to solve the equations for a gravitational collapse of a star numerically. I'm using two dimensional Arrays for most of the physical quantities in my finite difference equations, with one index for the spatial dimension (I'm only considering spherically symmetric collapses) and one time index. I wrote two nested loops, where the inner one solves the equations from the centre of the star to the surface (with the exception of one quantitiy, where I have to integrate the other way around) and the outer loop advances the Arrays in time. My problem is, that Maple doesn't seems to evaluate the two dimensional Arrays. Instead for inserting the appropriate value for e.g. A[3,2], Maple just keeps on using A[3,2] which messes up some formulas, since I have to take roots of the numbers. At least that is what seems to be going on when I'm trying to debug the relevant part of the code and I check for the values, with whicih Maple calculates. I'm also using a one dimensional Array to store the timesteps, I'm using in the code and Maple doesn't seem to have problems evaluating them. Is anybody familiar with this problem? Does Maple have trouble with multidimensional Arrays in loops or have I just messed up my code? I have uploaded my code (I hope it worked). I apologize for my code being messy, but it's the first time I'm working with Maple and using numerical methods. The part which troubles me is labeled "# actual code".

Thank you all.

Oppenheimer-Snyder_Maple_3.mw

Please Wait...