Sunteți pe pagina 1din 107





 
 

Developed

by

Ronald H. Rockland, Ph.D.


EET 300 Computer Applications Manual

TABLE OF CONTENTS

INTRODUCTION.........................................................................................................................................5

LESSON 1 – INTRODUCTION TO MATHCAD .......................................................................................7

STARTING MATHCAD......................................................................................................................................... 8

ARITHMETIC OPERATIONS ............................................................................................................................... 9

ENTERING FORMULAS ..................................................................................................................................... 10

COMPLEX NUMBERS ........................................................................................................................................ 11

AUTOMATIC MODE ........................................................................................................................................... 11

INSERT FUNCTION............................................................................................................................................. 13

UNIT CONVERSION ........................................................................................................................................... 14

USING THE MATH PALETTE............................................................................................................................ 15

COPYING FROM MATHCAD TO WORD ......................................................................................................... 16


ASSIGNMENT 1 ..............................................................................................................................16
SETTING UP A FUNCTION IN MATHCAD...................................................................................................... 17

INTEGRATION AND DIFFERENTIATION - MATHCAD................................................................................ 18

GREEK SYMBOLS............................................................................................................................................... 20
ASSIGNMENT 2 ..............................................................................................................................20
GRAPHING IN MATHCAD................................................................................................................................. 21
ASSIGNMENT 3 ..............................................................................................................................23

LESSON 2 – INTRODUCTION TO PSPICE ............................................................................................24

OVERVIEW .......................................................................................................................................................... 25

USING SCHEMATICS ......................................................................................................................................... 27

SEARCHING FOR PARTS................................................................................................................................... 30

ARRANGING PARTS........................................................................................................................................... 31

CONNECTING PARTS ........................................................................................................................................ 33

CHANGING PARTS ATTRIBUTES.................................................................................................................... 34

Page 2
EET 300 Computer Applications Manual

SAVING A SCHEMATIC FILE............................................................................................................................ 37

COPY/PASTING PARTS...................................................................................................................................... 38

UNDO/REDO ........................................................................................................................................................ 40

REDRAW AND ZOOMING ................................................................................................................................. 41

WORKING WITH WORD 97............................................................................................................................... 43

MEASUREMENTS - DC ANALYSIS .................................................................................................................. 45

EXPLANATION OF PROBLEMS........................................................................................................................ 48
PROBLEM 1.....................................................................................................................................49

LESSON 3 - TRANSIENT ANALYSIS WITH RC AND RL CIRCUITS ................................................50

PULSE VOLTAGE SOURCE ............................................................................................................................... 51

UNIT STEP............................................................................................................................................................ 52

SETTING UP THE TRANSIENT ANALYSIS..................................................................................................... 53

PERFORMING THE TRANSIENT ANALYSIS.................................................................................................. 55

CHANGING BACKGROUND COLORS IN PROBE .......................................................................................... 56

SPECIAL MARKERS ........................................................................................................................................... 59

MODIFYING GRAPHS ........................................................................................................................................ 61

PRINTING AND COPYING GRAPHS ................................................................................................................ 64

SWEEPING A COMPONENT VALUE................................................................................................................ 65

USING THE VPWL SOURCE.............................................................................................................................. 68

USING THE DIFFERENTIATOR AND INTEGRATOR .................................................................................... 70

WORKING WITH CUSTOM AXIS ..................................................................................................................... 72


PROBLEMS 2-5 ...............................................................................................................................75

LESSON 4 – LAPLACE TRANSFORMS USING MATHCAD ...............................................................77

LAPLACE TRANSFORMS .................................................................................................................................. 78


ASSIGNMENT 4 ..............................................................................................................................79
ROOTS OF AN EQUATION ................................................................................................................................ 80
PROBLEMS 6-7 ...............................................................................................................................81

LESSON 5 – LAPLACE TRANSFORM IN PSPICE ................................................................................82

Page 3
EET 300 Computer Applications Manual

USING THE LAPLACE COMPONENT .............................................................................................................. 83


PROBLEMS 8-9 ...............................................................................................................................84

LESSON 6 – SINUSOIDAL STEADY STATE IN PSPICE......................................................................86

MEASURING DIFFERENCES WITH CURSORS .............................................................................................. 87

MARKING SPECIFIC VALUES ON THE GRAPH ............................................................................................ 89

GENERATING MULTIPLE PLOTS .................................................................................................................... 91

USING THE VSIN SOURCE................................................................................................................................ 92

SIMULATING A BODE PLOT ............................................................................................................................ 93


PROBLEMS 10-11 ...........................................................................................................................95

LESSON 7 – FOURIER ANALYSIS .........................................................................................................98

FOURIER ANALYSIS - MATHCAD................................................................................................................... 99

FOURIER ANALYSIS - PSPICE........................................................................................................................ 101


PROBLEMS 12-13 .........................................................................................................................103

APPENDIX - PROBLEMS IN THE TEXTBOOK ..................................................................................104

INDEX ......................................................................................................................................................107

Page 4
EET 300 Computer Applications Manual

INTRODUCTION

T
his manual is intended to reinforce concepts brought up in class discussions for EET 300,
and will help you understand two relevant computer applications. One of these
applications is called PSpice®, and is a registered trademark of Cadence Corporation.
PSpice is a simulation program that can help you understand basic circuit theory and related
topics to EET300. The other application is called MathCAD®, which is a registered trademark
of Mathsoft, Inc., and is an equation solving application that allows you to view equations as you
would normally write them. Although Mathcad might seem similar to Equation Editor, found in
Microsoft Office products, MathCAD has far more capabilities.
This manual is intended to help students get started using both programs. Additional information
can be found in the online help documentation that comes with these programs. In addition, for
Mathcad I would suggest a book by Ronald W. Larsen, entitled Introduction to MathCAD,
Prentice Hall. Many of the MathCAD books I have reviewed use very abstract examples, and
can be more confusing that Mathsoft’s own guides. This book is small enough to go through
fairly quickly, yet thorough enough to cover most topics.
PSpice is a circuit simulation software, and the output of various circuits can be analyzed, with
respect to both time and frequency. MathCAD is a mathematical analysis tool, and can be used
to create your own examples, solve them theoretically, and then confirm those answers by having
MathCAD solve the examples. MathCAD will be value for certain topics that will be covered in
the EET 300 course, such as complex numbers, adding sinusoids, integration and differentiation
of various functions, Laplace and inverse Laplace transforms and solving algebraic equations.
MathCAD can also be used to create the graph of a theoretical derivation of a circuit, and then
you can use this graph to compare it to the output from PSpice.
This manual will be oriented to using version 8.0 of PSpice. Versions higher than 8.0 have
changed dramatically, and are not as easy to use. The system requirements for this version is any
486 or Pentium (Pentium 133 or higher would be preferable), 16 MB RAM, Microsoft®
Windows® 95, and a CD-ROM drive. You will be told during the first class how to obtain a
copy of PSpice.
The same procedures that are written in this manual can be used for versions 6.1 and higher of
PSpice. For these earlier versions, some of the toolbars, command words, or dialog boxes will
appear slightly different. However, the functionality of the program is the same as described in
this manual.
Many of the standard features of Schematics and Probe will be covered within the first two
lessons. Additional features that are specific to the other lessons will be covered in the
respective sections. Exercises are given throughout this manual to help reinforce the concepts,
and problems are given at the end of each lesson that are required by each student to complete.
Mathsoft, through its website www.mathsoft.com, provides a free product called MathCAD
Explorer. This product demonstrates most of the features of MathCAD 8.0, although you can’t
save any files, nor use the OLE features of MathCAD in products such as Microsoft® Word.
However, this Explorer version will allow you at each session to work with the full product
features, open worksheets that have been created, modify them, and print them. MathCAD

Page 5
EET 300 Computer Applications Manual

Explorer allows you to also create new worksheets and copy/paste the results to a Word
document. This version also comes with a complete Help file. You will be given standard
worksheets to modify, along with a blank worksheet to use.
The purpose the Mathcad portion of this manual is to help you learn MathCAD quickly. Only
certain topics that will be useful to EET 300 students are covered. The discussion on each area
will be very limited – only how to do something and illustrations as to how to accomplish that
task. The worksheets that are in this manual can be downloaded from my home page. You can
open them using MathCAD Explorer, and change the functions to see different results. I would
encourage most students to modify these worksheets, and thus create additional examples. Do
not use Mathcad as a substitute for deriving equations – you need to get the practice. Rather, use
Mathcad as a means to verify that the derivation is correct.
The best way to study a technical course, such as EET 300, is to continuously solve examples.
Both these applications will help you do that, as well as visualize an answer that might otherwise
be just an equation.
In this manual, items to be clicked are bolded and keys that are to be pressed are enclosed in
arrow brackets < >. Tips that are general in nature are preceded with a  symbol, and programs
are italicized. When the word “choose” is seen followed by a bolded expression (usually with a
comma between words) this means to click on the menu bar. The word click will refer to
pressing the left mouse button, unless otherwise stated.
To help you learn PSpice, I have included examples that you can experiment with as you are
reading the specific sections. These examples are not to be handed in to me. The explanation of
the problems that you need to hand is on page 48, and the problems start on the next page. The
Mathcad assignments are noted after each section, and start on page 16. Both the PSpice
problems and the Mathcad assignments are to be handed in, according to the schedule you will
receive on the first day of class. In some cases, you will be asked to use Mathcad to plot the
theoretical work, and compare it to PSpice. This will be part of the PSpice problem.
All the Mathcad worksheets that are in bold can be downloaded from my website,
http://www-ec.njit.edu/~rockland.

Page 6
EET 300 Computer Applications Manual

LESSON 1 – INTRODUCTION TO MATHCAD

You will Learn:

 How start Mathcad.

 How to enter and move text.

 How to enter a formula, and define a variable.

 How to work with arithmetic calculations

 How to work with complex numbers

 How to use the automatic mode

Page 7
EET 300 Computer Applications Manual

STARTING MATHCAD

When you open up a file in MathCAD, you are actually in a workbook. If you have MathCAD
Explorer, you will see text (hyperlinks) above. In both cases just click anywhere in a blank
section of the page.
You will see a small red cross, which is a placeholder for the beginning of entering text or an
equation.

Entering and Moving Text


1- To enter text, rather than an equation, type a quotation mark, and then start typing the text.
You will see text being typed, and a box surrounding the text. The font, if you haven’t
changed it, will say Normal, which is Arial 10 pt. If you press <Enter>, you can type a
second line of text. To start typing somewhere else in the worksheet, click somewhere else
in the worksheet.

2- If you want to move the text, move the mouse pointer over the edge of the text box. You
will see an open hand.

3- Click and hold the mouse button, and drag this text box to a new position.

This is the method for moving any text or formula box.

 If you want to move to a new area, and start typing in a formula, just click on another blank
area, and start typing without the quote. If you just type in letters and then a space,
MathCAD assumes that you want a text box, and will convert the letters you typed to a text
format. When you type a formula, the font is called variables, and is Times Roman 10 pt.
For both text and equations, the font can be changed.

Page 8
EET 300 Computer Applications Manual

ARITHMETIC OPERATIONS

Various mathematical operations can be performed on both numbers and variables. This include
addition (+), subtraction (-), multiplication (*), division (/), and exponentiation (^). The
difference between MathCAD and most other solution oriented applications is that MathCAD is
a WYSIWIG application (What You See Is What You Get). When you type with a /, you get a
fraction that looks like an equation editor fraction. When you type with an asterisk as a multiply
sign, you get a dot between the two numbers or variables. When you type a ^, the exponent is in
superscript (i.e. 32 rather than 3^2).

Arithmetic Calculations
1- Type in the first number, type in the appropriate arithmetic operation, and then continue until
you are finished.

2- Type in an equal sign (=), and then press <ENTER>. MathCAD will calculate the results.

Example:
7
7 .8 = 56
6
8 = 15 8 = 1 = 0.875 7 = 5.765 10
8
7 7
8

Page 9
EET 300 Computer Applications Manual

ENTERING FORMULAS

