Using Mathcad To Derive Circuit Equations and Optimize Circuit Behavior
Using Mathcad To Derive Circuit Equations and Optimize Circuit Behavior
By:
Introduction
For those of you who are not familiar with it, Mathcad (produced by Mathsoft, not to be
confused with Matlab or Mathematica) is a general purpose mathematical analysis tool with
WYSIWYG formula entry and which can operate in both numeric and symbolic modes;
symbolic math is performed by the underlying Maple engine, common to many of these
Math Processor applications.
Equations are entered in a natural, text book format
wherein integrals look like integrals, and summations look like summations; FORTRAN-like
coding syntaxes need not apply.
It is a Swiss-army knife of mathematical functions,
operators, GUI widgets, and graph types. It comprehends (and automatically converts
between) units, meaning that when you divide a Volts quantity by an Amps quantity,
your result is automatically an Ohms quantity. From the EEs point of view, Mathcad is a
tool that can be used to derive system- or circuit-level equations (remember solving N
equations with N unknowns?), optimize circuit component values, perform worst-case
analysis, process large vectors (matrices) of data, perform image-processing and signalprocessing tasks, curve-fit lab-collected measurements, and even create .AVI movies
(animations of data).
After some exploration and experimentation with Mathcad I can
guarantee you that you will start pushing-aside faithful old Excel. Speaking of which,
Mathcad allows you to embed Excel tables inside its documents, so that users can easily
enter data into variables, or display calculation results in tabular form; Mathcad can even
read/write data from/to Excel files in the native binary .XLS format. What could make the
transition from one tool to the other easier?
This article provides a brief tutorial on Mathcads Symbolics and Optimization features,
and then illustrates how to use both of them to perform a circuit design. For those of you
who might already use Mathcad some of this might be review; perhaps, though, you will
pick-up some new tidbits of knowledge. It is hoped that the reader will learn a faster and
easier (and less error-prone) method of deriving circuit equations and transfer functions, as
well as how to automatically determine optimal component values based on end-product
requirements. It is also hoped that this article will expose the reader to a new analytical
tool (Mathcad) that he wasnt already aware of, and possibly open the door to many new
opportunities for performing better design and analysis tasks in a faster and more efficient
manner.
Page 2 of 2
February 3, 2005
has solution(s)
1
1
+
R1 R2
ZParallel
R2
ZParallel + R2
1
1
1
+
R1 R2
solve , R1 ZParallel
R2
ZParallel R2
Or how about rearranging the familiar resonant frequency of an LC Tank circuit? Again,
using the simplest forms of symbolic processing in Mathcad we can easily rearrange the
equation to calculate the capacitance (C Cap) needed to make a given inductor (LCoil)
resonate at a certain frequency (F Res):
Static:
selected:
Using
FRes =
the
SymbolicsVariableSolve
has solution(s)
menu
operation,
with
C Cap
1
2
2 LCoil CCap
4 LCoil FRes
1
2 LCoil CCap
solve , CCap
1
2
4 LCoil FRes
How does one utilize these two simple forms of symbolics? Well, the Static symbolics
method uses the various operators located under the top-line pull-down menu titled
Symbolics. In general, you type-in an equation, select a term (variable) in the equation,
and then select the symbolic operation you wish to perform; some operations will operate
on the entire equation regardless of what is selected. For instance, creating the R1
derivation takes-place as:
Enter the equation:
ZParallel =
1
1
1
+
R1 R2
Page 3 of 3
February 3, 2005
ZParallel
R2
ZParallel + R2
The Live symbolics method uses the various operators on the Symbolic toolbar. In
general, you place your insertion mark where (in your document) you want your symbolic
evaluation to take place, select the symbolic operator from the toolbar, and then fill-in the
placeholders (little black squares) with your equation and the term to be solved for. For
instance, creating the C cap derivation takes-place as:
Click the Solve icon on the toolbar:
User fills-in the left-most placeholder (small square) with the original equation:
F Res =
1
2 L Coil C Cap
solve ,
User fills-in the right-most placeholder with the variable (term) to be solved-for:
F Res =
1
2 L Coil C Cap
solve , C Cap
Page 4 of 4
February 3, 2005
1
2 LCoil CCap
solve , CCap
1
2
4 LCoil FRes
The more powerful Chained Live symbolic processor allows you to combine a set of
equations, solving for multiple variables contained in the equations; remember the not-sofun task of solving N equations with N unknowns? In addition, that symbolic result can be
assigned to a numeric function that can be used in subsequent design/analysis equations.
For example, you can write nodal equations for a circuit and have Mathcad derive symbolic
(algebraic) equations that represent the voltages at the nodes (or currents through the
elements), and then assign the equation representing the OUT node to a function that can
be used to plot the transfer function. A quick example is shown below.
Given a simple inverting amplifier using an op-amp:
Derive the nodal equations, presuming input currents are zero (ideal op-amp), but provide a
term for the input offset voltage (Vio):
Eqn1 := Vio
Vhi Vlo
Eqn2a := IHi
Eqn3a := IHi
Eqn3b := ILo
Eqn2b := ILo
Vhi
Rbal
Vlo IN
Rin
Vlo OUT
Rfb
Use the symbolics processor to calculate the equation for the output voltage (and a bunch of
intermediary terms that we dont care about):
OUT
Eqn1
Eqn2a
Vlo
Rin
Eqn3a
ILo
Eqn3b
I
Hi
Strip-out the one answer we care about (OUT), and collect on the Vio term to make it
neater looking:
0
( Rfb + Rin)
IN
Out := SysRes 0 collect , Vio
Vio Rfb
Rin
Rin
Page 5 of 5
February 3, 2005
( Rfb + Rin)
Rin
Vio Rfb
IN
Rin
The above is an example of what I call Chained Live Symbolics, because the equations are
tied-together or chained by virtue of assigning the symbolic equations (right-side of :=
operator) to variables (left-side of := operator), which are then used in subsequent
symbolic operations. For instance, the 5 basic circuit equations, assigned into variables
Eqn1, Eqn2a, Eqn2b, Eqn3a, and Eqn3b, are chained to (used by) the solve operation,
whose results are assigned into the variable SysRes (System Results), which is then
chained to (used by) the equation that pulls-out the OUT answer (and collects terms), and
assigns it to the variable Out, which is chained to (used by) the function declaration for
VOut . Notice that our final result does not contain a term for Rbal; because we had defined
our op-amps input currents to be zero, the voltage (Vhi) induced into Rbal from the +
inputs current is zero, thus the Rbal term drops-out of our transfer function.
The beauty of this system is that if you find an error in one of your fundamental equations,
or wish to change one or more equations because you made a topological change in the
circuit, all of the changes automatically ripple-down to the bottom-line answer.
For
instance, the example above ignored the op-amps input offset and bias currents. If we
later decided to add terms (Io and Ib, respectively) to account for these parasitics, all we
would need to do is modify equations Eqn2a and Eqn2b as follows:
Eqn2a := IHi
Ib +
1
2
Io
Eqn2b := ILo
Ib
1
2
Io
And then the new System Results pops-out automatically (and in a much more long and
messy form):
OUT
Eqn1
Eqn2a
Vlo
1 2 Rin Rfb Ib Rin RfbIo + 2 Rfb Vio 2RfbRbal Ib RfbRbal Io + 2 Rfb IN + 2 Rin Vio 2Rin Rbal Ib Rin Rbal Io Vio + Rbal Ib + 1 Rbal Io Rbal Ib + 1 Rbal Io Ib 1 Io Ib + 1 Io
SysRes:= Eqn2b solve , Vhi
Rin
2
2
2
2
2
Eqn3a
I Lo
Eqn3b
I
Hi
After collecting on terms Vio, Ib, and Io the VOut function declaration changes to:
V Out( IN , Rfb , Rin , Rbal , Vio , Ib , Io) =
: Out
1 2 Rfb 2 Rin
Vio +
2
Rin
Ib +
2
Rin
1 Rin Rfb + Rin Rbal + Rfb Rbal
Io
2
Rin
Rfb
IN
Rin
All we had to do is tidy-up VOut s argument list by adding-in the two new terms, Io and Ib.
It was optional to collect on the newly-added terms in order to make the equation look
prettier, however, notice how it lends itself to allowing the designer to directly observe the
contributions of the op-amps parasitics in the overall transfer function. In fact, you can
James C. (Jim) Bach
Page 6 of 6
February 3, 2005
Out
1 2 Rfb + 2 Rin
2
Rin
Out
2
Rin
Out
2
Rin
And, of course, the gain of the circuit is simply the derivative of the transfer function with
respect to the input signal IN:
d
dIN
Out
Rfb
Rin
Notice that our final result (OUT) now contains terms involving Rbal; because we have
included terms (Ib and Io) which generate current (IHi) on the + input, the voltage (Vhi)
induced across Rbal is no longer zero, thus Rbal is needed in the transfer function.
So now we have a function that can calculate the output voltage (OUT) given all of the
circuit values and device parasitics. Using this function we can (amongst other things) plot
a graph showing the circuits transfer function. Say weve designed this circuit to have a
gain of 10, and we are using an op-amp with fairly large input currents:
Rfb := 10k
Rin := 1k
Rbal := 1k
V io := 5mV
Ib := 10A
Io := 0.1A
0.1
Output (Volts)
0.2
0.3
0.4
0.5
0.6
0.01
0.02
0.03
Input (Volts)
0.04
Ib positive
Ib negative
Ideal Behavior
Page 7 of 7
February 3, 2005
Optimization in Mathcad
Another one of Mathcad's strong points is that it has built-in "optimization" capability, which
can be used to adjust any number of system variables until a set of "goal" conditions have
been met, or met with minimal error. This allows the engineer to make some initial guesses
for component values, and then have Mathcad determine what the optimal values are in
order to meet the design constraints (say, to reduce the error of a current-sense amplifier,
obtain a desired frequency response in a multi-stage filter network, etc.). The designer can
constrain component values to particular ranges, to prevent the optimizer from finding
problematically too small or too large of values. The designer can also create his own
Error function, which can be used to control the weighting of trade-offs in the optimization
process.
First of all, you must know if the system you are trying to optimize has achievable goals
(constraints), or if you have some mutually exclusive goals that will make an exact solution
impossible. Mathcad provides two constructs for optimization:
GivenFind
GivenMinerr
If you know your system DOES have an exact solution, then use the GivenFind
construct.
Otherwise use the GivenMinerr construct, which will provide a solution
whether or not an exact solution exists. The following examples demonstrate how each of
these constructs work.
The first example of optimization illustrates use of the GivenFind construct to determine
the optimal values of two resistors in a divider such that both the target output voltage and
target Thevenin resistance are obtained. First we need to create functions for calculating
the output voltage (VOut ) and the Thevenin resistance (ZOut ), specify the supply voltage
(Vs), and establish the constraints on the system (GoalV and GoalZ):
VOut( VS , R1, R2) := V S
Z Out( R1 , R2) :=
R2
R1 + R2
1
1
1
+
R1
R2
Output Voltage
Functions describing
circuit behavior to be
optimized
Output Impedance
VSupply := 5V
GoalV := 1.5V
Voltage
Optimization Goals
Impedance
GoalZ := 10k
R2 := R1
Page 8 of 8
February 3, 2005
R1_Found
:=
R2_Found
Find( R1 , R2)
It is important to note that the = signs used to define the constraints of the GivenFind
block are the Boolean Equals sign, obtained by clicking the icon on the Boolean Toolbar
(or typing <ctrl>=); this is NOT the standard give me the answer equals sign obtained by
typing = on the keyboard.
The results that Mathcad yields are:
R1_Found = 33.3333 k
R2_Found = 14.2857 k
Calling our original functions with the newly found resistor values we can check compliance
with the initial design constraints:
V Out( V Supply , R1_Found , R2_Found) = 1.5000
ZOut( R1_Found , R2_Found) = 10.0000 k
R2 := 10k
Given
V Out( V S , R1 , R2) = T V
ZOut( R1 , R2) = T Z
What this allows us to do is pass-in any set of target VOut and ZOut , and get-back a set of R1
and R2. For example:
Optimize_Rs1 ( 5V , 3V , 1k ) =
1666.6655
2499.9986
Optimize_Rs1 ( 12V , 3V , 1k ) =
4000.0009
1333.3333
24.0000
k
17.1429
Page 9 of 9
February 3, 2005
V Supply := 5V
GoalV 1 := 4V
GoalV 2 := 1.5V
R2 + R3
Top "Tap"
R1 + R2 + R3
Functions describing
circuit behavior to be
optimized
R3
R1 + R2 + R3
Bottom "Tap"
Top "Tap"
Optimization Goals
Bottm "Tap"
Next we make our guesses for the values of R1, R2 and R3:
R1 := 1k
R2 := 1k
R3 := 1k
Then we let Mathcad perform the optimization, telling it to force VOut1 to match GoalV1, to
force VOut2 to match GoalV2, and to force R1 to match R3 (i.e. same -valued resistors):
Given
V Out1( V Supply , R1 , R2 , R3) = GoalV1
V Out2( V Supply , R1 , R2 , R3) = GoalV2
R1 = R3
R1_Found
R2_Found :=
R
3_Found
Minerr( R1 , R2 , R3)
Again, please note that the three constraints in the GivenMinerr block utilize the
Boolean Equals sign.
The results that Mathcad yields shows us that it complied with the constraint of R1 = R3 :
R1_Found = 0.2500 k
R2_Found = 0.5000 k
R3_Found = 0.2500 k
However, calling our original functions with the newly found resistor values shows us that
the voltage constraints were not quite met:
V Out1( V Supply , R1_Found , R2_Found , R3_Found) = 3.7500 V GoalV1 = 4.0000 V
V Out2( V Supply , R1_Found , R2_Found , R3_Found) = 1.2500 V GoalV2 = 1.5000 V
Page 10 of 10
February 3, 2005
R1_Found
R2_Found :=
R
3_Found
Find( R1 , R2 , R3)
Whenever you attempt to perform an optimization using the GivenFind construct, and
you get this sort of error, try changing Find to Minerr and see what results you get;
perhaps there really was NOT an exact solution. In general the GivenMinerr construct
is the sure-bet; it will give an answer whether or not there is an exact solution.
Notice in the example below that if we unshackle the optimizer (remove R1=R3 constraint),
then the GivenFind has no problem in finding an exact solution:
R1_Found = 0.5950 k
R2_Found = 1.4876 k
R3_Found = 0.8926 k
Page 11 of 11
February 3, 2005
Low-Pass
Filtering
IN
Input from
Lo-Z Source
High-Pass
Filtering
Cin
Rin
Rfb
Vin
Vcc
Vcc
vcc
Rbias1
U1
Vbias
Rout
Output to
Hi-Z Source
OUT
Vout
vee
Cout
Rbias2
Op-Amp Parameters:
Vio = Input Offset Voltage
Iio = Input Offset Current
Iib = Input Bias Current
The heart of this circuit topology is op-amp (U1), arranged in an inverting amplifier
configuration. This analysis shall take into account the input parasitics of the op-amp,
namely the input offset voltage (Vio), the input offset current (Iio), and the input bias
current (Iib). Because this design uses a single-supply op-amp, the non-inverting (+)
input of the op-amp is held at a pseudo-ground voltage of mid-supply, created by a simple
resistor divider network consisting of Rbias1 and Rbias2. Part of the optimization process
will be to choose divider resistor values that minimize output offset (i.e. shift from the
desired mid-supply value).
The frequency-selectivity of the circuit is controlled by the RC elements in both the input
and feedback legs. Input resistor Rin and feedback capacitor Cfb form a low-pass "Pole",
while input capacitor Cin and feedback resistor Rfb form a high-pass "Zero". Additional
low-pass filtering is provided by optional output elements Rout and Cout, forming another
"Pole"; these elements can be eliminated if the required transfer function does not need
them.
The first step in our design process is to derive the transfer function for this circuit. To do
this we will make use of Mathcads Symbolics processor, just as we did with the simpler
inverting amp lifier. We begin by writing equations for each of the circuits reactive elements
(capacitors):
Eqn 1a := XCin =
1
2i Frq Cin
1
2i Frq Cfb
Eqn 1b := XCfb =
Eqn 1c := XCout =
1
2i Frq Cout
1
1
1
+
XCfb
Rfb
Page 12 of 12
February 3, 2005
Eqn 3b =
: IInv = Iib +
Eqn 3c =
: INonInv = Iib
Iio
Eqn 4a =
:
XIN
Eqn 4b =
:
Vin Vout
Vin Vout
XFB
Rout
Eqn 4d =
:
Vcc Vbias
Rbias1
Vout OUT
Vout OUT
Eqn 4c =
:
+ IInv
XFB
Rout
=
+ IOut
OUT
XCout
Vbias
Rbias2
+ INonInv
Lastly, we combine all of them in a Solve block, and let the Symbolics processor grindout an answer:
SysRes :=
Eqn1a
Eqn1b
Eqn1c
Eqn2a
Eqn2b
Eqn3a
Eqn3b
Eqn3c
Eqn4a
Eqn4b
Eqn4c
Eqn4d
OUT
Vout
Vbias
Vin
XIN
XFB
solve ,
XCin
X
Cfb
XCout
I
Out
IInv
INonInv
Because of the large number of terms and intermediary values, the results (contained in
SysRes) are too large to display directly. As you can see above, Mathcad doesnt even try
to display the results; however, the results ARE in the SysRes variable. In fact, even
stripping-apart SysRes to obtain the single result we care about (OUT), we get a long, ugly
mess of an equation that we cant fully reproduce here (but is visible in Mathcad by making
use of the horizontal scroll bar); the beginning of it looks like:
OUT := SysRes
)1
1 2 i Rbias2 Vcc + i Rfb Rbias2 Iio 4 i Frq Cin Rin Rbias1 Rbias2 Iio Rfb Cfb + 8
But, it doesnt really matter that we cannot easily READ the equation, since we are going to
assign it to functions that we can call numerically. The two functions we wish to create are
GAIN and OFFSET, as those are the two characteristics we will later optimize the circuit
around. We start-out by deriving equations for GAIN and OFFSET based on the full
James C. (Jim) Bach
Page 13 of 13
February 3, 2005
GAIN :=
OUT
IN
1 2
2
Notice that for deriving OFFSET we set the input signal (IN) to zero and we set the
frequency (Frq) to zero; this is a DC calculation with the input grounded. Similarly, when
deriving GAIN we set the power supply (Vcc) to zero, as we also do with all of the opamp input characteristics (Vio, Iio, and Iib); this is an AC calculation and DC terms need to
drop out. In both cases terms have been collected in order to obtain more readable
results; this allows observation of the contributions of key parameters of the calculation
(e.g. how Vcc and Vio affect the offset voltage of the circuit). Oddly enough, Mathcad
forces the derivation of GAIN to have IN as one of the collection terms even though
IN never actually appears in the resultant equation; for whatever reason, without that
collection term you will not receive a result.
Now that these two equations have been generated, we can assign them to functions that
can be called numerically (again, you cannot see the entire equation here):
Offset( Rfb , Rbias1, Rbias2 , Vcc , Vio , Iio , Iib ) := OFFSET i
Rbias2
1 2 i Rbias2 2 iRbias1
Vcc
Vio +
i Rbias1 i Rbias2
2
i Rbias1 i Rbias2
Gain( Frq , Rin , Cin , Rfb , Cfb, Rout , Cout , Rbias1 , Rbias2) := GAIN
1
( 4 Rfb Rbias2 + 4 Rfb Rbias1) Cin
2
( 8 Rout Rin
GaindB ( Frq , Rin , Cin , Rfb, Cfb, Rout , Cout , Rbias1 , Rbias2) := 20log( Gain( Frq , Rin , Cin , Rfb, Cfb, Rout , Cout , Rbias1, Rbias2
If we plug-in some initial values for the components (setting all resistors to 10k and all
capacitors to 0.01F), we can quickly determine the output offset voltage and plot the Bode
response of the circuit:
Rin := 10k
Rfb := Rin
Rout := Rin
Cin := 0.01F
Cfb := Cin
Cout := Cin
Vcc := 5V
Vio := 10mV
Iio := 1A
Rbias1 := Rin
Rbias2 := Rin
Iib := 0.1A
Page 14 of 14
February 3, 2005
10
20
Gain (dB)
30
40
50
60
70
80
0.01
0.1
1
Frequency (kHz)
10
100
Next, we wish to optimize the circuit so that it performs to some desired response. This
desired response (aka goal function) might be taken from a customer requirements
document, or from a specification created by the system designer. For this example, we are
going to fill a pair of vectors with Frequency/dB target points that we would like our filters
response to pass through. We can make use of an embedded Excel table to make the dataentry easy and professional looking:
Target Freqs
:=
Frequency
Target dBs
(Hz)
Gain
(dB)
10
32
100
320
1000
3300
10000
33000
-30
-10
0
0
0
0
-20
-50
As can be deduced by inspecting the table, we wish our filter to be flat from 100 to 3300
Hz, and have approximately 25dB/decade below and 45db/decade above that range.
Obviously, real world filters have slopes of 20 and 40 dB/decade, so, our optimized filter will
be close, but no gold cigar. There is NO way to exactly provide this shape, but, perhaps
we can create a filter that is good enough.
Before we can perform our optimization, we need to define an Error function, which the
optimizer will attempt to force to zero. For this example we will use a simple Sum of the
squared errors algorithm. This algorithm simplistically sums the square of the errors in
gain (dBs) at each of the target frequencies. The optimizer will call this function for each
permutation of component values that is attempted; when the optimizer finds a combination
that yields a minimal output from this function, it terminates and returns the optimal
values.
(
last TargetFreqs
= ORIGIN
(GaindB ( TargetFreqs n , Rin, Cin, Rfb, Cfb, Rout , Cout, Rbias1, Rbias2) TargetdBs n )2
Finally we use the GivenMinerr construct to optimize the circuit element values:
James C. (Jim) Bach
Page 15 of 15
February 3, 2005
1k Rfb 100k
1k Rout 100k
100pF Cin 1F
100pF Cfb 1F
100pF Cout 1F
Rin
Cin
Rfb
Cfb
:=
Rout
Cout
Rbias1
Rbias2
Page 16 of 16
February 3, 2005
Rbias2 = 9.9018 k
Rin = 8.6275k
Rfb = 13.5240 k
Rout = 26.9265 k
Cfb = 0.0054 F
Cout = 0.0027 F
Cfb = 5358.4219 pF
Cout = 2692.6482 pF
Cin = 0.0780F
4
Cin = 7.8032 10 pF
V Offset = 2.5000V
Gain 1kHz = 2.0310
We can plot our initial response and our optimized response as:
Optimized Design:
Initial Guess:
Frequency Response of Filter (Original)
20
20
Gain (dB)
Gain (dB)
40
60
0.01
40
0.1
1
Frequency (kHz)
10
100
60
0.01
Actual Response
Target Response
0.1
1
Frequency (kHz)
10
100
Actual Response
Target Response
Note that we needed to specify several points within the passband in order to force
Mathcads optimizer to keep the mid-band gain down. Without these ext ra points the
skirts become better matched and the mid-band gain became too large, as shown below:
Frequency Response of Filter (Optimized)
Gain (dB)
20
40
60
0.01
0.1
1
Frequency (kHz)
10
100
Actual Response
Target Response
In fact, with two minor modifications we can provide additional constraints to make some
target points more important than others:
- Add a Weighting Factor column to the data-entry table (see following examples)
- Modify the Error function to multiply the squared error by the weight
(
= ORIGIN
Weightsn (GaindB (TargetFreqs , Rin, Cin, Rfb, Cfb, Rout , Cout , Rbias1, Rbias2) TargetdBs )2
n
n
Page 17 of 17
February 3, 2005
:=
Frequency
(Hz)
10
32
100
320
1000
3300
10000
33000
Gain
(dB)
-30
-10
0
0
0
0
-20
-50
Weight
1
1
1
10
10
1
1
1
Gain (dB)
Target Freqs
Target dBs
Weights
20
40
60
0.01
0.1
1
Frequency (kHz)
10
100
Actual Response
Target Response
Specifying that the two corner frequency targets are 10X more important than the others
yields the following optimization results:
Frequency Response of Filter (Optimized)
:=
Frequency
(Hz)
10
32
100
320
1000
3300
10000
33000
Gain
(dB)
-30
-10
0
0
0
0
-20
-50
Weight
1
1
10
1
1
10
1
1
Gain (dB)
Target Freqs
Target dBs
Weights
20
40
60
0.01
0.1
1
Frequency (kHz)
10
100
Actual Response
Target Response
Conclusion
Mathcad is a very fast and powerful mathematical analysis package that can be used by
electrical designers to perform a variety of design and analysis tasks ranging from simple to
complex. The built-in symbolic processor allows us to easily construct complex transfer
functions from a simple collection of nodal equations. The built-in optimizer allows us to
easily arrive at optimal component values such that the circuit meets a given set of
constraints (targets). With these two features alone (and Mathcad has many more) EEs can
perform better, more accurate circuit designs than pen-and-paper me thods; in many
instances better, more efficient circuit designs than using circuit simulators (like SPICE).
Page 18 of 18
February 3, 2005
Biography:
Jim Bach received a BSEE (with a minor in Computer Science) from Marquette University in
1982. He began working for Delphi Electronic & Safety (DES) in 1986, when it was called
Delco Electronics. In his career at DES he has been a Systems Engineer, an Advanced
Development Engineer, an EE Simulation and Modeling Engineer, and now EE Analysis
Engineer and Mathcad Instructor.
His primary background is in Powertrain Electronics
(engine and/or transmission control modules), although hes assisted engineers in other
product lines. Primarily analog in nature, he enjoys working with circuits that interface
with sensors or control solenoids, as well as conditioning/filtering signals. Over the past few
years Jim has become DESs resident expert in utilizing Mathcad for performing design and
analysis tasks, to the point of having created an internal 6-day, 8-session Mathcad for
Engineers training class and hosting periodic Brown-Bag Lunch seminars. Jim enjoys
circuit design and analysis, and the analytical tool known as Mathcad; putting the two of
them together and teaching about it is both challenging and rewarding.
Abstract
One of Mathcads strong points is that it has a built-in symbolic processor, which can be
used to combine a collection of nodal (circuit) equations and synthesize a set of equations
(e.g. transfer functions) for the circuit. This provides a simple and automated method of
solving for N unknowns from N equations. The article explains how to use this feature to
create transfer functions for a simple circuit; later the article illustrates how to use this
feature to create the transfer function of a more complicated circuit (bandpass filter) and
create a numeric function that can be used for design optimization and analysis.
Another of Mathcad's strong points is that it has a built-in "optimizer" capability, which can
be used to adjust any number of system variables until a set of "goal" conditions have been
met, or met with minimal error. This allows the engineer to make some initial guesses for
component values, and then have Mathcad figure-out what the optimal values would be
(say, to obtain a desired frequency response in a multi-stage filter network). The designer
can constrain component values to particular ranges, to prevent the optimizer from finding
problematically too small or too large of values. The designer can also create his own
Error function, which can be used to control the weighting of trade-offs in the optimization
process. This article explains how to use the optimizer to determine component values of a
simple circuit in order to make it meet some criteria; later the article illustrates how to use
this feature to optimize a more complicated circuit (bandpass filter) so that it approximates
a desired Bode response.
James C. (Jim) Bach
Page 19 of 19
February 3, 2005