I am trying to work with my final solution but Mathcad is saying the variable is undefined even though it's being defined earlier. I have attached the file. Any help will be really appreciated.
Solved! Go to Solution.
It's not alpha.1, but psi.ini that is undefined.
Mathcad was never superb at locating exact positions of errors.
Define psi.ini, or take it out of the function, if you don't need it, but I guess you have it in because it serves a purpose. Maybe you are mistaken and meant psi.0 ....?
One thing that will help you, is if you take the immediate evaluation off of the end of the definition.
Just define the psi.new function (in terms of K() and the rest), but do NOT put an equals sign at the end.
See if that goes without error. If there are errors in there, solve those first. Then you can evaluate the function.
Thank you for your reply. I was trying to generate a final outcome based on successive increments in an if-else statement but it was saying that it did not converge due to infinite recursion. How will I approach this.
Its in no way clear to me what you are trying to do.
"Lambda" is a vector with just one element - is this whats it supposed to be?
"I" is a vector of a couple of values so what do you expect as outcome of your last function? A vector or a scalar.
Main problem is that n is a range and so the condition n=0 in your function never is true leading to an infinite recursion.
Thank you very much Werner_E. I wanted to be like this.
Hmm - whichever of the two recursive function I provided you are talking of - there is an easier an direct approach for both of them: