ChrMeissner
Mechanical
- Jan 31, 2005
- 21
Hi!
I wrote some big programs to describe the dynamical behavior of cars using matrices with submatrices, that means one entry of the matrix is another matrix (e.g. shown in the result as A=([3,1] [3,3] [12,4]). So far this way. I also take references to functions defined in other files using MathCAD 2001.
The mainprogram has NO inputvariables (all values are defined in the program itself), references subroutines and give back a matrix, including the actual position and velocity of the car in vectorial notation.
When I let calculate this program more then one time, the result changes from time to time (not only the values but also the dimension of the submatrices) even NO extern variable hast changed.
May it be, that matrices in programs are intern allocated by pointers (as I know from C++)? May it be, that the variables (especially matrices) aren't realy LOCAL (that means if yo change them in a procedure, a variable with the same name outside this procedure wouldn't be changed)? How can I inhibit this (recalculate the whole worksheet doesn't work)?
Here an example for swaping the order of vectors:
I know, this is a quite hard question, but has anybody an idea?
Christian M. (TU-Chemnitz, Germany)
I wrote some big programs to describe the dynamical behavior of cars using matrices with submatrices, that means one entry of the matrix is another matrix (e.g. shown in the result as A=([3,1] [3,3] [12,4]). So far this way. I also take references to functions defined in other files using MathCAD 2001.
The mainprogram has NO inputvariables (all values are defined in the program itself), references subroutines and give back a matrix, including the actual position and velocity of the car in vectorial notation.
When I let calculate this program more then one time, the result changes from time to time (not only the values but also the dimension of the submatrices) even NO extern variable hast changed.
May it be, that matrices in programs are intern allocated by pointers (as I know from C++)? May it be, that the variables (especially matrices) aren't realy LOCAL (that means if yo change them in a procedure, a variable with the same name outside this procedure wouldn't be changed)? How can I inhibit this (recalculate the whole worksheet doesn't work)?
Here an example for swaping the order of vectors:
I know, this is a quite hard question, but has anybody an idea?
Christian M. (TU-Chemnitz, Germany)