07-10-2009 07:18 PM
I have a very complicated set of relations that solves for a dependent variable, call it f. It depends on independent variables a,b,c, through several equations. I't like to be able to set b and c and the dependent variable f, and solve for a. More precisely, it want to create a nomograph of f. contours of constant f, for varying a and b for a set c.
So I need to set up a solver routine, but cannot easily solve for derivates of a simple function. Ideas?
Been awhile since I've used newton rhapson or similar. I can numerically calculate a derivate easy enough by a small change in a variable. just cannot solve the relations unless I plug and chug it through mathematica... alot of work.
07-10-2009 07:40 PM
ennis wrote:Been awhile since I've used newton rhapson or similar.
You could start with this very primitive code, which calculates the inverse error function using NR (original discusion). Ideally, you would want to rewrite it so the function is called via reference node for easy re-usability.
Simply replace the forward function in the two places, set a reasonable guess, add some termination condition so it won't iterate forever in pathalogical cases, and you should be all set. 🙂