HP 48G/GX stuff
E-Mail :
Arpad.Burmen@kiss.uni-lj.si
arpi@flux.fe.uni-lj.si
http://flux.fe.uni-lj.si/~arpi/hp48util.html
[Slovene (detailed)] [English]
HP 48G/GX series calculator is an extremely powerful tool. Most of the
people actually don't know much about the possibilities it offers.
Here are some utilities I wrote and used at some of the exams at the
faculty. By using these short programs the time spent for solving circuit
analysis or tranmission line problems can be cut to a third or even less.
All of these utilities are in the package EEng-10.
The package is in .zip format. Unpack it and upload it to your calculator's
memory. If the upload is successfull a directory is created containing
utilities described below.
-
Top level directory - name it whatever you want
-
j - Imaginary unit
-
EENG - Utilities for electrical engineering
-
WAWE - Utilities for transmission line
analysis
-
MAG - Calculates the magnitude of a
complex number. Also found in MTH CMPL as ABS. This is a
shortcut that saves you some typing.
-
PHASE - Calculates the argument (phase)
of a complex number. Also found in MTH CMPL as ARG.
-
GSUM - Calculates the sum of an infinite
geometric series. Put the first and the second element on the stack. Then
select GSUM.
The geometric series:
a(1+x+x^2+x^3+..).=a/(1-x)
First two elements are a and ax.
This utility in intended for summarizing wave magnitudes in a zig-zag
diagram.
-
Zn->G -
Calculates the reflection coeficient of a load with normalized impedance
Zn. Put the value of Zn on the stack and select Zn->G.
G=(Zn-1)/(Zn+1)
-
->Gkl -
Calculates the factor exp(-2jbx),
where x=kl.
Put the value of k on the stack and select ->Gkl.
Multiplying the reflection coeficient of a load
by this factor gives the reflection coeficient at the distance kl
measured from the load.
-
G->Zn -
Calculates the equivalent load from the reflection coeficient. Put the
value of G on the
stack and select G->Zn.
Zn=(1-G)/(1+G)
-
Re - Returns the real part of a complex
number. Also found in MTH CMPL as RE.
-
Im - Returns the imaginary part of
a complex number. Also found in MTH CMPL as IM.
-
Matrix - Contains utilities for manipulatig
matrices describing circuits.
-
->Yn - Adds a row and a column to the
matrix so that the sums of elements in each row and each column equal 0.
This operation is required when the conversion from one orientation to
another is required.
Let-s say you have a transistor with its Y-parameters for common emitter
orientation and you want to convert them to Y-parameters for common base
orientation. First put the 2x2 matrix with Y-parameters for common emitter
orientation on the stack.
Row 1 and column 1 belong to node 1 (base). Row 2 and column 2 belong
to node 2 (collector).
Now select ->Yn. The 2x2 matrix is expanded to a 3x3 matrix
where row 3 and column 3 belong to node 3 (emitter).
Since you want to extract the parameters for comon base orientation,
you have to delete the row and column that belong to the base node. Therefore
you have to delete row 1 and column 1. You can do that with the built-in
matrix editor.
Now you have a 2x2 matrix with row 1 and column 1 for the collector
and row 2 and column 2 for the emitter.
Since the input port is the emitter, nodes must be swapped by swapping
rows 1 and 2 and columns 1 and 2. This operation can be performend by using
the NSWP utility.
This procedure can be used for larger circuits, not just those with
3 nodes like the transistor.
-
Eliminate - Eliminates the node that
belongs to the last row in the matrix.
Let's say you have a 5-node (4 port, 4 nodes+ground) circuit and you
want to obtain the Y-parameters for a certain pair of ports. Write it's
reduced node admitance matrix (4x4) and put it on the stack. Then swap
nodes with the NSWP utility so that the node that belongs to the
input port is in the first row and the node that belogs to the output port
is in the second row. Press Eliminate twice to eliminate the inner
two nodes represented by rows 3 and 4 and columns 3 and 4. The result is
the Y-parameters matrix (2x2).
-
MCF - Calculates the matrix cofactor.
The matrix cofactor is the determinate that belongs to the matrix with
the row i and the column j removed, multiplied by (-1)^(i+j).
Put the matrix, the row number i and the column number j
on the stack and select MCF.
-
NSWP - Swaps nodes in the Y-matrix.
Put the Y matrix followed by two node numbers (i and j)
on the stack and select NSWP. This will swap nodes i and
j by swapping rows i and j and columns i and
j.
-
MCSW - Swaps columns in a matrix. Put
the matrix along with the two column numbers (i and j) on
the stack and select MCSW.
-
MRSW - Swaps rows in a matrix. Put
the matrix along with the two row numbers (i and j) on the
stack and select MRSW.
-
MCCI - Multiplies a column by a scalar
factor. Put the matrix, the scalar and the column number on the stack and
select MCCI.
-
MCCIJ - Adds the source column multiplied
by a scalar factor to the target column. Put the matrix, the scalar factor,
the number of the source collumn and the number of the target column on
the stack and select MCCIJ.
-
MRCI - Multiplies a row by a scalar
factor. Put the matrix, the scalar and the row number on the stack and
select MRCI.
-
MRCIJ - Adds the source row multiplied
by a scalar factor to the target row. Put the matrix, the scalar factor,
the number of the source row and the number of the target row on the stack
and select MCCIJ.
-
Y->A - Two-port network parameters
conversion. Converts Y matrix to A matrix. See the definitions
below. Put a 2x2 (compex) matrix containing Y parameters to stack
and select Y->A.
-
A->Y - Two-port network parameters
conversion. Converts A matrix to Y matrix. Put a 2x2 (compex)
matrix containing A parameters to stack and select A->Y.
-
Z->A - Two-port network parameters
conversion. Converts Z matrix to A matrix. Put a 2x2 (compex)
matrix containing Z parameters to stack and select Z->A.
-
A->Z - Two-port network parameters
conversion. Converts A matrix to Z matrix. Put a 2x2 (compex)
matrix containing A parameters to stack and select A->Z.
-
H->A - Two-port network parameters
conversion. Converts H matrix to A matrix. Put a 2x2 (compex)
matrix containing H parameters to stack and select H->A.
-
A->H - Two-port network parameters
conversion. Converts A matrix to H matrix. Put a 2x2 (compex)
matrix containing A parameters to stack and select A->H.
-
K->A - Two-port network parameters
conversion. Converts K matrix to A matrix. Put a 2x2 (compex)
matrix containing K parameters to stack and select K->A.
-
A->K - Two-port network parameters
conversion. Converts A matrix to K matrix. Put a 2x2 (compex)
matrix containing A parameters to stack and select A->K.
-
K - Boltzman's constant. 1.380658E-23
J/K
-
s - Stefan-Boltzman
constant in the black-body radiation formula. 5.67051E-8 W/(m^2 K^4)
-
e0 - Permittivity
of vacuum. 8.85418781761E-12 As/Vm
-
m0 - Permeability
of vacuum. 1.25663706144E-6 Vs/Am
-
h - Planck's constant. 6.6260755E-34
Js
Transmission line:
======================================--+
I
[ ]
G(x)
Zk
G -> [ ] Zn
[ ]
I
======================================--+
x
<=====================================
G(x)=Gexp(-2jbx)
Matrix manipulation:
Reduced node admitance matrix:
node 1
node 2 ... node n
node 1 [ x
x ...
x ]
node 2 [ x
x ...
x ]
... [ ...
... ... ...
]
node n [ x
x ...
x ]
Diagonal elements (i,i) are sums of all admitances connected
to the node i.
Other elements are negative sums of all admitances between nodes i
and j.
Node n+1 is ground node and is not contained in the reduced matrix.
However it is contained in the expanded node admitance matrix. The reduced
matrix can be converted to the expanded matrix by by the ->YN utility.
By deleting node l (row and column) from the expanded node admitance
matrix a new reduced matrix is obtained. This matrix belongs to the circuit
with node l grounded and node n+1 not grounded.
Matrix definitions:
All of the matrix conversion utilities work with complex matrices. The
result is always a complex matrix, even if the input matrix was real. However
in this case all the imaginary parts equal 0.
To perform conversions that are not implemented: e.g. for Z->K
execute Z->A and then A->K.
Disclaimer: the author is not responsible
for the unpleasent consequences that might occur by using these utilities(e.g.
failed exams, space shuttles exploding, ships sinking, etc. caused by bugs
in software, insufficient knowledge of the software or anything else.).
THERE IS NO WARRANTY. YOU USE THIS SOFTWARE AT YOUR OWN RISK. So don't
come crying if you mess up and want to blame it on me.
Support the author: all of this
software is free. If you find it useful and want to see further versions,
you can send $10 to the snail mail address. All feedback is welcome (suggestions,
bug reports, etc.).
Arpad Burmen
Nemcavci 2
9000 Murska Sobota
Slovenia
Europe