Showing posts with label heart. Show all posts
Showing posts with label heart. Show all posts

Saturday, November 30, 2019

HP 41C and DM41L: Basic EKG Calculations

HP 41C and DM41L: Basic EKG Calculations



Introduction

The program calculates the following:

*  Lead II magnification, in mm
*  The mean axis deviation
*  The mean axis magnitude 

Given:

*  Lead I positive deflection, in mm
*  Lead III negative deflection, in mm

The mean axis deviation and magnitude are calculated by a rectangular conversion by the following coordinates:

X: Lead I positive deflection - Lead I negative deflection
Y:  Net Lead I deflection * 0.5774 + Net Lead III deflection * 1.1547
Mean axis deviation:  θ - 57°

The program also:

* Converts between the heart rate (rpm) and the R-R interval
* Use either parameter to calculate the Q-T interval, in seconds

heart rate = 60/R-R
Q-T interval = √(R-R)*0.39

The program is a translation of HP 67/HP 97 Basic EKG Determination, which itself is a translation of Steven A. Conrad's HP-65 program (HP-65 Users' Library Program).  See the source listed below.

Notes:

1.  Clear the assignments of keys A (Σ+) through E (LN) before running the program.  This must be done outside the programming environment.  Clear assignments to keys by ASN (blank) (designated key).  

Example:  Clear assignment from A: [ shift ] (ASN)  [ALPHA] [ALPHA] [ Σ+ ]

2.  Running EKG will turn the User Keyboard on.

3.  The program will set the calculator to degrees mode. 

4.  This program was entered on an HP 41C, and it should work on any simulator and Swiss Micros DM41.  

Instructions

1.  Run EKG.