MathCAD expects you to first define variables before you use them in an equation or calculation,
such as determining an integral or multiplying complex numbers. To define a variable, you need
to type a series of letters (there are certain limitations on naming variables – see the Help section
for that limitation). The process of defining a variable is actually called assigning.

Defining a Variable
1- Type in the variable name. One caution is not to use something that might be a unit, such
as deg, or an operation, such as integ.

2- Type in a colon (:). You will see the variable name and then a colon followed by an equal
sign. This is the assignment equality.

3- Type in the rest of the definition for the variable. . If you want a subscript as part
of the variable name, type a period before typing the subscript.

 You must define all variables before you use them in an equation. Otherwise, you will see
one of the elements in the final equation with a red color. This indicates that one of the
variables is not defined. Mathcad works from top down and from left to right. You must
define the variable above and/or to the left of where you are using the variable in an equation.

Page 10
EET 300 Computer Applications Manual

COMPLEX NUMBERS

To understand how to manipulate complex numbers, you should define several different complex
numbers before performing the operation. When you type in a complex number, you must type
the imaginary quantity before you type in the j, such as 5 + 3j, as opposed to 5+j3. If you type an
imaginary number such as 5+j3, you will get an error. Note: if you are just typing in a j, such as
1+j, make sure you type it as 1+1*j.
When typing in complex expressions, it is important to understand how MathCAD determines
what portion of the expression to use. Try typing in a blank area the expression B*C (do not
press <Enter>). You will notice that a blue line appears to the right of the letter C, indicating the
next position to type. You should also notice that there is a bottom cursor, or underline, which is
currently under the letter C. If you typed in a slash (/) followed by the letter D, you will see the
following expression .C
B
D
Delete this expression (by depressing the mouse button, dragging over the expression, and
pressing the delete key). Retype the same expression B*C below. This time, press the spacebar.
Notice that the bottom blue underline is under both the B and the C term. When you type in a
slash (/) followed by the letter D, you will now see the following expression B.C
D

Make sure you observe where the blue underline is prior to typing in an equation. Also, if you
already typed an equation, and want to edit it, simply click inside the equation and press the
space bar the appropriate number of times.
Before looking at a sample worksheet, there is another feature of Mathcad that you should be
aware of - the Automatic Mode.

AUTOMATIC MODE

The automatic mode allows you to redo an expression, or redefine a variable, and automatically
recalculate the results below. When you start Mathcad, you are in automatic mode, and can verify
it by looking at the lower right hand side of the Mathcad window (the message line). The word
Auto should appear. This automatic mode applies to calculations as well as graphs, and is very
useful when you want to see how changes in one variable affect another, or affect a graphical
output.
An example of both setting up the complex numbers, as well as observing what the automatic
mode will do, can be seen from the worksheet Complex Numbers.mcd, as shown on the
following page.

Page 11
EET 300 Computer Applications Manual

A 5 5j
B 2 3j
C 6 j

D 2 5j

A
= 0.517 1.207i
D

B .C
= 3.793 1.483i
D

A C .D
= 9.462 + 2.308i
B

The advantage of setting up a worksheet in this manner is that you can go back to one of the
expressions, click and drag over the numbers to the right of the equal sign, type in a new
complex number, and when you click outside that area, or press <Enter>, all the expressions will
be recalculated automatically. In this manner, you can set up your own problems, try to solve
them on your own first, and then look at the answers. This should be your approach to all other
worksheets.

Page 12
EET 300 Computer Applications Manual

INSERT FUNCTION

There are many instances where you need a specific function to perform a calculation, such as
statistical analysis (mean, median, variance) or complex numbers (real and imaginary). To do so,
you can use the insert function button on the toolbar.

Inserting a Function
1- Click in the worksheet where you want to insert the function.

2- Click on the function button, located in the toolbar.


The Insert Function dialog box will open.

3- Choose the appropriate function. You can type in the first letter of the function, and the
dialog box will point to the first word with that letter. You might want to look at Help so that
you know what function to choose.

For example, if you want to calculate the magnitude and phase angle, you might need to use the
Im (A) and Re(A) functions. Note that A does not mean that this will only work with the
variable A that you defined above – you can write the function as Re(B), Re (B/C), etc.

An example of using the Re and Im functions is given below:

To convert from rectangular to polar, you need to derive magnitude and phase

2 2 Im( A )
magA Re ( A ) Im( A ) phaseA atan
Re( A )

magA = 7.071 phaseA = 0.785

Page 13
EET 300 Computer Applications Manual

UNIT CONVERSION

There might be instances where you need to display units that are different from the actual
function. For example, phase would normally be calculated as radians, but it is easier to
visualize phase in degrees. Mathcad automatically will apply the necessary conversion factors, if
you “tell it” what units you want.

Unit Conversion
1- Click in the result to see the unit placeholder. For example, in the example on the previous
page, phaseA is in the radians. When you type phaseA =, what you will see is

. Note the mark after the 0.785 – this is the placeholder.

2- Move the mouse over the placeholder, and click. You will now see the placeholder

underlined.

3- Type any combination of units in the unit placeholder. You will see the placeholder, a small

diamond marker, and the units you typed in.

4- Click outside the expression to redisplay the result in terms of the selected units. You will
know see the phase as phaseA = 45 deg .
5- If you change the variable A, the phase will be recalculated automatically in degrees.

The example on the previous page now looks like the following:

2 2 Im( A )
magA Re( A ) Im( A ) phaseA atan
Re( A )

magA = 7.071 phaseA = 45 deg

Page 14
EET 300 Computer Applications Manual

USING THE MATH PALETTE

One of the most useful features in MathCAD is the Math Palette. This is a series of buttons,
which will allow you to get most of the features of MathCAD, as well as type in equations with
the appropriate symbols. By clicking on any of the buttons in the Math Palette, you will produce
additional Palettes (buttons) for specific functions. If the Math Palette is not visible, choose
View from the menu bar, and see if the word Math Palette has a checkmark. If not, click the
word Math Palette. Usually it is floating, but sometimes it can “anchor” in one of the other
toolbars. Many of the button functions can be accomplished by using shortcut keys.

Arithmetic Palette – for


Evaluation and Boolean
trig, roots, factorial,
Palette – for logical
exponential
expressions

Vector and Matrix


Graph Palette – for Palette – for matrix
graphing functions algebra and vectors

Programming Palette –
Calculus Palette –
for setting up programs
for integration and
in MathCAD
differentiation
Symbolic Keyword
Greek Symbol Palette – for solving
Palette- for getting equations, Laplace and
all the symbols Fourier analysis

For example, instead of defining the magnitude as the square root of the sum of the squares, you
can define magnitude as the absolute value. That button can be found in the Arithmetic palette.
Also, instead of defining the phase angle in terms of the arctangent, you can use the function
arg(A), found by using the insert function button. The previous example could then be expressed
as the following:

phaseA1 arg( A )
magA1 A

phaseA1 = 45 deg
magA1 = 7.071

Page 15
EET 300 Computer Applications Manual

COPYING FROM MATHCAD TO WORD

In many cases, you might want to include mathematical expressions in your Word document or
your PowerPoint presentation. MathCAD can be easier to work with than Equation Editor can.
One reason is that you can solve an equation, rather than having to type in the solution as well.
The second reason is that when you type in a ^ followed by a number, MathCAD will
automatically create the correct expression without you having to click on a superscript icon and
type in the number.

Copying from MathCAD to Word


1- Open the MathCAD file you want to copy.

2- Move the mouse pointer above and to the left of the area you want to copy. Click and hold
the mouse button, and drag it down and to the right, until you have enclosed the
expressions you want to copy. You will see dotted lines around each area that will be
copied.

3- Choose EDIT…COPY from the menu bar.

4- Go to your Word document, and click where you want to paste. Choose Paste…Special
from the menu bar, and uncheck the box marked Float over Text.

5- Click the OK button. You might need to resize the object you copied. To do so, click once
on the object, move the mouse button to the lower right black box (selection handle) and
click and hold the mouse button until you are satisfied with the size of the object.

ASSIGNMENT 1

1. Let A1=3+j2, A2=-1+j4, B=2-j2. Determine C=(A1 x B)/A2 theoretically (show full
calculations on a sheet of paper) and then confirm using MathCAD. Theoretical results can
be in pencil, MathCAD results must have printout.
2. Develop the formulas, using MathCAD, to change from rectangular to polar, and from polar
to rectangular. Try using the variable in example 1, showing the two forms of the all the
complex numbers above.
3. Copy the results of problem 2 to Word. Before you copy the results, type in your name, class,
date, and retype the description of problem 2.

Page 16
EET 300 Computer Applications Manual

SETTING UP A FUNCTION IN MATHCAD

In many operations, such as integration and differentiation, you need to first define a function,
which may be dependent on one or more variables. Once you have defined a function, such as
v(t), and then performed the mathematical operation below, such as integration, modify the
original function and, by pressing <Enter>, a new result will automatically be calculated.

