When I define real numbers and try to use it in an array I get the message that one of the symbols needs to be a real number, They are all real numbers. See attached Mathcad file Example.What am I doing incorrectly?
When I define real numbers and try to use it in an array I get the message that one of the symbols needs to be a real number, They are all real numbers. See attached Mathcad file Example.What am I doing incorrectly?
When I define real numbers and try to use it in an array I get the message that one of the symbols needs to be a real number, They are all real numbers. See attached Mathcad file Example.What am I doing incorrectly?
The main question seems to be "What are you trying to?"
You are right when you say that your array k consists only of real numbers and Mathcad is correct when it moans about k not being a real number. k is NOT a real number, k is an array, a 2 x 5 matrix.
Very interesting implementation, with the introduction of the epsilon, and the mean function.
Also, it seems that you can implement, from there, a general purpose transformation routine. For that, in the while, rows > 2 don't work, but probably can implement an on error statement, for detect when the neccesary rows are not enough for a general transformation T. With more programming tools, like a kind of lasterror function, can catch what error occur evaluating T, but we don't have it.
I am pretty sure that we could implement a more general transformation routine. I would add the transformation function and epsilon as function arguments.
We could also get rid of the mode parameter and default it to 0. That way it would not be necessary to store all intermediate matrices but we would use just 2 (the current and the last one). The transformation function should return two results, the vector and an error number which could be used in the main routine for termination in the while loop, replacing the rows>2 condition. As an alternative the tranform function could simply be written so that the input vector is returned in case the number of rows is to small. The main routine would check if the new vector is equal to the last and stop iteration if thats the case.
I am not sure about the mean function I introduced, though. Probably it would be a better idea to just return the last value in the remaining vector.
I also noticed that it does not help to increase the number n of elements in the initial vector of partial sums and decrease epsilon. The accuracy of the result is not increased. Guess we run into numerical round offs and while it would be possible to evaluate symbolically, calculation time is prohibiting (and right now my Mathcad crashed after increasing n just up to 22).
Werner
Translate
Windchill Satisfaction Survey
Help shape the future of Windchill. Take our 5-minute survey and share your feedback.