Post Reply 
MANPIP
04-12-2014, 04:29 AM
Post: #19
RE: MANPIP
This is the 2nd version of the MANNING program. It uses the top row of the keys similar to how you can solve TVM problems with the HP-12C. I used the following layout but this could be changed:

[N] [Q] [D] [S] [Y]

You can use [STO] + key to enter the known data and [RCL] + key to read it. This works because registers 01-05 are used for these 5 variables.
So you enter the known values and then press the key to calculate the unknown value. After a while the result is displayed. If you press [R/S] the velocity is displayed as well.

If you want to calculate the full flow you have to set both D and Y to the same value. If you know N, Q and S you can only solve for full flow with the key [D]. It's currently not possible to solve for D when N, Q, S and Y are given. I could be wrong but I assumed that isn't used often.

However you can solve for Y when N, Q, D and S are given. For certain values there might be two solutions but only the smaller is calculated. A fixed point iteration is used to solve the equation numerically. Thus the calculation may take a little longer especially for small values of \(\theta\).

Examples
You have to run this once to initialize the calculator:
[XEQ] "MANNING"

Partial flow:
n = 0.0130 Q = 7.2400 d = 2.7500 S = 0.0020 y = 1.0441

.013 [STO] [N]
7.24 [STO] [Q]
2.75 [STO] [D]
.002 [STO] [S]
[Y]
Y=1.0441
[R/S]
V=3.5000

Full flow: (y = d)
n = 0.0110 Q = 11.9559 d = 2.0000 S = 0.0020 y = 2.0000

.011 [STO] [N]
2 [STO] [D] [STO] [Y]
.002 [STO] [S]
[Q]
Q=11.9559
[R/S]
V=3.8057


Registers
00 k
01 n
02 Q
03 d
04 S
05 y
06 \(\theta\)
07 A
08 V

Code:
LBL "MANNING"
RAD
SF 27           ; set USER mode
.3048           ; 1 ft in m
1/X
3
1/X
Y^X
STO 00          ; k = 1.485918577
"N Q D S Y"
PROMPT
;==================================================
LBL A           ; calculate n
XEQ 01          ; R^(2/3)
RCL 00          ; k
*
RCL 04          ; S
SQRT
*
XEQ 02          ; V
/
STO 01          ; n = k * R^(2./3.) * sqrt(S) / V
"N="
GTO 03
;==================================================
LBL B           ; calculate Q
XEQ 01          ; R^(2/3)
RCL 00          ; k
*
RCL 04          ; S
SQRT
*
RCL 01          ; n
/
STO 08          ; V = k * R^(2./3.) * sqrt(S) / n
RCL 07          ; A
*
STO 02          ; Q = V * A
"Q="
GTO 03
;==================================================
LBL C           ; calculate d
RCL 01          ; n
RCL 02          ; Q
*
PI
/
RCL 00          ; k
/
RCL 04          ; S
SQRT
/
3
Y^X
4
5
Y^X             ; 4^5
*
8
1/X
Y^X
STO 03          ; d = (4^5 * (n * Q / pi / k / sqrt(S))^3)^(1/8)
STO 05          ; y = d
X^2
PI
*
4
/
STO 07          ; A = pi * d^2 / 4
XEQ 02          ; V
RCL 03
"D="
GTO 03
;==================================================
LBL D           ; calculate S
XEQ 01          ; R^(2/3)
XEQ 02          ; V
RCL 01          ; n
*
RCL 00          ; k
/
X<>Y            ; R^(2/3)
/
X^2
STO 04          ; S = (V * n / k / R^(2/3))^2
"S="
GTO 03
;==================================================
LBL E           ; calculate y
RCL 01          ; n
RCL 02          ; Q
*
RCL 00          ; k
/
RCL 04          ; S
SQRT
/
3
Y^X
2
13
Y^X
*
RCL 03
8
Y^X
/
STO 09          ; L = 2^13 * (n * Q / k / sqrt(S))^3 / d^8
;...............; calculate initial guess
3
1/X
Y^X
6.758860947     ; max q
/
SQRT
2
*
1
X<>Y
-
ACOS
5.278107138     ; max theta
*
PI
/               ; max_t*acos(1-2*sqrt(q/max_q))/pi
STO 06
;...............; fixed point iteration
LBL 00
RCL 06          ; theta
SIN
RCL 06          ; theta
X^2
RCL 09          ; L
*
.2
Y^X
+               ; theta' = sin(theta)+(L*theta^2)^.2
ENTER
X<> 06          ; theta
-
ABS
RND
X>0?
GTO 00
1
RCL 06          ; theta
2
/
COS
-
RCL 03          ; d
*
2
/
STO 05          ; y = d * (1 - cos(theta / 2)) / 2
RCL 06          ; theta
ENTER
SIN
-
RCL 03          ; d
X^2
*
8
/
STO 07          ; A = d^2 * (theta - sin(theta)) / 8
XEQ 02          ; V
RCL 05
"Y="
GTO 03
;==================================================
LBL 01          ; calculate theta, A and R^(2/3)
1
RCL 05          ; y
2
*
RCL 03          ; d
/
-
ACOS
2
*
STO 06          ; theta = 2 arccos(1 - 2 y / d)
ENTER
SIN
-
RCL 03          ; d
X^2
*
8
/
STO 07          ; A = (theta - sin(theta)) d^2 / 8
RCL 06          ; theta
/
RCL 03          ; d
/
2
*               ; R = A / P
LASTX           ; 2
3
/
Y^X             ; R^(2/3)
RTN
;==================================================
LBL 02          ; calculate V
RCL 02          ; Q
RCL 07          ; A
/
STO 08          ; V
RTN
;==================================================
LBL 03          ; prompt result
ARCL X
PROMPT
"V="
ARCL 08         ; V
AVIEW
END

