 The Museum of HP Calculators

HP Forum Archive 14

 HP27S Inherent problem with the equation solverMessage #1 Posted by Bruce Cohen on 24 Oct 2004, 5:31 a.m. I was trying to transfer a conduit flow equation from my HP42S solver to my HP27S just to see how complicated it would be, since there is no way to store intermediate calculations. As you can see by the equation, this was not a trivial task. When I finished and had the equation working properly, I did a test calculation, solving for each of the variables to detect physically impossible solutions. The results of this test has revealed this problem. ``` PROBLEM: THIS DOG WON'T HUNT! The consequences of an overly agressive direct solver prevents the discovery of the desired roots of some equations. ``` The variable E~IN is second order in the equation below; but, since it only appears once in the equation, the direct solver is able to isolate it to one side of the equation. This allows rapid answers for one root but with no way to calculate the other root, since direct solutions don't permit the use of guesses to "HUNT" for the other root. ```VARIBLES !RE 395,319.5445 Reynolds number - dimensionless !V~FT/S 6.3828 Fluid velocity - feet per second !Q~GAL 2,611.2000 Pipeline volume - gallons F~GPM 1000 Flowrate - gallons per minute D~#/GAL 8.34 Density - pounds per gallon ID~IN 8.0 Pipe inside diameter - inches L~FT 1000 Pipe length - feet E~IN .0018 Roughness - inches VIS~CP 1.0 Viscosity - centipoise P~PSI 12.0034 calc Pressure - pounds per square inch K 20.0 Fitting coefficents - dimensionless Variables preceeded by a (!) are outputs only. After solving for P~PSI, solve for E~IN and you get the answer E~IN=280,727.6311 which is the physically meaningless root. ``` EQUATION ---- The equation is entered into the HP27S solver as a single string, the line breaks are for readability. ```HYDRAULICS :IF(S(!RE):F~GPMx379.2034xD~#/GALﺊID~INﺊVIS~CP-!RE :IF(S(!V~FT/S):F~GPMx0.4085ﺊID~IN^2-!V~FT/S :IF(S(!Q~GAL):ID~IN^2x0.0408xL~FT-!Q~GAL :(IF(F~GPMx379.2034xD~#/GALﺊID~INﺊVIS~CP>2300:0.0772ﺊLOG((E~INﺊ3.7ﺊ)^1.111+6.9ﺊ(F~GPMx379.2034xD~#/GALﺊID~INﺊVIS~CP))^2 :16ﺊ(F~GPMx379.2034xD~#/GALﺊID~INﺊVIS~CP))x24xL~FTﺊID~IN+Kﺊ2)x(F~GPMx.0485ﺊID~IN^2)^2ﺊ618.87-P~PSIﺊD~#/GAL))) ``` This problem seems to be affected by the number of times a variable appears in an equation. ``` For example: A=LOG((X^PI)^5.124)^1.23 Yields a direct solution A=X+X requires an iterative solution ```

 Re: HP27S Inherent problem with the equation solverMessage #2 Posted by Vincent Weber on 25 Oct 2004, 11:26 a.m.,in response to message #1 by Bruce Cohen Hi Bruce, This is a problem identified in the advanced book for the 27S and 19BII. What you need to do is to put another occurence of the variable, without modifying the equation, like '..+0*A'. As soon as you have at least two occurences of the variable, the solver will not attempt to isolate it, and you can store whatever initial values you want to want THE root you want. Hope this helps. Cheers, Vincent Go back to the main exhibit hall