Property Estimator
Name | Storage height from storage volume and diameter |
---|
Property | Storage Height |
---|
Type | Function |
---|
Function | // Return zero if stored volume is zero
if (Scientific::equals([VST:m3], 0)) return 0.0;
// Return unit height if stored volume equals unit volume
if (Scientific::equals([VST:m3], [V:m3])) return [D:m];
// Solve by Newton's rule
$x = [D:m] / 2;
while (TRUE) {
$y = M_PI * $x * $x * ([D:m] / 2 - $x / 3) - [VST:m3];
if (Scientific::equals($y, 0)) return $x;
$x = $x - $y / (M_PI * $x * ([D:m] - $x));
}
|
---|
Unit | m |
---|
Validity Conditions | Shape: Spherical |
---|
Precedence | Auto |
---|
Disabled | No |
---|
Notes | Calculates fill height by using Newton's method of successive approximations (Newton's rule). Volume is only used to check the boundary condition at the beginning. |
---|
Access | Public |
---|
Created: Serkan GIRGIN, 2017/04/19 14:40:30