Talk About Network

Google




Education > Algebra help > Re: Formula Hel...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 6 Topic 1944 of 2170
Post > Topic >>

Re: Formula Help

by bradeatspoo@[EMAIL PROTECTED] Dec 30, 2007 at 09:22 PM

On Dec 30, 11:58=A0pm, David W. Cantrell <DWCantr...@[EMAIL PROTECTED]
> wrote:
> "Brian M. Scott" <b.sc...@[EMAIL PROTECTED]
> wrote:
>
> > On Sun, 30 Dec 2007 13:22:30 -0800 (PST),
> > <bradeats...@[EMAIL PROTECTED]
> wrote in
> >
<news:813841bf-5512-4c47-98f9-769d92bde6e0@[EMAIL PROTECTED]
>=

> > in alt.algebra.help:
>
> > > I am a computer program
>
> > And a very good one, too! =A0<g>
>
> I wonder if it is good enough to pass the Turing Test.
>
>
>
>
>
> > > and not a mathematician. =A0I use the equations below to
> > > calculate Gallons when I have the Radius, Depth and
> > > Length of an oil tank. =A0However, sometimes I need to
> > > calculate Depth when I have the Radius, Length and
> > > Gallons. =A0Any help in reworking these formulas would be
> > > greatly appreciated.
>
> > > If iDepth <=3D iRadius Then
>
> > > =A0 =A0 =A0 =A0 =A0 =A0 iGals =3D ((iRadius * iRadius *
Acos((iRadius =
- iDepth) /
> > > iRadius)) - ((iRadius - iDepth) * Sqrt(2 * iRadius * iDepth - iDepth
*=

> > > iDepth))) * iLength / 231
>
> > > Else
> > > =A0 =A0 =A0 =A0 =A0 =A0 iGals =3D ((PI * iRadius * iRadius) -
((iRadiu=
s * iRadius *
> > > Acos((iRadius - (2 * iRadius - iDepth)) / iRadius)) - ((iRadius - (2
*=

> > > iRadius - iDepth)) * Sqrt(2 * iRadius * (2 * iRadius - iDepth) - ((2
*=

> > > iRadius - iDepth) * (2 * iRadius - iDepth)))))) * iLength / 231
>
> > > End If
>
> I'm curious to know why you chose to break up the calculation of iGals
int=
o
> two cases. After all, for any iDepth from 0 through 2*iRadius, we can
use
> just
>
> =A0 =A0 =A0 =A0 =A0 =A0 iGals =3D ((iRadius * iRadius * Acos((iRadius -
iD=
epth) /
> iRadius)) - ((iRadius - iDepth) * Sqrt(2 * iRadius * iDepth - iDepth *
> iDepth))) * iLength / 231
>
> > Judging from these formulae, it's a cylindrical tank lying
> > on its side. =A0Its length in inches is iLength, its radius in
> > inches is iRadius, and iDepth is the depth of the fluid in
> > inches, measured at the centre of the tank.
>
> > The problem isn't amenable to solution in closed form:
> > you're not going to get a formula that gives you iDepth in
> > terms of iGals, iRadius, and iDepth.
>
> Right. There is no precise solution in closed form. But an approximate
> solution in closed form could be given, for example. [The problem is
> equivalent to solving a special case of Kepler's equation.]
>
> To the computer program:
> I suppose that the iterative method Brian gave below will work well. But
i=
f
> you would prefer a closed-form approximation instead, let me know.
>
> David
>
>
>
> > The easiest practical
> > solution is probably to write a routine that gets a
> > sufficiently accurate value by successive approximation,
> > using the formulae that you already have.
>
> > For convenience I'll introduce some additional variables.
> > First, set iArea =3D 231 * iGals / iLength; this is the area
> > in square inches of the submerged part of a vertical
> > cross-section through the tank. =A0Its maximum value is of
> > course the cross-sectional area of the tank,
> > PI * iRadius * iRadius. =A0Assume first that
> > iArea <=3D PI * iRadius * iRadius / 2, so that
> > iDepth <=3D iRadius.
>
> > Take iD to be an initial approximation to iDepth. =A0It
> > needn't be particularly good;
>
> > =A0 =A0iD =3D 2 * iArea / (PI * iRadius)
>
> > will do. =A0Let
>
> > =A0 =A0iX =3D iRadius - iD
>
> > and
>
> > =A0 =A0iY =3D Sqrt(iRadius * iRadius - iX * iX).
>
> > Recalculate iX according to the formula:
>
> > =A0 =A0iX =3D iX / 2 + (iRadius * iRadius * Acos(iX / iRadius) -
> > iArea) / (2 * iY)
>
> > Update iD:
>
> > =A0 =A0iD =3D iRadius - iX
>
> > This will be a better approximation to iDepth. =A0Repeat until
> > you reach a satisfactory level of accuracy. =A0You can test
> > the accuracy in at least two ways. =A0First, you can use iD
> > for iDepth in your formula to see whether it yields a value
> > for iGals sufficiently close to the known value. =A0Secondly,
> > you can keep track of the changes in iD and make sure that
> > they're small. =A0(You may want to use both.) =A0Convergence was
> > very rapid in all of the examples that I tested.
>
> > If iArea > PI * iRadius * iRadius / 2, you can proceed as
> > follows. =A0First let iArea =3D PI * iRadius * iRadius - iArea;
> > this is the area of the part of the cross-section that
> > *isn't* submerged. =A0Next, carry out the procedure described
> > above. =A0When you've reached a satisfactory level of
> > accuracy, replace iD by 2 * iRadius - iD; this will be the
> > desired approximation to iDepth.
>
> > Brian- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

Brian and David,
Thanks for taking the time to help me with this problem.

David, I can't give you a very good reason as to why there are 2
cases.  The customer had an excel spreadsheet with those 2 cases and I
based my VB function on that spreadsheet.  Perhaps it's an example of
garbage-in garbage-out.  I would be interested in a closed-form
approximation if one exists.  Unlike Brian I'm not a great programmer
and anything that would make this process simpler would be greatly
appreciated.
 




 6 Posts in Topic:
Formula Help
bradeatspoo@[EMAIL PROTEC  2007-12-30 13:22:30 
Re: Formula Help
"Brian M. Scott"  2007-12-30 22:16:11 
Re: Formula Help
David W. Cantrell <DWC  2007-12-31 04:58:05 
Re: Formula Help
bradeatspoo@[EMAIL PROTEC  2007-12-30 21:22:33 
Re: Formula Help
David W. Cantrell <DWC  2008-01-01 00:14:29 
Re: Formula Help
bradeatspoo@[EMAIL PROTEC  2008-01-03 15:00:24 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Tue Jan 6 10:52:25 PST 2009.