Now I'm really scared, Mathcad desn't use the variables I've defined before the routine?
Not, if a local variable with the same name exist. It will take the "nearest" variable it finds.
Thats pretty much the same behaviour as with most programming languages
While in some programming languages you can explicitely specify the variable from which context you want to address, in Mathcad thats not possible.
But the solution is simple - just use different variable names.
One thing I haven't mentioned so far is that its inefficient to do the calculation of E.D inside the loop. As far as I can see its not dependent on anything which changes in the iteration so it should be precalculated outside of the loop, maybe even outside of the program.
awesome, absolutely right
Really!?? That way the first two components of the 3x1 vectors Fi.. never change - as the WS is written they remain zero.
The code would first copy Fi over to Fi+1 making sure that way, that Fi+1 is a 3x1 vector. Then the third component of this nev vector is changed for the scalar calculated according to your pic.