Post Reply 
(42S) PPOL Loss in a radiofrequency link due to the antennas polarization (mis)match
11-06-2022, 07:00 PM (This post was last modified: 11-10-2022 08:45 PM by Emilio Abud Filho.)
Post: #1
(42S) PPOL Loss in a radiofrequency link due to the antennas polarization (mis)match
(42S) PPOL - Loss in a radiofrequency link due to the antennas polarization (mis)match

Dear All

Program for solving the loss in a radio frequency link due to the antennas polarization (mis)match; to be used with "HP Solver" built-in application.

Attachments:

- Program documentation, including example, math equations, how to use explanations, source code, etc; (pdf)

- RAW format file (zip)

Code:

00 { 180-Byte Prgm }
01▸LBL "PPOL"
02 MVAR "R1dB"
03 MVAR "R2dB"
04 MVAR "SINAL"
05 MVAR "ABETA"
06 MVAR "PERDA"
07 GTO 01
08▸LBL 02
09 20
10 ÷
11 10↑X
12 RTN
13▸LBL 01
14 RCL "R1dB"
15 XEQ 02
16 STO "R1L"
17 X↑2
18 STO "R1L2"
19 RCL "R2dB"
20 XEQ 02
21 STO "R2L"
22 X↑2
23 STO "R2L2"
24 RCL "R1L"
25 RCL× "R2L"
26 2
27 ×
28 RCL× "SINAL"
29 1
30 RCL- "R1L2"
31 1
32 RCL- "R2L2"
33 ×
34 2
35 ÷
36 2
37 RCL× "ABETA"
38 COS
39 ×
40 +
41 1
42 RCL+ "R1L2"
43 ÷
44 1
45 RCL+ "R2L2"
46 ÷
47 0.5
48 +
49 LOG
50 10
51 ×
52 RCL- "PERDA"
53 END
54 +
55 LOG
56 10
57 ×
58 RCL- "PERDA"
59 END

Warm regards,


Attached File(s)
.zip  PPOL_101raw.zip (Size: 268 bytes / Downloads: 3)
.pdf  HP-42S Program Documentation Form - PPOL_v101.pdf (Size: 218.23 KB / Downloads: 8)

Emilio Abud Filho
Mobile: +55 (41) 9 9172-1201
e.abud@uol.com.br
emilio.abud.filho@gmail.com
Find all posts by this user
Quote this message in a reply
11-07-2022, 12:26 AM
Post: #2
(42S) PPOL Loss in a radiofrequency link due to the antennas polarization (mis)match
You could move the subroutine at LBL 02 to end of the program.
This makes the LBL 01 and the jump GTO 01 obsolete.

Also it looks as if the common denominator:

\(
\begin{align}
(1 + ??1^2) \times (1 + ??2^2)
\end{align}
\)

could be extracted.

Thus the following lines:
Code:
1
RCL+ "R1L2"
÷
1
RCL+ "R2L2"
÷
… have to be executed only once after the addition of the numerators.

Currently after this line:
Code:
52 +
Find all posts by this user
Quote this message in a reply
11-07-2022, 06:16 PM
Post: #3
RE: (42S) PPOL Loss in a radiofreq. link due to the antennas polarization (mis)match
Dear Thomas,

You are 100% right.
I could save many program lines by doing like your suggestion.

I always see myself focusing on solving the antenna engineering problem, and forgetting to optimize my code...

(and, it is true that sometimes I keep the source code as similar as possible to the written equation, to be easy to recover in future what I have done in the program... but, I fully agree that this is not an efficient procedure from programming standpoint, neither an elegant way of working.)

I will revise my source code considering your kind suggestion and replace the old one.

Again, thanks for your extreme kindness on looking into my simple code, and for your advice!!!

Warm regards,

Emilio

Emilio Abud Filho
Mobile: +55 (41) 9 9172-1201
e.abud@uol.com.br
emilio.abud.filho@gmail.com
Find all posts by this user
Quote this message in a reply
11-10-2022, 08:47 PM
Post: #4
RE: (42S) PPOL Loss in a radiofrequency link due to the antennas polarization (mis)match
Dear Thomas

I have revised the code according to your suggestion and the size has been reduced to 180 bytes.

I would still need to move my subroutine to the end of the code...

Warm regards

Emilio

Emilio Abud Filho
Mobile: +55 (41) 9 9172-1201
e.abud@uol.com.br
emilio.abud.filho@gmail.com
Find all posts by this user
Quote this message in a reply
Post Reply 




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