i think this question has come up before, but i couldn't find it in a search. i'm solving a nonlinear equation, with the solution dependent on a parameter, using a solve block (this seems rather more robust that the root function). for various ranges of the parameter, whether mcad finds a solution or not depends sensitively on the initial guess (it might even find the wrong solution, since the problem may have multiple solutions). i have even tried the various different algorithms offered in mcad. since i have some idea of the solution, i suspect that i can tailor my initial guess to the value of the varying parameter. but is it possible to do so directly (or indirectly)?
i found a workaround to my initial problem (basically through problem reformulation), but i'm interested in tom's comments, since it might prove useful in other contexts. i'm not quite sure i understand what tom is suggesting. i've attached a simplified extract of my initial problem. as it stands, for a value of my parameter, Q = 20 cfs, mathcad finds no solution for my initial guess y=2.9 ft. if i use a different initial guess, say y=2ft, it does find a solution for this particular Q. For this simple problem, one would simply choose a different initial value. but since it is part of a larger problem, in which a range of values of Q are generated, it will get stuck on one or two values. what i would like is to choose my initial guess depending on the value of Q.
tom, could you please give more details of your suggestion if you think that it addresses the above problem?
I don't get the failures you describe. But with some guess values it tends to find the trivial solution with y1=y2, or even an alternative negative solution. But with a high guess value it seems to find the desired solution over a wide range of Q.
Yes, this file is a bit different, and now the variation in the quess value does make a difference. But the structure is the same. Since you already set up the find as a function, parameterizing Q, all that is needed is to add a parameter for the guess value.