2.  Determine Lead I net deviation and store it to register 01:
(in User's Mode) positive deviation Lead I [ENTER] negative deviation Lead I ( A )  

3.  Determine Lead II net deviation, storing net Lead III net deviation to register 03 and Lead II net deviation to register 02:
(in User's Mode)  positive deviation Lead III [ENTER] negative deviation Lead III ( B )
Result:  Lead II net deviation

4.  Compute Mean Axis:
(in User's Mode)   ( C )  deviation is displayed [ R/S ] magnitude is displayed

5a.  Convert heart rate to R-R:   
(in User's Mode) heart rate (bpm) ( D )
-or-
5b.  Convert R-R to heart rate:
(in User's Mode)  R-R ( D )

6.  Compute Q-T.  
(in User's Mode)  ( E )

HP 41C/DM41 Program:  EKG

01 LBL T^EKG
02 SF 27
03 GTO 00
04 LBL A
05 - 
06 STO 01
07 ^T III:_ 
08 ARCL X
09 AVIEW
10 RTN
11 LBL B
12 -
13 STO 03
14 RCL 01
15 +
16 STO 02
17 ^T II:_ 
18 ARCL X
19 AVIEW
20 RTN
21 LBL C
22 RCL 01
23 ENTER↑
24 0.5774
25 *
26 RCL 03
27 ENTER↑
28 1.1547
29 *
30 +
31 ENTER↑
32 RCL 01
33 R-P
34 X<>Y
35 57
36 -
37 ^T DEV=
38 ARCL X
39 AVIEW 
40 STOP
41 X<>Y
42 ABS
43 ^T MAG=
44 ARCL X
45 AVIEW
46 RTN
47 LBL D
48 ENTER↑
49 ENTER↑
50 60
51 X<>Y
52 /
53 X<=Y?
54 GTO 05
55 ^T RATE=
56 ARCL X
57 AVIEW
58 RTN
59 LBL 05
60 ^T R-R=
61 ARCL X
62 AVIEW
63 RTN
64 LBL E
65 X>Y?
66 X<>Y
67 SQRT
68 0.39
69 *
70 ^T Q-T=
71 ARCL X
72 AVIEW 
73 RTN
74 LBL 00
75 RTN
76 END

Example

I+ = 2.8 mm,  I- = 1.1 mm
III+ = 2.5 mm, III- = 1.4 mm
Heart Rate = 86 bpm

Keystrokes:

XEQ "EKG"
(User Mode is On)
2.8 [ENTER] 1.1 ( A ) 
Display:  III: 1.7000

2.5 [ENTER] 1.4 ( B )
Display:  II:  2.8000

( C )
Display:  DEV=-4.0516
[ R/S ]
Display:  MAG=2.8214

86 (D)
Display:  R-R=0.6977

(E)
Display:  Q-T=0.3258

Source:

"Basic EKG Determinations"  HP-67/97 User's Library Solutions:  Cardiac.  Hewlett Packard.  Corvallis, OR.  (no date given, but I estimate this to be circa 1974)

Eddie

All original content copyright, © 2011-2019.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

Monday, April 10, 2017

HP Prime: Fick Cardiac Output (The Blog Turns Six!)



HP Prime:  Fick Cardiac Output  (The Blog Turns Six!)

A Special Note

Happy sixth birthday to my mathematics blog!   And a big reason why blog has turned six on April 11, 2017 is because of all of you readers!  Words can’t explain how appreciated I am. 

Thank you!  Cheers to everyone!

Fun fact:  The most popular blog entry is my TI-36X Pro review (my fourth blog entry, 4/27/2011).  Link:  http://edspi31415.blogspot.com/2011/04/ti-36-pro-review.html

Now let’s get to today’s subject. 

Fick Cardiac Output Equations

The program FICK will calculate:

* CO: Cardiac Output (L/min)
* SV: Stroke Volume (ml)
* CI:  Cardiac Index (L/(min/m^2))
* SI:  Stroke Index (ml/m^2)

Given the following inputs:

* Ca:  Arterial blood oxygen (O2) content percentage
* CvO2:  Venous blood oxygen (O2) content percentage
* VO2:  Oxygen compulsion (in ml per pure oxygen gas per minute, STPD)
* HR:  Heart Rate in beats per minute (BPM)
* Height in cm
* Weight in kg

STPD: Standard Temperature Pressure Density

Conversion factors:  1 in = 2.54 cm, 12 in = 1 ft, 1 lb = 0.45359237 kg

Formulas: 

CO = VO2 / (10 * (Ca - CvO2))
SV = CO * 1000/HR
CI = CO/BSA
SI = SV/BSA

BSA:  body surface area, measured in cm^3.  There are several formulas, but the Fick program uses the simple approximation formula:

BSA = √(weight * height)/60

HP Prime Program FICK

EXPORT FICK()
BEGIN
// Fick Cardiac Output
// HP 65, 1972
// EWS 2017-04-10

// inputs
LOCAL ca,cv,vo,hr,h,w;
INPUT({ca,cv,vo,hr,h,w},
"Fick Cardiac Output",
{"Ca O_2:","C_v O_2:","VO_2:","HR:",
"Height:","Weight:"},
{"Arterial blood (%)",
"Venous blood (%)",
"O_2 compulsion (ml/min)",
"Heart Rate (BPM)",
"Height (cm)",
"Weight (kg)"});

// calculation
LOCAL co:=vo/(10*(ca-cv));
LOCAL sv:=co*1000/hr;
// simple BSA
LOCAL bsa:=√(w*h)/60;
LOCAL ci:=co/bsa;
LOCAL si:=sv/bsa;

// output
PRINT();
PRINT("Cardiac Output (l/min)");
PRINT(co);
PRINT("Stroke Volume (ml)");
PRINT(sv);
PRINT("Cardiac Index (L/(min/m^2))");
PRINT(ci);
PRINT("Stroke Index (ml/m^2)");
PRINT(si);

END;

Example:

Inputs:



* Ca:  19%
* CvO2:  15%
* VO2:  250 ml/min
* HR:  64
* Height: 5 ft 11 in, 180.34 cm
* Weight 196 lb, 88.90410452 kg

Results:

* CO: 6.25 L/min
* SV: 97.65625 ml
* CI:  2.96158586825 L/(min/m^2)
* SI:  46.2747791914 ml/m^2

Source:

Hewlett Packard.  HP-67/97 User’s Library Solutions: Cardiac Corvallis, OR 1976  pg. 20

Here’s to many more years!

Eddie

This blog is property of Edward Shore, 2017.

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...