Looping the root function
Looping the root function
(OP)
Hi,
I want to find and save the root of a function, make a small change to a parameter in the function and find the new root.
I defined the parameter over an interval, but MathCAD's root function doesn't like this (I get a message that says root only works with matrices or scalars), though there are no errors if I define the parameter with only one value.
I also tried using a for loop to evaluate the root, but MathCAD doesn't give either an output or an error, nothing happens.
Is there another way to go about this?
Thanks!
I want to find and save the root of a function, make a small change to a parameter in the function and find the new root.
I defined the parameter over an interval, but MathCAD's root function doesn't like this (I get a message that says root only works with matrices or scalars), though there are no errors if I define the parameter with only one value.
I also tried using a for loop to evaluate the root, but MathCAD doesn't give either an output or an error, nothing happens.
Is there another way to go about this?
Thanks!





RE: Looping the root function
Regards
Mike
RE: Looping the root function
I am actually now getting an error saying that the variable which I chose to be the argument in my function is undefined.
thanks
RE: Looping the root function
>> Your construct of k.nd is interesting, but not necessary. Do:
i:0,1;10
k.nd[i:i/10
this will create an indexed variable k.nd
Also, you need to define beta.nd somewhere near the top of the sheet.
Then, you do
r0[i:root(f(beta.nd,k.nd[i),beta.nd)
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Looping the root function
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
RE: Looping the root function
Since I beta.nd was the argument to my function, I thought it did not have to be defined
RE: Looping the root function
TTFN
FAQ731-376: Eng-Tips.com Forum Policies