Setting up a Function
1- Click anywhere in the worksheet, and type a letter, or expression, followed by a parenthesis.
Inside the parenthesis should be the independent variable. For example, f(x) or vout(t). If
you want to define a function that is dependent on more than one variable, separate each
variable with a comma (such as f(t,x).

2- Type in the colon symbol, which will set up the assignment equality, :=.

3- Type in the expression with the independent variable(s).

The example below shows several functions:


f( t ) sin ( 2 .t )

3
g( t ) 1
t

t
f( t , x) 2 x

 Mathcad is case sensitive, so the variable t and the variable T are not the same. If you get an
error (the expression is in red) make sure that there are no other variables that are not defined
above the function. In the example below, u appears to be a variable. However, it is defined
before the function that uses it.
u 3

3 .u
g( t ) 1
t

Page 17
EET 300 Computer Applications Manual

INTEGRATION AND DIFFERENTIATION - MATHCAD

To experiment with both integration and differentiation, you need to set up a variable (by
assigning it to an expression), and then solve for the expression symbolically. When you click
outside the expression, or press <Enter>, MathCAD will solve the expression in terms of the
independent variable. If you back to the original expression and change it, MathCAD will
automatically recalculate the new solution.

Integration and Differentiation


1- Set up the expression, with the variable on the left side of the assignment equality, such as
v(t), type in a colon to get the assignment equality, and then type in the expression.

2- Click somewhere below the expression in item 1, and using the Calculus Palette, click either
the indefinite integral or derivative.

3- You will see placeholders for both the expression and the variable. You can either use the
mouse to go from one placeholder to another, or use <Tab>. For an indefinite integral, you
should have something that looks like the following:

f( t ) d t

For differentiation, you should have something that looks like the following:

d
f( t )
dt
4- After you type either expression, hold down <Ctrl> and press the period. This will cause an
arrow to appear to the right of the expression. This is called Symbolic Evaluation, and can
also be accomplished by opening up the Symbolic Keyword Palette and clicking on the
appropriate button. However, the shortcut is easier to use, and you will use it a lot

5- Press <Enter> or click outside the formula box, and the expression will be evaluated. By
setting a worksheet up in this manner, you can easily change the original expression, and
test out your integration and differentiation skills. If you want a definite integral, you need to
type in the limits, and then type an equal sign after the expression, rather than solve for it
symbolically.

Note that when you open a palette, and hold the mouse over a button, a tooltip appears. This
will not only tell you the purpose of the function, but also the shortcut key.

Page 18
EET 300 Computer Applications Manual

From the worksheet Integration and Differentiation.mcd

Integration and Differentiation

First, define the variable

f( t ) sin ( t )

then, type in both an integral and a derivative sign on the function,


followed by the symbolic evaluation symbol, <Ctrl> plus a period.

f( t ) d t cos ( t )

d
f( t ) cos ( t )
dt

You can now go back and change f(t)'s expression,


and MathCAD will recalculate everything

Page 19
EET 300 Computer Applications Manual

GREEK SYMBOLS

In this course, you will be using symbols such as Ω and ω. While you can use the Greek Symbol
Palette, a shortcut method would be to type in a letter, followed by <Ctrl><G> (hold down both
<Ctrl> and the letter G at the same time). This will produce the Greek letter equivalent. The
problem is trying to remember what equivalents are. Some of the more common ones that will
be used in EET 300 are listed below. Since the symbol π is used all the time, Mathcad has a
simple shortcut for that symbol - <Ctrl><P>.

English Letter Greek Symbol

w ω

W Ω

t τ

a α

m µ

q θ

For Greek symbols that are different from the above, use the Greek Symbol Palette.

ASSIGNMENT 2
1. Look at all the buttons on the Math Palette. Which palette does the function absolute value
appear? Which palette does the function complex appear? What is the help definition of
both functions?
2. Integrate and differentiate the following functions: e-2t , 2cos (3t), 2cos (2πt), e-3tsin(2ωt) and
xsin(x). Discuss any difficulties you had with any of these three functions. Try to do these
functions theoretically first.
3. Integrate sin(t) from 0 to 2π. (Hint- there is a definite integral in one of the palettes).
4. Do the second derivative of sin(t) and e-t. (Hint- there is a way of doing higher order
derivatives in one of the palettes).

Page 20
EET 300 Computer Applications Manual

GRAPHING IN MATHCAD

You can graph the results of your calculations very easy using Mathcad. When you graph a
function, you first need to set up a range for the independent variable. There are three parts to
this range – the initial value, the increment, and the final value. An increment can be left off, but
the default will be 1, and it might be produce a graph that looks unusual. Try to use increments
that make sense. This range can also be used to produce a non-graphical result of the function
vs. the independent variable.
When you are graphing functions that would involve sine or cosine, you might want to have as
the final value (or increments) some function of pi.. If you are not sure of the range, then you can
initially graph without defining the range for the independent variable. Usually you will get a
graph that is centered around the origin. Once you observe the graph, you can insert the range for
the independent variable in a location that is below where you define the function, but above
where the graph is placed.

Setting up a Range for an Independent Variable


1- Below the variable expression which used the independent variable, type the variable, such
as t, followed by the assignment expression (colon).

2- Type in a number, which will be the initial point for the graph.

3- Type a comma followed by a number or expression that represents the increment.

4- Type a semicolon, which will produce two dots, followed by a number or expression that
-t
represents the final value. For example, if you wanted to plot e from 0 to 4, with an

increment of .01, then the variable t would look like t 0 , .01.. 4


5- Press <Enter>.

Graphing
1- Below the range and the definition of the function, type the function, such as f(t), followed by
the @ sign (<Shift><2>). You will see the outlines of a graph.

2- Click anywhere outside that graph, and the graph will be produced. You can also type the
@ sign first, and then type in the placeholders in the graph the function and the independent
variable.

Page 21
EET 300 Computer Applications Manual

3- If you want to resize the graph, click once on the graph, point to the lower right hand side of
the graph (on top of the small black box) and the mouse pointer will change to a double
arrow. Drag it to the right and down, and the graph will enlarge.

4- If you want to graph two functions, click next to the first function in the graph, make sure the
underline is under the entire expression, and type in a comma, followed by the new function.

Note – If you want to just graph the function, you do not have to initially define the range for the
independent variable, such as t. You will get a graph, and then based on that graph, insert just
above the graph the range, as described in the previous page.

From the worksheet Graphing.mcd

Graphing Examples

f( t ) sin ( t )

g( t ) cos ( t )

t 0 , .01.π .. 2 .π

0.5

f( t )
0
g( t )

0.5

1
0 2 4 6 8
t

Page 22
EET 300 Computer Applications Manual

ASSIGNMENT 3

1. Do problem 2-36 in the text theoretically. Then plot the addition of the two functions using
MathCAD, as well as the result of solving problem 2-36 (on a separate graph). They should
be the same graph.
(a) Are they the same graph?
(b) What are some of the difficulties you encountered in the MathCAD assignment? (Hint-
you might want to plot each of the two functions separately first).
(c) How would you determine the phase angle from the resulting graph in this example?
2. For extra credit, plot the product of these two functions, describe what you observe, and
could you mathematically have determined the plot? If so, how?

Page 23
EET 300 Computer Applications Manual

LESSON 2 – INTRODUCTION TO PSPICE

You will Learn:

 How start PSpice.

 How to add parts to a schematic.

 How to search for a part.

 How to move and rotate parts.

 How to connect parts.

 How to change the attributes of a part.

 How to save a schematic file.

 How to copy and paste a part.

 How to use the Undo/Redo feature

 How to use Redraw and the Zooming feature

 How to incorporate schematics in Word 97

 How to perform simple DC analysis measurements

Page 24
EET 300 Computer Applications Manual

OVERVIEW

The three main programs that will be used in the evaluation software are Schematics, PSpice and
Probe. Schematics is the program that builds circuits by having you “draw” them on a monitor,
and save them to a file with an .sch extension. PSpice is the software that is used to analyze the
circuit created by Schematics, and to generate solutions. To graph these solutions a third
application, called Probe, will be used.

Getting Started
1- Click on the Start button. The pop up menu appears.

2- Point to the word Programs. A pop up menu appears.

3- Point to the word DesignLab Eval 8. You will see the pop up menu with all of the
evaluation programs.

4- Point to the word Schematics and click. The Schematics window will open.

You will see a Windows based program, MicroSim Schematics (will change with OrCad
version), with a menu bar and icons both below the menu bar and on the left side of the page.
You will also see a blank area with blue letters on the top and left side of the page. To start
drawing a schematic, part need to be placed on the page.
In version 8.0, you will see on the Taskbar two additional programs, which are minimized.
These programs are MicroSim Message Viewer and DesignLab Design Manager. Additional
descriptions of these programs will be provided later on.
You will also see a status bar on the bottom of the window. This will be used for prompts and
cursor coordinates.

Page 25
EET 300 Computer Applications Manual

Tool Bars

Status Bar

Schematics window

Page 26
EET 300 Computer Applications Manual

USING SCHEMATICS

Schematics is a schematic capture front-end program that provides a convenient system for:
· creating and managing circuit drawings
· setting up and running simulations using PSpice
· evaluating simulation results using Probe
An important prerequisite to building a schematic is the availability of the necessary parts (in the
form of symbols) for assembly. Schematics has an extensive symbol libraries and a fully
integrated symbol editor for creating your own symbols or modifying existing symbols. For the
labs you will be using the existing symbols.
A schematic consists of symbols, attributes, wires, buses and text items. Parts are electrical
devices that make up a circuit, such as resistors, operational amplifiers, diodes, voltage sources
and digital gates. The graphical representation of a part is a symbol. You can add additional text
to the schematic.

Adding Parts To A Schematic


1- Choose Draw…Get New Part from the menu bar, or click on the Get New Part button

located in the toolbar. The Part Browser Basic dialog box appears. The description
for the button is in the Tooltips, which are the yellow background words just under the
mouse pointer. A more detailed description appears in the status bar, located at the bottom
of the window.

2- Either type the first letter of the part in the Part Name field or scroll down the list until you
see the part name or number. If you type in the first letter the scroll list below will
automatically go to a part with that letter.

3- Select the part by clicking on the appropriate name in the list box. The part will appear in
the Part Name field.

4- To place a part on the drawing page, first click on the Place and Close button. Then move
the part to approximately where you want it, and click on the left mouse button. The part will
appear to be attached to the mouse icon. Once you click on the left mouse button the part
will appear on the page, and still attached to the mouse icon.

You can place multiple instances of this part by clicking on the left mouse button each time.

When you are placing a part, you will see a package reference (which will designate that part)
and a value attribute (which shows the value of that part).

5- When you are finished, click on the right mouse button. The part will no longer appear to be
attached to the mouse icon.

Page 27
EET 300 Computer Applications Manual

6- If you want another part, then repeat items 2-5. Otherwise, click on the Close button.

If you only want one part from this dialog box, after choosing it you can click on the Place and
Close button. The Part Browser Basic dialog box closes.

 You can click on the Place button in the Part Browser dialog box, rather than the Place and
Close button. This will enable you to choose another part without opening the dialog box.
However, you might find this as difficult, since you will have to move each part after placing
it.

 The dialog box above will be different for Versions 6.0 and 6.1. Starting with Version 6.2, it
will be the same.

 If you click on the Advanced button, you will see a picture of the part, before placing it (see
dialog box on right). To get back to the original shape of the dialog box, click on the Basic
button.

Page 28
EET 300 Computer Applications Manual

Adding Parts To A Schematic Using The Get Recent Part List


1- Click on the drop down list, located on the right side of the first line of tools.

2- Click on the item you want to place.

3- Move the mouse onto the drawing page. If you want the part rotated before you place it,
then press <Ctrl-R> prior to clicking on the left mouse button.

4- To place the part, click on the left mouse button. Continue to click on the left mouse button
to place multiple copies. When you are finished placing that part, click on the right mouse
button.

 The recent part list shows the most recent parts that you use (the last 10 parts), and would
probably be a good source for many of your schematics.

EXERCISE

1- Open Schematics.
2- From the Get Recent Parts Dialog box, obtain a resistor and place it on the page, by
moving the mouse pointer onto the page and clicking on the left mouse button. Note that
R1 is the package reference, and 1k is the value attribute (the default value).
3- Move the mouse pointer to the right of the first resistor and place a second resistor. Note
that this second resistor has a package reference R2.
4- Click on the right mouse button to stop placing resistors.
5- Click on the Get New Part icon, and find a part called VDC. Place it to the left of R1. It
will be easiest to click on the Place and Close button in Part Browser dialog box.

Page 29
EET 300 Computer Applications Manual

SEARCHING FOR PARTS

There might be times where you do not know the abbreviation of the part, and are having a
problem finding the part. You can use a description search to find a part (or group of parts) that
has that characteristic.

Using The Description Search Feature Of The Part Browser Dialog Box
1- Open the part browser dialog box, by clicking on the Get New Part button located in the

toolbar. .

2- In the description search field, enter a general description of the part (i.e. ground, power
supply).

3- Click on the Search button. A list of those parts, which contain the phrase you entered, will
appear.

EXERCISE

1- In the current drawing page, open the Part Browser dialog box. Make sure the Advanced
button has been clicked.
2- In the description search field, type in the word ground, and click on the search field.
3- Click on each of the ground parts, and observe the description and picture.

Page 30
EET 300 Computer Applications Manual

ARRANGING PARTS

Once you have all the parts on the drawing page, they need to be arranged. This includes moving
them relative to one another and rotating the parts to get the correct orientation. By default,
voltage and current sources are placed vertically and passive components (RCL) are placed
horizontally. You can also delete parts that were accidentally placed on the drawing page.

Moving Parts
1- Double click on the Visio icon.

2- Select the part by clicking it. The part will turn red. Caution: Only single-click, do not
double-click the part.

3- Move the mouse icon over the part. You will see the mouse icon change, and a
double/double white arrow will appear on the lower right of the mouse icon. With the mouse
icon on the part, click and hold the part, and move it to the position you want. The part will
not move smoothly, but rather snap into position based on the grids (grids are used to make
the parts line up).

If the grid is not visible, and you want it visible, then select Options…Display Options and
click in the checkbox next to Grid On.

When you paste these circuits to another application (to be discussed later) it is recommended
to turn the grid off

4- If you want to move more than one part at a time, select the first part, and hold down
<Shift> while selecting additional parts.

Another way to select multiple parts is to position the mouse pointer to the left and above the
group of parts you want to select, click and hold and draw a box around those parts. All the
parts within the box will turn red.

 You can also move a label (either a value or the part number) by repeating items 1 and 2
above.

Page 31
EET 300 Computer Applications Manual

Rotating Parts
1- Select the part by clicking it. The part will turn red.
o
2- Press <Ctrl-R>. The part will rotate 90 counterclockwise each time you press this key
combination. This is very useful for passive components.

After selecting a part but prior to clicking on the left mouse, you can also use <Ctrl-R> to rotate
the part prior to placing it on the drawing page.

Deleting Parts
1- Select the part by clicking it. The part will turn red.

2- Press <Delete>.

If you want to delete multiple parts at once, select the first part, hold <Shift>, and select
additional parts. Once all the parts are selected, press <Delete>.

EXERCISE

1- In the schematic you just created, select both resistors and move them down about 1inch.
2- Move R1 so that it to the right of the voltage source, and horizontal.
3- Move and rotate R2 so that it is to the right of R1 and vertical.
4- Add one additional resistor, and then delete it.

Page 32
EET 300 Computer Applications Manual

CONNECTING PARTS

Parts and ports contain one or more pins to which connections are made. Electrical connections
are formed by wire and bus segments joining pins and other wire and bus segments. Attaching
pins directly to pins also forms connections. Schematics represent each such electrical
connection by a junction. Junctions are made visible when three or more connected items
converge at the junction. Junctions are created and removed automatically.

Connecting Parts

1- Either click on the Draw Wire button in the toolbar , or press <Ctrl-W>. The mouse
icon changes to a pencil.

2- Place the tip of the pencil on one of the parts you want to connect, and click the left mouse
button. This will anchor the drawing wire at that point.

3- Move the mouse until it is on the next part you want to connect to. The parts will look like
they are connected.

4- Click at that point. The wire will now anchor at the next point.

Note: If you need to make a bend in the wire, simply move the mouse in that direction. The
wire will continue to be drawn until you click it.

5- You can now move the pencil to a new point, and connect two new parts.

6- When you are finished connecting, click on the right mouse button to deselect the Draw
Wire tool.

 In most circuits, you will need to add a ground. This can be found in the parts dialog box as
AGND or EGND.

 Once the parts are connected, you can still move them. They will remain connected.
However, make certain that in the Display Options dialog box (choose Options, Display
Options in the menu bar) the Rubberband checkbox is checked.

Page 33
EET 300 Computer Applications Manual

CHANGING PARTS ATTRIBUTES

Each part has a single or multiple set of values. Parts such as resistors, capacitors, inductors and
VDC have just a single value that needs to be changed. The default value is shown in a box next
to the part. For example, resistors will have a default value of 1 kΩ, voltage sources will have a
default value of 0V. Certain complex sources, such as VSIN, VPULSE, VSRC, etc. must have
several values defined before you can begin the analysis.

Changing Single Values


1- Double click on the value of the part. The Set Attribute Value dialog box opens.

2- With the value highlighted, type over with a number. You do not have to put in the
appropriate units (unless you want to put in mV as opposed to V).

3- Click OK.

Set Attribute Value dialog box

 Be careful with abbreviations after parts.PSpice will not recognize 5M as 5 MΩ − use


5000k instead. The same thing is true about .01F – write it as 10000µF.

Page 34
EET 300 Computer Applications Manual

Changing Complex Values


1- Double-click on the part, or select the part and click on the Edit Attributes button in the
toolbar . A dialog box will open with the part name.

2- Click on the appropriate line you wish to change. The name and value will appear above in
the designated boxes.

3- Double-click in the Value Box field, and type over the appropriate number.

4- Press <Enter>. You must do this, or the value will not change.

5- Continue repeating items 2-4 until you are finished changing all the attributes.

6- Click OK.

PartName dialog box

Page 35
EET 300 Computer Applications Manual

EXERCISE

1- In the schematic you just created, connect all the parts together, and add an AGND part.
2- Change the value of R2 to 2k.
3- Change the VDC value, using the PartName dialog box, to 5 V, and change the Package
reference Designator attribute (PKGREF) from V1 to Vin.

Page 36
EET 300 Computer Applications Manual

SAVING A SCHEMATIC FILE

Prior to any simulation, you must save the schematic. You can save a file by using the current
name, drive and folder (File, Save), or change the name, drive or folder to create a file that is
separate from the original (File, Save As). When you first create a schematic file Schematics
automatically opens the Save As dialog box.

Saving A Schematic File


1- Choose File, Save to save an existing file as itself, or click on the Save button in the
toolbar. If you haven’t saved the file before, the Save As dialog box will open. If you
have already saved the file, the changes will be saved with the same file name.

2- If you want to save this file with a different name, drive or folder, choose File, Save As.

3- If the Save As dialog box appears, fill in the name of the schematic in the File name field in
the Save As dialog box, and choose both the drive and folder.

4- Click on the Save button.

Save As Dialog Box

Page 37
EET 300 Computer Applications Manual

COPY/PASTING PARTS

To add multiple copies of a part, you can repeatedly click on the left mouse button after selecting
that part from the Parts Browser dialog box. If you have placed a specific part on the schematic,
and you want to add additional copies, you can also copy that part. Since this copy will be the
same value as the original, it can be very useful when you are have a several values you need to
set, such as a voltage source.
You can also copy from one file, and paste that same part to a new file.

Copying A Part
1- Select the part. The color of the part becomes red.

2- Copy and paste the part (using shortcut keys, menu bar, or the toolbar). You will see that
part on the end of the mouse pointer.

3- Position the mouse pointer where you want the part, and click on the left mouse button. If
you want another instance of this part, click again.

4- When you are completed with pasting, click on the right mouse button.

Page 38
EET 300 Computer Applications Manual

EXERCISE

1- Start a new schematic, and draw the circuit as shown below.

2- Add two more 2k resistors by copying and pasting.

3- Save this file as THEV1.

Page 39
EET 300 Computer Applications Manual

UNDO/REDO

Schematics keeps a record of each edit you apply to your schematic. Because of this, you can
undo (or reverse) each edit, up to the last time you saved the schematic. If you used undo too
much, you can redo (or reapply) the edits. Both Undo and Redo apply only to design changes
that alter the contents of a schematic page.

Undo/Redo

1- Choose Edit, Undo, or press <Ctrl><Z>, or click on the Undo button on the toolbar .

2- To reverse any undo action, choose Edit, Redo, or press <Ctrl><Y>, or click on the Redo
button on the toolbar.

EXERCISE

1- Save the file you just created as RESISTOR (note that the program will automatically put
in the extension).
2- Once saved, add a resistor to the drawing page, delete it, undo that deletion, and redo that
deletion. When you are finished with these tasks, you should have the original drawing.
3- Keep this file open.

Page 40
EET 300 Computer Applications Manual

REDRAW AND ZOOMING

If there are additional lines in the schematic that shouldn’t be there, or lines that are missing, the
drawing might need to be refreshed. The redraw feature accomplishes this.
When working on a design, you can zoom in or zoom out to view a larger or smaller portion of
the schematic window.

Using Redraw
1- To refresh your drawing, choose View, Redraw, or click on the Redraw button in the
toolbar.

2- Click on the appropriate line you wish to change. The name and value will appear above in
the designated boxes.

3- Double-click in the value box field, and type over the appropriate number.

Zoom Zoom To
Out Fit Page

Zoom
Zoom In
Area
Zoom Button in the Toolbar

Page 41
EET 300 Computer Applications Manual

Button Function Menu Bar Method

Zoom In Click on this button to zoom in Choose View, In and


on the circuit. click on the portion of the
circuit you want to zoom
in on.
Zoom Out Click on this button to zoom out. Choose View, Out and
click on the portion of the
circuit where you want to
zoom out.
Zoom Area Click on this button, and then Choose View, Area and
click and hold the left mouse then click and hold the left
button down to draw a box mouse button down to
around the area you want to draw a box around the
zoom in on. When you release area you want to zoom in
the mouse button, that area will on. When you release the
fill the entire drawing page. mouse button, that area
will fill the entire drawing
page.
Zoom to Fit Click on this button and the Choose View, Fit and the
Page circuit will fill the entire drawing circuit will fill the entire
page. This is useful if you drawing page. This is
zoomed in on an area too far and useful if you zoomed in on
you want to see the entire circuit. an area too far and you
want to see the entire
circuit.

 You can also choose View, Entire Page from the menu bar. This will enable you to see the
entire drawing page, including border and title block.

Page 42
EET 300 Computer Applications Manual

WORKING WITH WORD 97

If you want to incorporate a schematic into your report, the best way would be to copy/paste the
schematic into your Word document.

Copying Schematics Into Word 97


1- Choose Options, Display Options, and click off Grid On.

2- In the Schematics window, point the mouse above and to the left of the schematic.

3- Click and hold the mouse button, and drag to the right and below the schematic. You will
see a rectangular box surrounding your schematic. Make sure this box surrounds the entire
schematic, and there is about ½ inch border between the box and the parts.

4- Choose Edit, Copy to Clipboard. The schematic can now be pasted into another Window
application, such as Word 97.

5- In Word 97, choose Edit, Paste Special. The Paste Special dialog box appears.

6- In the right side of this dialog box, you will see a checkbox with the description Float over
text. Make sure the checkbox is not checked, then click the OK button.

You need to do this to prevent the schematic from having a frame around it. Without a frame,
you can position the schematic using the formatting toolbar – left, center, or right. If you didn’t
uncheck this box, you could move the schematic anywhere in the page. However, this can
cause problems.

7- If you click once in the schematic, you will see 9 small boxes around the picture, as well as
a Picture toolbar. You can move the mouse to the lower right box, click and hold the mouse
button down, and then you can resize the schematic by dragging diagonally.

8- You will see a line around the schematic. If you want to get rid of the line, click on the

cropping button in the Picture toolbar, , and then move the mouse pointer over the four
middle boxes in the picture, click and drag then inwards. When you click outside the
picture, you should not see the lines.

 It might be easier to first crop the picture and then resize it.

Page 43
EET 300 Computer Applications Manual

EXERCISE

1- Open both PSpice and Word 97. If you have another word processing application, you
can still perform this exercise. However, you will need to understand how to crop a
picture.
2- In PSpice, place a VDC part and two resistors. Drag a box around those three parts, paste
them into your word processing program, and center the drawing in the page.

3- Using the cropping tool, get rid of the outside border lines

Page 44
EET 300 Computer Applications Manual

MEASUREMENTS - DC ANALYSIS

If you want to measure DC levels (i.e. for experiments involving Ohm’s law or Kirchoff’s law)
you can use two parts to view these levels. These parts are placed on the schematic drawing the
same way any other part is placed. VIEWPOINT is a voltage viewing point, which will show the
value after the circuit is simulated. You place VIEWPOINT on a node.
IPROBE is a current probe, which will show the value after the circuit is simulated. You need to
put this part between two parts, so that current flowing in that branch can be measured.
If you have measurements that are time-varying (i.e. a sinusoid) then you need to run Probe.
This section will deal with simple DC analysis.

DC Analysis
1- Place VIEWPOINT and/or IPULSE in the appropriate points. You place the VIEWPOINT
part at a node. To place the IPULSE part, you will have to break the circuit.

2- Save the drawing.

3- Choose Analysis…Simulate from the menu bar, or click on the Simulate button in the

toolbar.

4- If there are no errors, you will see the PSpice dialog box and hear a click. Move the mouse
anywhere in the schematic page and click the left mouse button. You will see the values on
the VIEWPOINT or IPULSE parts.

If there is an error, you will see an Error dialog box. If you click on the OK button, you will bring
up the MicroSim Message Viewer dialog box. Anything with a red Error message needs to be
corrected.

Page 45
EET 300 Computer Applications Manual

PSpiceAD dialog box

MicroSim Message Viewer

Page 46
EET 300 Computer Applications Manual

EXERCISE

1- In the RESISTOR file, add a VIEWPOINT and IPROBE part.

2- If there were no errors, you should see the PSpiceAD dialog box

3- Close the PSpiceAD dialog box. The schematic should now show numbers for both the
voltage and current through R2.
4- Change the value of R2 to 5K, run the simulation again, and observe the new values.
5- Delete the AGND part, and run the simulation again. You should see an error, which
needs to be fixed by adding the AGND part.
6- Save this file.

Page 47
EET 300 Computer Applications Manual

EXPLANATION OF PROBLEMS

At the end of each chapter there will be several problems based on what was covered in the
chapter. Besides doing the required steps, you are encouraged to experiment by
• Changing values of components
• Adding/deleting components
• Changing the measuring points
• Changing the amplitude or type of input

You will be required to hand in a report based on these problems. This report should include the
following:

1. A title page with your name


2. An introductory section detailing what you think you will be accomplishing in this exercise,
what new concepts you will be learning, and what if any additional items you tried.
3. Detailed calculations (similar to a pre-lab) which will demonstrate what you expect to see.
This may involve mathematical proof of responses.
4. Printouts of the schematic(s) and of the responses. These printouts should be pasted into the
Word document, as opposed to being printed out. If there is a problem doing this, see me
during office hours.
5. A brief conclusion as to the observations, how close they came to the “pre-lab” calculations,
and how do you think this exercise could have been changed.

Page 48
EET 300 Computer Applications Manual

PROBLEM 1

1- Place the following components on a new drawing page: 4 Resistors, VDC and AGND.
2- Move and rotate the components so they appear as in the figure below.

3- Wire the components together.


4- Change the values to the components as follows: V1=100, R1=7.5k, R2=5k, R3=3k and
R4=2k. (Note that you do not have to put in Ω for the resistors). You might have to
move the value box away or nearer the part.
5- Add two VIEWPOINT objects to the drawing- one attached to the right of R1, the other
on top of R4. You should have the figure below.

6- First calculate the voltage at the two VIEWPOINT objects. Show the calculations.
7- Save the drawing first, as CHAP3-1.
8- Run a simulation, and compare the values to those from item 6.
9- Change R2 to 2k, and R4 to 4k. Calculate first, and then run the simulation again.
10- Save this again and close out of this file.

Page 49
EET 300 Computer Applications Manual

LESSON 3 - TRANSIENT ANALYSIS WITH RC


AND RL CIRCUITS

You will Learn:

 How to use the pulse voltage source.

 How to set up and perform a transient analysis.

 How to use special markers for the schematic.

 How to modify the graph appearance.

 How to print graphs.

 How to copy and paste the schematic or graph to another program.

 How to sweep a component value.

 How to use the VPWL source.

 How to use the Differentiator and Integrator parts.

 How to work with custom axis.

Page 50
EET 300 Computer Applications Manual

PULSE VOLTAGE SOURCE

In analyzing a circuit that has a voltage source switched at t=0, you can simulate this by using a
pulse voltage source (VPULSE). Various parameters must be set for this source.

Setting A Pulse Voltage Source


1- Select from the Part Browser dialog box VPULSE.

2- Place it on the drawing page.

3- Double-click on the part. The VPULSE dialog box opens.

4- Type in zero for V1 (unless you want a positive and negative pulse). Type in the desired
amplitude (don’t need the unit V) for V2.
th
5- Type in values for TR and TF, at least 1/100 of the pulse width.

Unless you are going to choose an extremely narrow pulse, a choice of 1ns for each of the two
values would be appropriate. Do not have a space between the value and the units.

6- Type in a value for PW.

7- Type in a value for the PER.

This value will depend on whether you want to see multiple cycles (then type in a value 2 or 3
times the pulse width) or only one cycle (then type in a value at least 10 times the pulse width).

8- Click OK.

Page 51
EET 300 Computer Applications Manual

UNIT STEP

In many instances, you will be required to set up a circuit with a unit step function. This function
would also be used to solve initial and steady state conditions in circuits, where you have a DC
source and a switch that closes at DC. The VPULSE part can be used to set up a Unit Step.

Setting up a Unit Step Input


1- Follow the procedure on the preceding page for setting up a VPULSE part.

2- When you are setting up the value of PW, this value must be at least 5 times the time
constant of the system. If you do not know the time constant of the system, you can set the
value of the PW to several seconds.

The circuit will view this “wide” pulse as a switched DC, or a unit step function.

Page 52
EET 300 Computer Applications Manual

SETTING UP THE TRANSIENT ANALYSIS

To run a transient analysis on the pulse waveform, the Transient dialog box must be filled in.

Transient Dialog Box


1- Choose Analysis…Setup from the menu bar, or click on the Setup Analysis button in the
toolbar . The Analysis Setup dialog box opens.

2- Click on the Transient button in the Analysis Setup dialog box. The Transient dialog box
opens.

3- Type in the appropriate values for the Final Time.

If you want to see multiple waveforms, then the Final Time should be at least twice the value of
PER. If you want to see an expanded view of the rise time, then the Final Time value should be
approximately 1.2 times the PW. You do not have to change the Print Step value unless you
only have a resistive circuit (do not set it to zero).

If you need to change the Print Step value (because the analysis is incrementing too slowly),
th
make sure Print Step is at least 1/100 of the Final Time.

4- Click OK, and then Close.

Page 53
EET 300 Computer Applications Manual

Analysis Setup Dialog Box

Transient dialog box

Page 54
EET 300 Computer Applications Manual

PERFORMING THE TRANSIENT ANALYSIS

Once the VPULSE part, the Transient Dialog box, and the rest of the circuit are set up, transient
analysis can be performed. Since usually both the input and output need to be observed, this can
be set before running the simulation.

Performing The Transient Analysis


1- Save the schematic. Place markers on the schematic to indicate the points for which you
want to see simulation waveforms displayed in Probe. Placement can occur before or after
simulation takes place. Use Mark Voltage/Level markers for this part.

2- Choose Analysis…Simulate from the menu bar, or click on the Simulate icon in the

toolbar.

If there are no errors, you will see the PSpice dialog box, and on the bottom of this dialog box
you will see numbers changing. When the iterations are completed, you will hear a click,
followed by a display of the Probe window.

3- If there are errors, you need to choose File…View Messages from the menu bar. Read
the error messages and take appropriate action.

4- If you want to modify the schematic, click on the Schematic button in the Taskbar
(Windows 95). Then repeat step 2.

You do not have to repeat step 2 if you are only adding additional markers.

 When the graph appears, you will see a window with PROBE in the title bar, and in
Windows 95/98 the Taskbar will contain the Probe button. You will also see at the bottom
of the graph a color indicating which point on the circuit you are looking at, i.e. for a resistor
R1, V(R1:1) represents the left side of the resistor (if you are looking at a horizontal resistor)
while V(R1:2) is the right side of the resistor.

Page 55
EET 300 Computer Applications Manual

CHANGING BACKGROUND COLORS IN PROBE

The default colors in Probe are a black background with a white axis. Although this might be
acceptable when viewing on a monitor, it is very difficult to see when you copy to a Word
document (to be shown later). You can change the default colors so that you have a white
background.

Color Change In Probe


1- Locate the file called msim_evl.ini in the C:/windows directory. It is not the file called
msim_ev.ini. (must have evl after the underline). You can use either Windows Explorer or
use the Find feature of Windows 95.

2- If you double click on the icon to the left of the file name, this file should open in Notepad. If
it doesn't, then open it in Notepad (although you can also open it in Word). Make sure that
PSpice is closed.

3- In Notepad, choose Search…Find, type in the words PROBE DISPLAY COLORS, and
then click the FIND NEXT button. You should go to the section you need to modify.

4- In the next several lines, you are going to change the Background, Foreground and Trace_1
and Trace_3 values. The original Trace_1 value is BRIGHTGREEN, which is very hard to
see on top of a white background. The first 5 lines of the PROBE DISPLAY COLORS
section should look like the following:

[PROBE DISPLAY COLORS]


NUMTRACECOLORS=6
BACKGROUND=BRIGHTWHITE
FOREGROUND=BLACK
TRACE_1=BRIGHTBLUE
TRACE_2=BRIGHTRED
TRACE_3=BRIGHTGREEN

5- Save these changes, and then reopen PSpice.

Page 56
EET 300 Computer Applications Manual

EXERCISE

1- Place VPULSE, AGND, R and C parts on the drawing page, move and connect them so
you get the schematic as seen below. Make sure you change the C1 value to 1 uF.

2- Setup VPULSE for a pulse width (PW) of 1ms, a period (PER) of 5ms, V1= 0 and
V2 = 5. Make sure you put in appropriate values for TR and TF.
3- Go to Setup Analysis, and in the Transient analysis set Final Time to 10ms.
4- Place a voltage marker at the input (at the top of V1) and the output (at the top of the
capacitor).

5- Save this file as RC.


6- Click on the Simulate button in the toolbar. If there are no errors, you should see the
PSpiceAD window come up, various numbers change on the bottom, and then the Probe
graph window appear, with graphs showing both the input and the output (see next
diagram). If you have a black background, change the setting in the msim_evl.ini file, as
detailed in the previous page.

Page 57
EET 300 Computer Applications Manual

7- Go back to the Schematics window, change the value of the capacitor to 0.2uF, and run
the simulation again.

8- Keep this file open.

Page 58
EET 300 Computer Applications Manual

SPECIAL MARKERS

Instead of using markers, which will name the trace based on the part it is attached to, you can
use a special part called a BUBBLE. You can give this part any name, and it can be used to mark
the traces as Vin, Vout, etc.

Using Bubbles
1- Click on the Get a new part button in the toolbar, and choose Bubble from the drop down
list.

2- Place the bubble part at the point(s) of interest (delete the Voltage/Level markers).

3- Double-click on each bubble. The Set Attribute Value dialog appears. Type in the name for
the bubble.

4- Click on Analysis…Simulate to run PSpice. If the setup was done properly, Probe should
run and you will see a blank graph.

5- In the Probe menu bar, choose Trace…Add. The Add Traces dialog box appears.

6- From the left-hand column of this box click on the appropriate name. You can hold down
<Ctrl> while clicking to choose multiple traces. You will see the traces listed in the Trace
Expression field at the bottom of this dialog box.

7- Once you have all the traces listed, click OK. You can repeat items 5 and 6 to add traces.

 You can delete any trace by clicking on the legend for the trace (located in the lower left
portion of the graph) and pressing <Delete>.

 The Add Traces dialog box can also be used to display complex functions of voltages and
currents, i.e. power.

 If you use the bubble part, label it with names such as input or output. Probe will add the V
next to the name.

Page 59
EET 300 Computer Applications Manual

EXERCISE

1- Delete, in the previous schematic, the Voltage/Level markers, and place a Bubble part on
top of the VPULSE and the capacitor.
2- Double-click on each of the Bubble parts, and put in the label Vin and Vout.

3- Run the simulation. You should get a blank graph in the Probe window.
4- In the menu bar of the Probe window, choose Trace, Add, select Vin and click OK.
5- Repeat item 4 for Vout. You should now have a graph that is labeled with Vin and Vout.

6- Keep this file open.

Page 60
EET 300 Computer Applications Manual

MODIFYING GRAPHS

There are many ways to modify the graphs. Changes include axis setting, adding labels to a
curve, or adding a cursor to the plot.

Changing Axis
1- Choose Plot and either X Axis Settings or Y Axis Settings. A dialog box will appear.

2- To change the scale, click in the radio box next to the words User Defined, and enter the
new scale below. To go back to the original setting, select Auto Range in the Data Range
field.

3- You can add an Axis Title as well, by typing in that field.

4- Click OK.

Page 61
EET 300 Computer Applications Manual

Adding Labels To Curve


1- Choose Tools, Label. You will see a drop down list.

2- If you want a text label then choose Text, and type in the desired text in the dialog box. To
choose just text you can also click on the Text Label button in the toolbar. When you
click OK, the mouse pointer will change to a pencil. You can move the mouse around and
place the text anywhere you want, and then click the left mouse button to fix the position.

3- You can also use other Label items, such as lines, arrows and boxes. To use an arrow,
choose Arrow from the drop down list, move the mouse away from the point of the graph
you want the arrow to point to. Click, and then move the mouse towards the point you want
the arrow to show. Note that an arrow is always at the line end.

4- If you typed text, and want to modify or delete it, double click on the text. The dialog box will
appear, and either edit what is in the dialog box or delete it, and then click OK.

Adding A Cursor To The Plot

1- Choose Tools, Cursor, Display, or click on the Toggle Cursor button in the toolbar. A
display box appears in the lower right hand corner of the graph, entitled Probe Cursor. This
will show values for both axes.

2- Click with the left mouse button anywhere in the graph. A dotted vertical white line appears
(this is the cursor). If the graph is anything but a pulse, you may see a horizontal and
vertical dotted line.

You can click and drag the cursor over the curve, and observe the changes in the values in the
Probe Cursor display box.

3- To select which trace the cursor is measuring, click on the icon next to the axis label
(located in the lower left part of the graph).

Page 62
EET 300 Computer Applications Manual

EXERCISE

1- In the Probe graph you have opened, change the X-axis to 5 ms.
2- Add an arrow, pointing to the peak of the output.
3- Add a label entitled Maximum.
4- Add a cursor to Vout.

Page 63
EET 300 Computer Applications Manual

PRINTING AND COPYING GRAPHS

There are two ways to get hardcopy of your graphs: printing them or copy them to another
application (such as Word).

Printing Graphs
1- In the Probe window, choose File…Print from the menu bar.

If a graph does not appear, make sure that the appropriate printer is chosen (one that can print
graphs as well as text). You can see what printer is chosen by choosing File, Printer, Select
from the menu bar..

Copying Graphs
1- In the Probe window, choose Tools, Copy to Clipboard. The graph can now be pasted
into another Window application, such as Word. If you are using Word 97, then you should
use Edit, Paste Special, and uncheck the “Float over text” checkbox.

2- Select a new folder in the Choose a Drawing Template dialog box and click on the Open
button. The folder represents a group of templates.

EXERCISE

1- Print the graph directly from Probe.


2- Open a new Word document, and type the word Schematic and then press <Enter>.
3- Copy and paste the schematic to this new document.
4- Press <Enter>, and then type the word Graph. Press <Enter>.
5- Copy and paste the graph in the Probe window to this document.

Page 64
EET 300 Computer Applications Manual

SWEEPING A COMPONENT VALUE

There are tests that might require you to sweep a component through a range of values. To do
this, a three-step process is needed.

Changing the Component Value to A Variable


1- Double click on the Value Attribute (the components magnitude). The Set Attribute Value
dialog box opens.

2- Type in an expression, such as RLOAD or ROUT, make sure you encase this expression in
curly braces {}, and then click OK. You might want to move this label, by pointing to the
label and clicking and hold and drag this label to a new position.

Defining the Value as A Variable

1- Click on the Get New Part button on the toolbar. . The Part Browser dialog box opens.

2- Select from the list the PARAM part.

3- Click on the Place and Close button, move the mouse pointer to an empty area (i.e. above
and to the right of the schematic) and click on the left mouse button.

4- Click on the right mouse button.

5- Point to the word PARAMETERS, and double click on it. The PartName dialog box opens.

6- Enter the name you chose for this component in the NAME1 field, and enter the original
value of this component in the VALUE1 field.

7- Click OK.

Page 65
EET 300 Computer Applications Manual

Global Sweep

1- Click on the Setup Analysis button in the toolbar. The Analysis Setup dialog box
opens.

2- Click on the DC Sweep button. The DC Sweep dialog box opens.

3- Select Global Parameter in the Swept Var. Type field.

4- Enter the name of the component and the range of the sweep (the start value, end value,
and the increment).

5- Click OK, and then click Close.

DC Sweep dialog box

Page 66
EET 300 Computer Applications Manual

EXERCISE

1- Draw the circuit below, defining the last resistor as a variable RLOAD.

2- Setup the sweep with Start Value of 100, End Value of 100k, and Increment of 100.
3- Add a voltage level marker at the top of R4.
4- Run the simulation.
5- Add a cursor to the graph, and measure the voltage amplitude. See how it approaches a
certain value.

6- Try doing the same thing using a Current/Level marker.

Page 67
EET 300 Computer Applications Manual

USING THE VPWL SOURCE

When you want to create a custom voltage source, you can use the VPWL part. This will allow
you to define different voltage levels for up to 10 different time points. This source can be very
useful in creating a linear voltage waveform to analyze RMS, average, integration and
differentiation of piecewise linear voltage waveforms.

Setting Up the VPWL Source


1- Set up a circuit with a VPWL source.

2- Double click on the VPWL source. The PartName dialog box opens.

3- Enter the values for the voltage, and the time that voltage occurs.

4- To view the waveform, place a resistor across the source (use the default value) and an
AGND part. Place a Voltage marker at the top of the resistor, and run a transient analysis.
Make sure that the Final Time is set so you can see the entire waveform.

 To create most waveforms, you might want to start at 0, which means that V1 and T1 should
be 0.

 If you want to create a square wave, then T1=T2.

Page 68
EET 300 Computer Applications Manual

EXERCISE

1- Set up a VPWL source with the following parameters: T1=0, V1=0, T2=2, V2=2, T3=4,
V3=0.
2- Add a resistor and AGND part.

3- Set the transient analysis to the following: Print Step = 1 ms, Final Time=5s. Add a
voltage marker to the top of R1.
4- Save this file with a name WAVEFORM, and run the analysis. You should see an
triangular waveform, with an amplitude of 2V and a pulse width of 4s.

5- Keep this file open.

Page 69
EET 300 Computer Applications Manual

USING THE DIFFERENTIATOR AND INTEGRATOR

In working with mathematical expressions such as differentiation and integration, you can add a
part to the schematic that will accomplish these expressions. These are single input, single
output parts.

Using Mathematical Parts


1- Click on the Get New Part button.

2- Select either the part DIFFER (for differentiation) or INTEG (for integration).

3- If you are just viewing the effects of differentiation or integration on a waveform, place this
type of part immediately after the source, and place a resistor (use the default value) as an
output. Make sure you use an AGND part.

EXERCISE

1- Using the VPWL source you just created, insert a DIFFER part between the source and
the resistor.
2- Add another voltage probe, so you have one before and after the DIFFER part.
3- Run a simulation. Compare the output to what you would expect the differentiated
waveform to look like.

Page 70
EET 300 Computer Applications Manual

4- Repeat steps 1-3 with the INTEG part. Note: You can also replace parts by clicking on
that part, choosing Edit, Replace and then typing in the part name.

Page 71
EET 300 Computer Applications Manual

WORKING WITH CUSTOM AXIS

Besides being able to plot standard values such as input or output voltages or currents, Probe
allows you to plot calculated plots (i.e. voltage times current) or functions (i.e. derivative of the
output voltage waveform). You also have functions which will be useful for plotting Bode plots
(log) and also for finding average and rms values.

Generating A Custom Axis


1- In the Probe window, choose Trace, Add. The Add Traces dialog box appears.

2- To create a simple expression (i.e. Vout/Vin), click on the first Variable in the expression.
You will see it appear in the Trace Expression field (located at the bottom of the dialog box).

3- Click on a Function (located on the right half of the dialog box). This function will appear
after the first variable.

4- Continue to add the appropriate Variables and Functions.

If you are using a function with a parenthesis ( ), make sure that the cursor is in the middle of
the parenthesis before clicking on a Variable (i.e. LOG10 (Vout)).

Page 72
EET 300 Computer Applications Manual

Some of the expressions you may need for the labs in this course are as follows:
Function Meaning
AVG(x) Running average of x over the range of the x-axis variable.
AVGX(a,b) Running average of x for a range – from the point a on the
x-axis to the point b on the x-axis.
D(x) Derivative of x with respect to the x-axis variable.
DB(x) Magnitude in decibels of x.
LOG10(x) log (x)
LOG(x) ln(x)
P(x) Phase of x (in degrees)
PWR (x,y) y
x

RMS(x) Running RMS average of x over the range of the x-axis


variable.
S(x) Integral of x over the range of the x-axis variable.

 Note that you could do differentiation and integration using functions as well as the parts.

Page 73
EET 300 Computer Applications Manual

EXERCISE

1- From the previous exercise, delete the integrated waveform (leave the original triangular
waveform alone).
2- Add the average waveform to this plot, using the function (the voltage should be V(R1:2).
Note that this waveform is the average at each instant of time.

3- Try adding the RMS value as well. See if you can explain the differences.

Page 74
EET 300 Computer Applications Manual

PROBLEMS 2-5

PROBLEM 2

1- Create a waveform with the following characteristics, using the VPWL source: T1=0,
V1=0, T2=1, V2=1, T3=2, V3=1, T4=4, V4=0.
2- Integrate and differentiate the waveform, both theoretically and using PSpice.
3- Create the figure shown in Fig. P2-60 (only the first two waveforms) using the VPWL
source. Differentiate and integrate this waveform theortically and with PSpice.

PROBLEM 3

1- Create a voltage waveform, using the VPWL source, with the following parameters:
T1=0, V1=0; T2=3, V2=5; T3=6, V3=0. Place a 1k resistor across this source. Note that
V and s are assumed units if they are not specified.
2- Place a BUBBLE part at the output (across the resistor), call that part Vout,.

3- Use the Set Up button to run a Transient Analysis. Set the Print Step to 2ms and the
Final Time to 10s. Run the simulation.
4- Add the trace Vout to the graph and observe the waveform.
5- Add another plot to this graph, and add a trace to that new plot with the function
AVG(Vout).
6- Place a cursor on the upper graph, and move the cursor until it is at 6s. Read the value of
the upper graph, and compare it to the calculated average for this triangular waveform.

Page 75
EET 300 Computer Applications Manual

PROBLEM 4

1- Place the following components on a new drawing page: 1 Resistor, VSIN, 1 Capacitor
and AGND.
2- Move and rotate the components, and wire them together. Also add two voltage markers-
one at the input, and one at the output.

3- Change the capacitor value to 1u.


4- Set the values of VSIN as follows: VOFF=0, VAMPL=10V, FREQ=1000.
5- Set the Transient values to 1us for the Print Step, and 2 ms for the Final time.
6- Run the simulation and observe the two curves. Which voltage (input or output) leads,
and approximately by how much. How do you calculate phase?
7- Replace the position of the resistors and capacitors. What happens to the phase
relationship between the input and output voltage.

PROBLEM 5

1- Solve problem 4-17 for the voltage and current waveforms, using PSpice. Estimate
theoretically what the initial and steady state condition should be. Does it conform to the
Probe waveform?

Page 76
EET 300 Computer Applications Manual

LESSON 4 – LAPLACE TRANSFORMS USING MATHCAD

You will Learn:

 How to perform the Laplace transform and inverse transform in Mathcad.

 How to solve for the roots of an equation.

Page 77
EET 300 Computer Applications Manual

LAPLACE TRANSFORMS

MathCAD can enable you to perform both Laplace transforms and inverse Laplace transforms.
The best way to accomplish this is to use the Symbolic Keyword Palette.

Laplace Transforms
1- Set up a variable, such as v(t), and assign it to an expression, such as sin(t).

2- Type the variable below, and click on the laplace button located in the Symbolic Keyword
Palette. You will see the word laplace, followed by a comma, a placeholder and an arrow.

3- The placeholder is for the variable. Type in t, and press <Enter>. You will see the
transform.

4- You can now change the original expression, and see a new transform.

Inverse Transform
1- Set up a variable, such as V(s), and assign it to an expression that is a function of s.
Remember that the order of the denominator must be greater than the order of the
numerator.

2- Type the variable below, and click on the invlaplace button located in the Symbolic Keyword
Palette. You will see the word invlaplace, followed by a comma, a placeholder and an
arrow.

3- The placeholder is for the variable. Type in s, and press <Enter>. You will see the inverse
transform.

4- You can now change the original expression, and see a new transform.

Page 78
EET 300 Computer Applications Manual

From the worksheet Laplace Transform.mcd

Laplace Transforms

v( t ) sin ( t )

1
v ( t ) laplace , t
2
s 1

Now, look at the inverse transform.


If we type the same expression as above,
we should get the original function sin(t)

1
V( s )
2
s 1

V( s ) invlaplace , s sin ( t )

ASSIGNMENT 4

1. Solve equation 5-48 theoretically, and show the solution with MathCAD. Are they different,
and if so why?
2. Practice with other examples in the textbook.

Page 79
EET 300 Computer Applications Manual

ROOTS OF AN EQUATION

When you need to solve the inverse Laplace transform, you will need to factor the roots of an
equation. MathCAD enables you to type in an equation, and solve for the roots, whether they are
real or imaginary. The equation you will be solving in EET300 will generally be of the order

a .x b .x c
2

Solving for the roots of an Equation


1- Define the coefficients of each order, for example a, b, and c.

2- Type in the equation.

3- From the Symbolic Keyword Palette, click on the solve button. You will see the word solve,
followed by a comma, a placeholder and an arrow.

5- Type in the independent variable, such as x in the example above, and press <Enter>. You
will see the solution.

6- You can now change the original expression, and see a new solution.

From the worksheet Quadratic Equation.mcd

 

 


Consider the General form of a second order polynomial

a .x b .x
2
c

To solve this equation, first define a, b and c


a 1 b 2 c 3

Then to solve the equation

1 i . 2
a .x b .x
2
c solve , x
1 i . 2

For any other second order polynomial, change a, b or c

Page 80
EET 300 Computer Applications Manual

PROBLEMS 6-7

PROBLEM 6

1- Draw the circuit in Figure 6-49 in PSpice.


2- Derive the output v(t) theoretically, using Laplace transforms. Do not use Mathcad for
the transforms (do it by hand).
3- From the output v(t) you derived theoretically, use Mathcad to plot this voltage, and paste
this plot in Word.
4- Use a VPULSE generator in place of the 10V source and switch with the following
parameters:
V1=0 and V2=10
TR and TF = .01us
PW=10 and PER=20
5- Run the simulation with the Setup dialog box as Transient, Print Step= 20ms, and Final
Time=7000ms. Copy this plot to word
6- Observe what happens and compare it to the theoretical analysis from step 3.

PROBLEM 7

1- Analyze, both theoretically and with PSpice, problem 6-25.


2- Try to do problem 6-26. See if you can determine how to do it with PSpice (you should
be able to do it theoretically, and use Mathcad to plot the final output voltage).

Page 81
EET 300 Computer Applications Manual

LESSON 5 – LAPLACE TRANSFORM IN PSPICE

You will Learn:

 How to use the Laplace component in a circuit

Page 82
EET 300 Computer Applications Manual

USING THE LAPLACE COMPONENT

You can analyze the effect of a system with a specific Laplace transform by utilizing the Laplace
component. This component allows you to specify both a numerator and denominator. To
analyze the effect of the transform, you need to have an input (either a pulse or sine wave), the
setup (either an AC sweep or transient), a resistive load on the output, and a ground.
The resistive load will not be part of the circuit in analyzing the response. Therefore, the
response you will observe will be strictly due to the Laplace component, and not as a result of
voltage division between the resistor and the Laplace component.

Using the Laplace Component


1- Set up a circuit with a VPULSE source, a LAPLACE component in series, a resistor in
series with the LAPLACE component, and a ground (AGND).

2- Double click on the VPULSE component and set up the parameters (see Lesson 2).

Note: You want to set up the pulse width parameters based on the time constants of the
1
transform. For example, if the transform is , then you want to specify the PW (pulse
s +1
width) of the VPULSE component as 1s (1 second), if you want to see the entire response.

3- Double click on the LAPLACE component and specify the numerator and denominator. If
2 3
you want higher order, type in s*s to represent s , and s*s*s to represent s .

4- Place a voltage marker on the input, and another one on the output.

5- Type in the appropriate values for the Print Step and Final Time in the Transient setup.
Make sure that the Final Time is no more than 1000-2000 times the Print Step (otherwise
the simulation will take a long time).

6- Run the Simulation. You should see the output in the Probe window that represents the
Laplace transform.

 Do not include the resistor in the analysis of the circuit (i.e. use the resistor as a voltage
divider). Only consider the Laplace transform block.

Page 83
EET 300 Computer Applications Manual

PROBLEMS 8-9

PROBLEM 8

1- Setup up the circuit as shown below, with the LAPLACE component set to the default of
1
, and the resistor set to 1, and the VPULSE component set to 1us for the rise and fall
s +1
time, 1s for the PW, and 10s for the PER. Make sure that you use the AGND component.
Also, set V1 to 0, V2 to 5.

2- Place two voltage markers (one on the input, and one on the output).
3- In the Transient setup, set the PRINT STEP to 10ms, and the FINAL TIME to 5s.
4- Run the simulation. The graph should appear as shown below. Verify theoretically that this
is the correct answer, by plotting your theoretical answer with Mathcad, and comparing to
PSpice.

Page 84
EET 300 Computer Applications Manual

PROBLEM 9

1
1. Set the LAPLACE component to , and run the simulation. Observe the graph, and
s+2
describe the differences between Exercise 1.
1 5
2. Develop the theoretical solution to transform   , and compare to the graph in step 1.
s + 2s
3. Put another LAPLACE component in series, and set it to the same value as in step 1 of
Exercise 2. Run the simulation, observe the graph, develop the theoretical solution to the
transform, and compare. Make sure you have voltage markers at the input and at each output
of the LAPLACE component.
1
4. Change the second LAPLACE component to , run the simulation, observe the graph,
s +1
and develop the theoretical solution.
5. Change the denominator in the first LAPLACE component to s, run the simulation, observe
the graph, and develop the solution. Comment on why you are seeing the specific graph.
6. Repeat items 2-4 with a VSIN component. Set the frequency to 1 Hz (see page 92 for
additional information on the VSIN component).
You should do the theoretical work as well as the PSpice examples, and plot the theoretical
results with Mathcad. You must do the theoretical results by hand (not use Mathcad to perform
the transforms).

Page 85
EET 300 Computer Applications Manual

LESSON 6 – SINUSOIDAL STEADY STATE IN PSPICE

You will Learn:

 How to measure differences with cursors

 How to delete a trace

 How to mark specific values on the graph

 How to generate multiple plots on a graph

 How to use the VSIN source

 How to simulate a Bode plot

Page 86
EET 300 Computer Applications Manual

MEASURING DIFFERENCES WITH CURSORS

There are actually two cursors that you can activate; one with the left mouse button and one with
the right mouse button. By moving these cursors around, you can measure both time and
amplitude differences.

Setting Up Multiple Cursors in Probe

1- With the Probe window open, click on the Toggle Cursor button in the toolbar. .

2- If you have two waveforms, you can associate a cursor with each waveform. Point to the
legend symbol , located in the lower left portion of the graph, and
click on one of the legend symbols with the left mouse button.

You will see a closely spaced dotted line around that legend. This is cursor A1, as seen in the
Probe Cursor display box.

3- Point to the other legend symbol, and click with the right mouse button.

You will see a loosely spaced dotted line around that symbol. This is cursor A2, as seen in the
Probe Cursor display box.

 You can have two cursors even if there is only one waveform (i.e. output voltage). If you
click on the left mouse, you will bring up cursor A1. If you click on the right mouse, you will
bring up cursor A2.

 If you click and hold on the title bar of the Probe Cursor display box, you can reposition it.

Page 87
EET 300 Computer Applications Manual

Moving Cursors
1- Position the mouse pointer to the place on the waveform where you want the cursor. Click
on either the left or right mouse button (depending on whether you want A1 or A2 cursor)..

2- To move the cursor position, click and hold on either button, and drag the mouse to the
desired direction.

3- For finer cursor movement, press the right or left arrow key for the A1 cursor, and <Shift>
right or <Shift> left arrow key for the A2 cursor.

 The difference calculation is A2 (the right mouse button cursor) minus A1 (the left mouse
button cursor). You might want to position the appropriate cursors to get a positive
difference.

Deleting A Trace
1- Click on the legend name (not the symbol) of the trace you want to remove. It will change
to a red color.

2- Press <Delete>. The trace is removed.

EXERCISE

1- Open up the RC.sch file you created in the exercise on page 57. If you do not have this
file, recreate it.
2- Perform a simulation, and add traces for Vin and Vout.
3- Assign A1 cursor to Vin, and A2 cursor to Vout.
4- Move either cursor and observe the changes in the Probe Cursor display box.
5- Delete the Vin trace, and change the X-axis to 2 ms.
6- Measure the time difference between t=0 and the point where the voltage is 63% of
maximum. You will need both cursors. Compare that value to the rise time.
7- Move the Probe Cursor display box to the middle right portion of the graph. Keep this
file open

Page 88
EET 300 Computer Applications Manual

MARKING SPECIFIC VALUES ON THE GRAPH

If there are specific points on a graph you wish to mark, you can do so using the cursor. You can
also reposition these marked points.

Marking Coordinate Values

1- Activate the cursor by clicking on the Toggle Cursor button in the toolbar. .

2- Move the cursor to a specific point.

3- Choose Tools, Cursor, Freeze from the menu bar.

4- Click on the Mark Label button in the toolbar. The x and y coordinates will be displayed
near that point, along with a line pointing to the specific point.

Moving the Marked Coordinate Values


1- Choose Tools, Cursor, Freeze.

2- Click and hold on the marked coordinate values that you want to move, and drag them to
the new location.

3- Double-click in the value box field, and type over the appropriate number.

Removing the Marked Coordinate Values


1- Choose Tools, Cursor, Freeze.

2- Click on the marked coordinate values you want to remove, and press <Delete>.

Page 89
EET 300 Computer Applications Manual

EXERCISE

1- From the previous example, move the right cursor (A2) to the Y-axis.
2- Position the A1 cursor somewhere on the graph, and mark the coordinate values.
3- Do that two additional times.

4- Keep this plot opened.

Page 90
EET 300 Computer Applications Manual

GENERATING MULTIPLE PLOTS

If you start to add too many plots to a single graph, it can become confusing. One way to
overcome this would be to generate multiple plots within a single Probe window. These plots
can either share the same X-axis or have individual X-axes (allows you to zoom in on one plot at
a time). You can have up to four individual plots in a Probe window.

Generating Multiple Plots in A Probe Window


1- Choose Plot, Add Plot.

2- Choose Trace, Add and select the trace you want to add to this plot.

3- Click anywhere in the desired plot to select it. You will see SEL>> is to the left of the
selected plot..

4- To delete a plot, select it and choose Plot, Delete Plot.

5- To create a separate X-axis for a new plot, select that plot and choose Plot, Unsync Plot.
The new plot will now have a separate X-axis, and there will be a cursor separating the
plots. You can scroll horizontally on the new plot.

EXERCISE

1- In the open Probe window, add an additional plot.


2- Select Vin as the trace to add to this new plot.
3- Select the original plot (Vout).

Page 91
EET 300 Computer Applications Manual

USING THE VSIN SOURCE

You can analyze the frequency response of a circuit to a sinusoid by utilizing the VSIN part. By
placing the markers at appropriate points in the circuit, and running a transient response, you can
observe the amplitude and phase changes for a particular frequency.

Analyzing the Response of A Circuit to A Specific Sinusoidal Frequency


1- Set up a circuit with a VSIN source.

2- Double click on the VSIN source. The PartName dialog box opens.

3- Enter the following values for these values in the dialog box:

VOFF – 0
VAMPL – Peak amplitude for the sine wave (5V is a good value to use)
FREQ – Choose the value you which to observe (don’t need to include the units)

4- Place Voltage/Level markers at the appropriate places in the circuit. Place at least one at
the input and one at the output. You may want to use the bubble part so that you can mark
these parts Vin and Vout.

5- Choose Analysis…Setup. The Analysis Setup dialog box opens.

6- Click on the Transient button, and fill in the appropriate values for the Print Step and Final
Time in the dialog box.

For amplitude and phase analysis, you want to observe at least 2-3 complete waveforms.
1
Therefore, select a value for Final Time that is 2-4 times the period of the input ( ).
frequency

7- Choose Analysis…Simulate, or click on the Simulate button in the toolbar and


observe the graph in the Probe window. You should be able to use the cursor to measure
the amplitude change and phase change of the output.

If you use the BUBBLE part, you will need to add those traces to the graph.

8- To select a different frequency, go back to the Schematic window and double click on the
VSIN source. Change the value of the frequency and run the simulation again.

Page 92
EET 300 Computer Applications Manual

SIMULATING A BODE PLOT

You can perform a Bode plot (amplitude and phase) vs. frequency in PSpice. You will need to
create two plots.

Viewing Amplitude Vs. Swept Frequency


1- Set up a circuit with a VSIN part.

2- Double click on the VSIN part. The PartName dialog box opens.

3- Enter the following values for these values in the dialog box:

VOFF – 0
VAC – same value as VAMPL
VAMPL – Peak amplitude for the sine wave (5V is a good value to use)
FREQ – Choose the value you which to observe (don’t need to include the units)

4- Choose Analysis…Setup.

If Transient is selected, you might want to deselect it by clicking in the check box, and then
select AC Sweep. Specify the Start Freq., End Freq., and Total Pts. (you many initially want to
leave this value alone). You may have to experiment with these values, if you have not tried to
calculate the Bode plot theoretically from the circuit.

5- Choose Analysis…Simulate.

If you didn’t deselect Transient (as in step 4), you will get a small dialog box, entitled Analysis
Type. Click on the AC button. If you deselected Transient, this box will not appear.

You will get a plot with frequency as the X-axis. If you choose Plot, X Axis Settings, you will
see that the scale is log.

6- In the Probe window choose Trace, Add. The Add Traces dialog box opens.

7- Select DB() in the Function or Macro field. The cursor will be in the middle of the
parenthesis.

8- Select Vout from the Variables field, and then move the cursor one position to the left (using
the arrow keys on the keyboard or the mouse). You want to have the cursor inside the right
most parentheses.

9- Select the “ / ” operator from the Function or Macro field, and then select Vin from the
Variable field.

10- Click on OK. You will see a plot of dB vs. frequency.

Page 93
EET 300 Computer Applications Manual

AC Sweep and Noise Analysis Dialog Box

Viewing Phase Vs. Swept Frequency


1- Choose Plot, Add Plot. A second plot in the Probe window is selected.

2- In the Probe window choose Trace, Add. The Add Traces dialog box opens.

3- Select P() in the Function or Macro field. The cursor will be in the middle of the parenthesis.

4- Select Vout from the Variables field.

5- Type in a – sign, and then select P() again.

6- Select Vin from the Variables field.

7- Click on OK. You will see a plot of angle (d) vs. frequency.

Page 94
EET 300 Computer Applications Manual

PROBLEMS 10-11

PROBLEM 10

1- Setup an RC circuit, as shown below. Set the frequency to 10Hz, the VAMPL to 5 V, the
Final time to 40 ms, and run the simulation (make sure to save this file first). Measure
the ratio of the peak output waveform to the peak input waveform, and record it.
Measure the phase difference between the input and output.

Note that to measure phase differences, 360o represents the time interval between two
consecutive peaks for the input waveform (period of the input). Therefore, to measure the phase
differences between output and input, measure the time differences between the two peaks, and
divide 360o by that number, and then multiply that result by the period. That will be the phase
shift at that frequency. It might also be easier to change the value of the X-axis setting to 20 ms.

2- Change the frequency to 100Hz, and repeat step 1. Do the same thing for 250Hz, 500Hz,
1000Hz, and 5000Hz.

Page 95
EET 300 Computer Applications Manual

3- Take the values of the amplitude ratio (output/input), convert those values to decibels,
and plot the result vs. frequency on semi-log paper.
4- Plot the phase measurements vs. frequency on semi-log paper.
5- Try repeating the same thing with the circuit as shown below (save this file with a
different name)

6- Go back to the original file in item 1, and leave that open.

PROBLEM 2

1- Develop a theoretical Bode plot (amplitude and phase) for the RC circuit that is open
from the previous exercise. Use breakpoint analysis. What type of filter is this?

Page 96
EET 300 Computer Applications Manual

2- Determine the break frequency from this plot. How would you do it, and how does it
compare to the calculated break frequency?
3- Replace the VSIN in the schematic with a VPULSE (set PW equal to 1 ms, PER to 5 ms).
What happens to the output waveform, and how does it compare to the frequency
response of this circuit? Determine the output theoretically using Laplace transforms
4- Reverse the capacitor and resistor, and develop a new Bode plot for this circuit. What
type of filter is this? Repeat items 3 & 4 for this new circuit. In all cases, do a theoretical
Bode plot as well.

Page 97
EET 300 Computer Applications Manual

LESSON 7 – FOURIER ANALYSIS

You will Learn:

 How to understand Fourier analysis using Mathcad

 How to do a Fourier analysis with PSpice

Page 98
EET 300 Computer Applications Manual

FOURIER ANALYSIS - MATHCAD

One of the basic concepts in Fourier analysis is an understanding of how combining harmonics of
a sinusoidal waveform can produce other periodic waveforms. A Mathcad worksheet, Recursive
Fourier Analysis.mcd, was created to demonstrate this principal (see next page).
Note the use of functions such as odd and even. Look them up in Mathcad help, to understand
why they were used.

Page 99
EET 300 Computer Applications Manual

Demonstration of Fourier series

First, create variables for odd harmonics, even harmonics, and all harmonics. Odd
harmonic variable would be 1 for an odd number, and 0 for an even number. The
even harmonic variable would be 1 for an even number, and 0 for an odd number.
The all variable would be 1 for odd or even.

odd ( i) mod( i , 2 ) even( i) mod( i 1 , 2 ) all( i) 1


For a specific time function, determine whether there are only odd, even, or all harmonics

oddeven( i) odd ( i)
Select how many harmonics you want to view

n 5
Create a function that is based on the Fourier series from calculations or from Table 9-2

2 .sin( i.π .t )
g( i , t )
i.π
Determine the resulting time function, placing the appropriate odd/even function in the
summation sign

n
f( t ) g( i , t ) .odd ( i)
i= 0

Determine the time axis (based on the fundamental frequency)

t 0 , .01 .. 4

0.5

f( t ) 0

0.5

1
0 1 2 3 4
t

Page 100
EET 300 Computer Applications Manual

FOURIER ANALYSIS - PSPICE

You can perform Fourier analysis on any waveform, whether you have generated it using a
simple source or the waveform is the output from a circuit.

Fourier Analysis of A Simple Waveform


1- Set up the circuit with a source, a resistive load, a ground and a voltage marker.

2- Set up the transient analysis.

If you set up the combination of pulse width, period and Final Time in the analysis so that you
only see one waveform, you will see a Fourier Transform.

If you change the parameters (most likely the Final Time) so that there are repetitive waveforms
in the plot, you will be approaching a Fourier series.

3- Simulate the circuit, and generate a plot.

4- Choose Trace, Fourier or click on the Fourier button in the toolbar.

5- To view the lower harmonics, change the X-axis settings.

 You can also look at the Fourier analysis of any circuit using the same procedure. If you set
up the voltage markers to show the input and outputs, you can then observe how the circuit is
affecting the frequency content of the input signal.

EXERCISE

1- Set up a circuit with a VPULSE part, a resistor (use the default value) and an AGND part.
2- Set the VPULSE part to the following parameters: V1=0, V2=5, PW=1, PER=5.
3- Run a transient analysis with a Final Time of 5 s.
4- Change the plot to a Fourier analysis, and change the X-axis setting to user defined, 0 to
40Hz.

Page 101
EET 300 Computer Applications Manual

5- Change the X axis settings to a maximum of 10 Hz, and observe the difference in the
graph.
6- Derive theoretically and compare.
7- Change the PER to 2, and change the Final Time in the transient analysis to 20.
8- Generate the waveform, and then generate the Fourier plot. Because you see many
waveforms on the plot, the Fourier plot will appear more like a line plot, or more like the
Fourier series.
9- Add a 100 uF capacitor in series with the resistor, and place a voltage probe at the input
and output. Change the PER back to 5, change the Final Time back to 5, and run the
transient analysis. Change the plot to a Fourier analysis, and compare the input and
output spectra.

Page 102
EET 300 Computer Applications Manual

PROBLEMS 12-13

PROBLEM 12

1- Generate a square wave, PW=1s and PER=10s.


2- Set the Final Time to 2s, and generate a Fourier plot. How much less is the 5th harmonic
from the fundamental.
3- Decrease both PW and Final Time by 1/10, and generate a new Fourier plot. Compare
the two (you might want to look at only the first 10 harmonics).
4- Repeat item 3 once more.
5- Repeat items 1-4 with a triangular waveform and a sawtooth pulse (see pg. 414).
Compare the three waveforms, both theoretical and from the PSpice experiment.
6- Change the PER to 2s, and the Final Time to 10s for the square wave. Generate a Fourier
plot. How is it different from the one in item 2?
7- Change the Final Time to 40s for the square wave, and repeat item 6. What is
happening?

PROBLEM 13

1- Generate plots for both the input and output for the circuits in Examples 6-49 and 6-50
(page 257). Make sure that you set the Final Time so that you have only one waveform
appear on the plot.
2- Generate a Fourier plot, with the input and output superimposed. Compare the input and
output plots for both circuits. What does the Fourier transform show, and is it correct?

Page 103
EET 300 Computer Applications Manual

APPENDIX - PROBLEMS IN THE TEXTBOOK

The textbook, in the back of each chapter, has examples in either PSpice or Matlab. However,
the examples in Matlab can be accomplished in MathCAD. Three examples are shown in the
next several pages. Try to set them up on your own, and then modify them.

oblem - Matlab example 4-1, p. 153, using Mathcad

10 8 .e
75
t)
z 2 8..63
0 , 1 .. 400 z = 7.04

Capacitor Voltage of Example 4-7

0 50 100 150 200 250 300 350 400


t
time, seconds

Page 104
EET 300 Computer Applications Manual

Problem - Matlab example 5-1, p. 201, using Mathcad

(s 4)
F( s )
2
s 3 s 2

f( t ) F ( s ) invlaplace ,s 2 .exp ( 2 .t ) 3 .exp ( t )

t 0 , .01 .. 5

1.5

f( t )

0.5

0
0 1 2 3 4 5

Page 105
EET 300 Computer Applications Manual

Plotting Impulse response of a transfer function

Problem 7-1, p. 305, using MathCad

First define the transfer function, G(s)

1
G( s )
s
2 .
1.4142s 1

Then, create a variable f(t), which is defined by using the invlaplace keyword
When you click on that keyword, you will have two placeholders. In the one to the
left of invlaplace, type in G(s). In the placeholder to the right of G(s), type the variable
s. Then press return - you will get the time function

f( t ) G( s ) invlaplace , s .exp( .7071.t ) .sin ( .70711356230806378162


1.4142000002601225741 .t )

Define the appropriate time period - note: you might have to experiement.
However, if you see an exponent, such as the number .7071, take the
inverse of that number, and multiple by 5. That is 5 time constants. Set the
initial value of t to 0, the increment to at least 0.01 of the final value, and set
the final value to about 10 time constants (if you know them).

t 0 , .01.. 10

Then type below this f(t)@, and then press return. You will get the graph.
If you change anything above, such as the G(s) term or the time period,
the graph will change.

Impulse Response of Filter for ex. 7-3


0.6

0.4
response

f( t )
0.2

0.2
0 2 4 6 8 10
t
time (s)

Page 106
EET 300 Computer Applications Manual

INDEX
Laplace Transforms - Mathcad, 79
Adding cursor to plot, 63
Adding labels to curve, 63 Marking coordinate values, 90
Adding parts to schematics, 27 Math palette, 15
Analysis Setup Dialog Box, 55 Message Viewer, 47
Automatic mode, 11 Moving parts in PSpice, 32
Multiple cursors, 88
Bode Plot, 94 Multiple plots in PSpice, 92
Bubbles, 60
Overview, 25
Calculations in Mathcad, 9
Changing axis, 62 Part Browser Dialog Box, 28
Changing colors in Probe, 57 Parts browser dialog box, 30
Changing parts attributes, 35 Printing graphs, 65
Complex numbers, 11 Pulse voltage source, 52
Connecting parts, 34
Copying graphs, 65 Redraw, 42
Copying Mathcad to Word, 16 Roots of an equation, 81
Copying schematics into Word, 44 Rotating parts, 33
Copying/pasting parts, 39
Custom axis, 73 Saving a schematic file, 38
Schematics window, 26
DC Analysis, 46 Setting up functions in Mathcad, 17
Defining a variable, 10 Sweeping a component value, 66
Deleting parts, 33
Text in Mathcad, 8
Fourier analysis - Mathcad, 100 Transient analysis, 54
Fourier analysis - PSpice, 102
Functions, 74 Undo/Redo, 41
Unit conversion, 14
Graphing in Mathcad, 21 Unit step, 53
Greek symbols, 20 Using math parts in PSpice, 71

Inserting a function, 13 Viewpoint, 46


Integration and Differentiation, 18 VPWL, 69
Introduction, 5 VSin source, 93
Ipulse, 46
Zoom, 43
Laplace Component - PSpice, 84

Page 107

S-ar putea să vă placă și