Best regards
Thomas


Attached File(s)
.pdf  manning.pdf (Size: 32.31 KB / Downloads: 36)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
MANPIP - Jerussi - 04-07-2014, 06:00 PM
RE: MANPIP - Thomas Klemm - 04-07-2014, 06:53 PM
RE: MANPIP - Jerussi - 04-07-2014, 07:35 PM
RE: MANPIP - Thomas Klemm - 04-07-2014, 11:05 PM
RE: MANPIP - Jerussi - 04-07-2014, 07:37 PM
RE: MANPIP - Jerussi - 04-07-2014, 07:38 PM
RE: MANPIP - Jerussi - 04-08-2014, 06:01 PM
RE: MANPIP - Jerussi - 04-08-2014, 06:04 PM
RE: MANPIP - Jerussi - 04-08-2014, 09:29 PM
RE: MANPIP - Thomas Klemm - 04-09-2014, 08:05 AM
RE: MANPIP - Jerussi - 04-09-2014, 02:13 PM
RE: MANPIP - Thomas Klemm - 04-09-2014, 05:20 PM
RE: MANPIP - Jerussi - 04-09-2014, 02:28 PM
RE: MANPIP - Thomas Klemm - 04-09-2014, 06:58 PM
RE: MANPIP - Thomas Klemm - 04-12-2014, 04:58 AM
RE: MANPIP - Jerussi - 04-09-2014, 08:20 PM
RE: MANPIP - Thomas Klemm - 04-12-2014, 04:37 AM
RE: MANPIP - Jerussi - 04-09-2014, 09:50 PM
RE: MANPIP - Thomas Klemm - 04-10-2014, 08:56 AM
RE: MANPIP - Jerussi - 04-10-2014, 12:28 PM
RE: MANPIP - Thomas Klemm - 04-12-2014, 05:01 AM
RE: MANPIP - Thomas Klemm - 04-12-2014 04:29 AM
RE: MANPIP - Thomas Klemm - 04-12-2014, 10:54 AM
RE: MANPIP - Jerussi - 04-12-2014, 07:07 PM
RE: MANPIP - Thomas Klemm - 04-12-2014, 08:26 PM
RE: MANPIP - Jerussi - 04-12-2014, 07:21 PM
RE: MANPIP - Jerussi - 04-12-2014, 07:40 PM
RE: MANPIP - SlideRule - 04-24-2014, 04:01 PM
RE: MANPIP - Jerussi - 04-12-2014, 08:31 PM
RE: MANPIP - Jerussi - 04-22-2014, 05:18 PM
RE: MANPIP - Jerussi - 04-24-2014, 04:15 PM
RE: MANPIP - Ángel Martin - 04-27-2014, 06:58 AM
RE: MANPIP - Thomas Klemm - 04-28-2014, 08:54 PM
RE: MANPIP - SlideRule - 04-27-2014, 12:05 PM
RE: MANPIP - Jerussi - 04-28-2014, 02:35 PM
RE: MANPIP - Jerussi - 04-28-2014, 02:42 PM



User(s) browsing this thread: 1 Guest(s)