Convergence problems

1 view
Skip to first unread message

mackadee

unread,
Dec 31, 2009, 1:35:34 AM12/31/09
to Hoy Moon Formulaic
I think Formulaic is pretty good, I have a number of equations
entered into it, and
it saves me from having to carry around a laptop just so I can use the
excel solve function.
However, I found that a simple formula for gas density Rho=P*V/(R*
(T+273)*Z)
and another simple fomula Va=K*sqrt((Rholiquid-Rhogas)/Rhogas)
and another for Log Mean Temperature Difference
sometimes ask me for initial guesses. Why ? these are continuous
real number functions,
that don't have any polynomial expressions that might yield more than
one root for a solution.
And the "high and low guesses" have to be quite close to the answer
before it "finds" the solution,
causing one to question why a calculator would be needed to start
with ;-)

Any simple algorithm whether Newton-Raphson, secant, should be able to
find a solution in very few iterations using a program generated
initial guess before
switching to the bisection method, and then subsequently more
complicated methods.

It can be done, my old HP28 in solver mode could solve these
equations and a lot more difficult ones 20 years ago....
I think a bit more effort on your convergence criterion would give
you a user base of technical people who haven't really had a good
equation solving hand held device since the HP 200LX.

Also, it would be handy if you could do some basic arithmetic in the
input boxes. For example you know the diameter of a circle is 15.5
feet but your formula needs meters, it would be handy to be able to
enter "15/3.2808" in the box that asks for "Dia_meters". I think
someone else has mentioned this in the forum as well.
.

hoymoon

unread,
Jan 11, 2010, 6:24:23 AM1/11/10
to Hoy Moon Formulaic
Hello Mackadee,

Its great to hear that you're putting Formulaic to good use.

Formulaic's core root-finding algorithm actually performs better than
either Newton-Raphson or the secant method: it doesn't suffer from the
difficulties of Newton-Raphson when there are local minima, and it
converges more quickly than the secant method - i.e. it works well for
the general case of an arbitrary function about which no assumptions
can be made. The only "deficiency" is that the approach requires the
solution to be "bracketed": the algorithm needs a high and a low guess
between which it then searches for a solution, and these guesses need
to cause a "sign reversal" when the whole expression is evaluated.
Currently, Formulaic uses eight different approaches for initial high/
low guesses, and actually tries to solve the equation in each of those
ranges. Only when no solution is found during these will Formulaic
prompt for a high & low guess. Ideally, Formulaic should never have to
prompt for a guess, we just haven't yet found a way to *always* find
appropriate starting high/low guesses automatically. When you get
prompted for a guess, this is because none of the built-in methods of
guessing have lead to a suitable starting point for the actual root-
finding algorithm.

For any equation which when plotted looks like "a diagonal wavy line",
Formulaic will happily and quickly find a solution. For some
discontinuous functions, and some common functions that don't cause
sign-reversal [e.g. f(x) = sin(x) + 1], the current version of
Formulaic has difficulty finding a solution. We would never claim to
have access to engineering know-how on par with the group at HP who
brought us solver functionality in their calculators, but even the
HP200LX will prompt for guesses in a number of cases.

We are actively working on ways to improve the "out-of-the-box"
capabilities of Formulaic. If you can post some of the actual variable
values you're using in your equations which lead to a prompt for a
guess, we'll happily include those in our test-suite, which would help
us make Formulaic work better for you.

Your additional suggestion of entering expressions in fields for
variable values is currently in development.

Kind regards,
Hoy Moon

Reply all
Reply to author
Forward
0 new messages