cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

parametric initial guess?

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)?

tia,
dennis
7 REPLIES 7

parametric initial guess?

Can you post an example worksheet?

Richard

parametric initial guess?

Yes, you can define a function from the solve block and pass parameters. Such parameters can include the guess values.

Tom Gutman

parametric initial guess?

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?

parametric initial guess?

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.

Tom Gutman

parametric initial guess?

tom,

whoops, looks like i posted the wrong file, so there may be a misunderstanding. i've posted the corrected file. at the bottom, you should see a 'red' statement.

dennis
Highlighted

parametric initial guess?

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.

Tom Gutman

parametric initial guess?

tom,

that is neat. i tried various things following your suggestion but never quite hit upon such a simple construct.

thanks a bunch, again,
dennis