You are on page 1of 174

ADVANCED PHYSICS

THROUGH MATHCAD
POSTGRADUATE LEVEL
FOR II MSc., PHYSICS

BY
Dr.S.PALANISWAMY
PROFESSOR OF PHYSICS
PSG COLLEGE OF ARTS AND SCIENCE
COIMBATORE-641014

33

TABLE OF CONTENTS
CHAPTER-1- MathCAD - Tools
1. MathCAD Tool Bars and Palettes
1.1 Features of the MathCAD Window
1.2 Main menu
1.3 Math Palatte
1.4 The tool bar
1.5 The resource centre navigational control

2. Working with MathCAD Regions


2.1 Introduction
2.2 Moving regions
3. Entering Math and Text
3.1 Entering math
3.2 Entering text
4. Working with MathCAD styles and templates
4.1 Introduction
4.2 Using a template
4.3 Using styles

33

4.4 Creating a template


5. Defining variables
6. Defining functions
6.1 Trig and log
6.2 Matrix functions
7. Building Mathematical Expressions
8. Editing Expressions
9. Defining Range Variables
10. Defining Vectors and Matrices
Questions

CHAPTER-2-The MathCAD Advantage


Introduction

1. Do arithmetic with MathCADs built-in functions and math operators


2. Define your own variables and functions
3. Evaluate functions and expressions over ranges
4. Plot functions quickly
5. Visualize data in two and three dimensions
6. Compute sums and integrals
7. Do matrix computations
8. Solve equations numerically
9. Carry out symbolic operations
10.Create multiline procedures using new programming operators
11.Create animations to visualize results over time.

CHAPTER-3-MathCAD -graphics

33

1. Creating Graphs
2. Two dimensional graph- three dimensional graphs
3. Formatting Math and Text
4. Formatting Results
5. Using Units
6. Creating Programs
7. Conditional statements
8. Program loops
9. Fourier series
10. Bohrs theory of atomic structure
11. Numerical solution of Schrdinger wave equation
12. Lorentz force
13. Van-der-Waals equation
14. Resistivity

CHAPTER-4-COMPUTER ORIENTED
NUMERICAL METHODS
1. Euler's method of solving ode
2. False-position method
3. Fixed point iteration procedure
4. Modified Euler predictor corrector method
5. Newton-Raphson method
6. Numerical Integration-3/8 Simpson Rule
7. Predictor - Corrector method
8. Range-Kutta method

33

CHAPTER-5-MATHCAD PROGRAMS TO
PHYSICS PROBLEMS
1. Numerical solution of Schrdinger wave equation
2. Harmonic oscillator
3. Learning molecular symmetry-H2O,NH4
4. Numerical solution of second order differential equation
5. Study material of hydrogen atom and molecule
6. Ground state of helium atom byVariation method
7. Electron motion through rectangular potential barrier
8. XY3- planar

33

PREFACE
Many software tools exist to analyze and report the results of technical
experiments and design work. One of these packages in called MathCAD. MathCAD is a
program that allows the user to enter variables, formula, and text into the computer in a
"notebook" style format. The formula is entered just as they appear in textbooks and other
technical references, and the program computes the resulting values given the previously
defined values of the variables and the formulas. The program also allows the user to
annotate the calculations with areas of text. The program can produce a number graph
types. This feature is useful in visualization of functions and in plotting the data collected
from experiments. This lab activity handout demonstrates the computational and
reporting features of MathCAD. It was created with MathCAD to demonstrate the
features of the program. Use this software to produce graphs and perform calculations
associated with the laboratory experiments for this course. This introduction is based on
the commands and features of MathCAD Version 2001 Professional. The commands and
features may differ in the newer version of the program, but the general operation of the
program is no different.

Preliminary Exercises
1. Begin your MATHCAD session by opening the MathSoft Apps Group in Windows
and double clicking on the MATHCAD icon. You may wish to work through the Mathcad
Tutorial before you start the set of exercises in this document. Exit the tutorial session
before doing this set of exercises.
2. Simple keyboard practice. Notice the structure of a Mathcad page. It is like a white
piece of paper. The vertical line marks the right edge of the current page. The area to the
right of that line is a separate page. Sample the various pull down menus. Notice how
groups of possible actions are grouped together. Entering simple equations onto the
MATHCAD page. (Use the space to the right of this text on the screen Enter 16-8/2=
Note how the division sign behaves. Pressing = produces the numerical result of the
operation. When entering expressions for calculation, do not put in spaces. Mathcad will
33

put them in for you, and if you put them in, Mathcad will think you are entering text, not
an expression to be evaluated.
To produce (16-8)/2, one should either type the entry with the
parentheses included, or type 16-8, highlight the entire operation using the space bar, and
then press the division button. What ever is highlighted, i.e. in the blue box, will appear
in the numerator. Try this step now. The hierarchy of operator evaluation follows the
commonly used standards for computer programming. Powers are followed by
multiplication and division, followed by addition and subtraction. Pressing the =
evaluates the mathematical sequence and returns the numerical value to the right of the
equal sign as you saw above. To take the power of a function use the carat symbol (Shift6). Evaluate 4 squared. Practice now with other squares. You can make your practice
exercises right here in this document using the pages on the right portion of the screen or
print this document and create your own collection of answers to the exercises. Save your
file periodically in case of a computer glitch.
You can also annotate your document with text regions. This
will give you a personalized tutorial document that you can refer to if you forget
something you learned here. You can also add sample exercises to your personal
document as the semester proceeds. This is important because you may need to refer to
techniques from one exercise to the next and you don't want to waste time recreating a
technique that was already constructed in your practice file. Most users of Mathcad have
a file of techniques that they can refer to for new work. Start you file of techniques today.
After getting used to MathCAD software, try simple problems in Physics.
The problems like ideal gas equation, the wave pattern in sound, mechanical problems
using Newtons laws and de Broglie matter wave problems can be solved.
In this book, the first chapter introduces the learners the MathCAD
Tool Bars and Palettes.
The second chapter deals with advantages of MathCAD in developing
solutions to problems.

33

The third chapter introduces the method of creating 2 dimensional and 3


dimensional graphics in MathCAD. Further it deals with the creation of a software to
solve Fourier Series in mathematics, Bohr atom model to create hydrogen spectrum
theoretically, to get the numerical solution of Schrodinger Wave equation, to study the
Lorentzs force on the charged particle and to study the van-der-Waals force.
The fourth chapter entirely deals with the numerical methods that are
frequently used in physics.
The fifth chapter deals with the problems in advanced physics.
Dr.S.PALANISWAMY
DEPARTMENT OF PHYSICS,
PSG COLLEGE OF ARTS AND SCIENCE,
COIMBATORE - 641014

33

CHAPTER-1
MathCAD - Tools
1. MathCAD Tool Bars and Palettes
1.1 Features of the MathCAD Window
1.2 Main menu
1.3 Math Palate
1.4 The tool bar
1.5 The resource centre navigational control

2. Working with MathCAD Regions


2.1 Introduction
2.2 Moving regions
3. Entering Math and Text
3.1 Entering math
3.2 Entering text
4. Working with MathCAD styles and templates
4.1 Introduction
4.2 Using a template
4.3 Using styles
4.4 Creating a template
5. Defining variables
6. Defining functions
6.1 Trig and log
6.2 Matrix functions
7. Building Mathematical Expressions

33

8. Editing Expressions
9. Defining Range Variables
10. Defining Vectors and Matrices.
Questions

1. MathCAD Tool Bars and Palettes


1.1 Features of the MathCAD Window
Before you move on to learning more about MathCADs features and especially about
building math and text in your own MathCAD worksheets, take a moment to look at the
MathCAD application window in front of you.

1.2 The Main Menu


Here is your gateway to math, graphics, and symbolic functions and provides commands
that handle the details of editing and managing your worksheets. Click on the Math and
the Symbolic menus to see the array of computational functionality available to you in
this product. Access to any MathCAD Electronic Books you may have installed is now
available through the Help menu.

1.3 The Math Palette


Below the main menu is a tear-away bar whose buttons bring up palettes of math
operators. If you let your mouse hover over each of the buttons on the bar in turn, you'll
see a tool tip telling you what palette each button brings up:

33

Click on one of these buttons in the bar to bring up the associated operator palette. You
can then use the operator palettes to insert math symbols right into your Mathcad
worksheet.

The Tool Bar


is another tear-away button bar that provides shortcuts for many common tasks, from
worksheet opening and file saving to spell checking to bringing up lists of built-in
functions and units. Depending on what you're doing in your worksheet, one or more of
these buttons may appear grayed out. Tool tips will remind you of the functions of each
of the buttons. One
useful button is:

33

1.5 The Resource Center Navigational Controls


appear whenever you have a Mathcad Electronic Book open and give you ways to browse
among the sections of the Book and find topics of interest. This Tutorial you are reading
is in fact a Mathcad Electronic Book! Just let your mouse hover over each of the
navigational buttons at the top of this window to see a tool tip explaining what each one
does.
Finally, the message line

at the bottom of the Mathcad window gives you status alerts, tips, keyboard shortcuts,
and other helpful information. It also lists the calculation status of your worksheet -"auto" here means that the worksheet is in automatic mode, which means Mathcad will
automatically recalculate any math expressions if you make edits to your worksheet. You
can tell when Mathcad is recalculating because "WAIT" appears on the message line and
the cursor changes to a flashing light bulb. Other information that appears on the message
line is whether you have the Caps Lock or Num Lock key depressed on your keyboard, as
well as the page number of the current worksheet.

33

2. Working with MathCAD Regions


2.1 Introduction
Every MathCAD equation, text paragraph, and plot in a worksheet is a separate object
called a region. You can select a single region by clicking in math or text in your
worksheet. The region then shows up with a thin rectangle around it. If you move your
cursor to one of the edges of the region, notice how your cursor changes to a small hand
-- which lets you move the region. Try dragging the regions below to your worksheet
window. Note that if you click in the math region, you will see blue selecting lines under
the material currently selected. If you click in a text region, you will see black boxes at
each corner and the middle of each line. These boxes allow you to resize text regions,
which you can do in your worksheet window, but not in the Resource Center.

2.2 Moving Regions


You can also drag-select multiple regions at one time to move them around on the screen
to your liking. To move regions in your worksheet:
Click in an empty area to position the red crosshair cursor in your worksheet and then
drag-select regions so they appear in dashed selection boxes.
Move your cursor inside one of the boxes. Notice that it becomes a small black hand.
Hold down your mouse button and drag your mouse. All of the selected regions will
move with it.
Once you have the regions positioned the way you want them, release the mouse button
and click on an empty part of the screen to deselect the regions.
Hint: If you want to grab a group of regions, but want to deselect one of them, use shift
click on individual regions, to do so.
Another way to see the regions in your worksheet is to choose Regions from the View
menu. The region boundaries will be highlighted against a contrasting background. An

33

important property of Mathcad is that it reads your document from left to right and top to
bottom, just as you read a book. For an example of what this means, select the y2 = 100
below and drag it above the definition of y (the definition of the variable is done in
Mathcad with the colon-equals symbol; more on that later). You will see that Mathcad is
no longer able to tell you what y 2 equals because it doesn't know what y equals yet.
Notice that if you drag the region below the original assignment, it computes!

You can also easily delete selected regions. Select the math regions above in dashed line
boxes and choose Cut from the Edit menu. (You may need to copy the regions to a
worksheet of your own to try this out.) Now click in the empty space above and choose
Paste from the Edit menu to reinstate the equations. You can see how this can be useful
if you delete something by accident. Using this technique, you can select many regions at
once and clear them away. And, if you make a mistake, you can easily bring the regions
back, provided you bring them back before you Cut something else.

3. Entering Math and Text


3.1 Entering Math
Click your mouse in the blank space below so you see a red crosshair cursor. Now type:
Type 1+ See on screen

After you type the + you see a little black box delimited by blue editing lines. In
Mathcad this black box is called a placeholder. If you continue typing, whatever you type
next will appear in the placeholder. For example, type 2 in the placeholder, then press
the equals key (=) to see the result.
If you click outside the region, or press [Enter], you should see:

33

The basic operators are listed below, along with their keystrokes and Arithmetic Palette
button equivalents. To see the Arithmetic Palette, click on the Math Palette button.

Notice that math in a Mathcad worksheet appears in familiar math notation -multiplication as a raised dot, division with a fraction bar, exponents in a raised position,
and so on.

3.2 Entering Text


To create a text region, click in a blank area of the screen to position the red crosshair
cursor and type a double-quote ["]. You can also just start typing, and as soon as you
type a space, Mathcad converts from a math region to a text region. Typing certain
characters used in math will not automatically convert to a text region, so it is always
safest to use the double-quotes.Now you can now type whatever you like, just as in a
word processor. Notice that as the text region grows,a black box appears around it, and
there are resizing "handles" on the right and bottom edges of the rectangle. Once you are

33

done, click outside the text region to go back to inputting math. The black selection box
disappears when you're no longer working in the text region.

4. Working with MathCAD Styles and Templates


4.1 Introduction
Two new features in Mathcad 7 are styles and templates, which work much like those in
word processors. We have provided several templates for your use or revision, each
containing a number of styles. You can also create your own styles and store them in a
template so they are available for other documents.

4.2 Using a Template


To use a built-in template, choose File/New, then choose a template from the templates
listed, or browse to your own template directory. Just substitute your own text or bitmaps
in any of the placeholders, or use or revise the built-in styles.

4.3 Using Styles


The styles in each template are visible from the first pull- down menu in the Format Bar.
If the Format Bar is not visible, choose View Format Bar. Styles save you work,
because you can quickly apply a style such as Heading One to specific text regions,
instead of having to redefine the font, size, and indents for each new heading. To create or
modify a style, choose Format Style. To save your styles for use in new files, you must
make a template file.

4.4 Creating a Template


Creating a new template or revising another template is very easy. You can
create text styles and number formats
set the fonts and sizes for constants and variables in math regions
add any bitmaps that you want on every page such as a line across the top or bottom of
the file

33

put page numbers, filenames, and the current date in headers or footers
set the formats for numbers
Then Save As and choose under File of Type, Template. Make sure to have the file
extension be .mct. Your settings, styles, and bitmaps will be available for the next file
you create, saving you the time of redoing that work for each file. This will also help
make your files more consistent.

5. Defining Variables
Often you will want to define a number as a name you can use in subsequent calculations.
For example, click to position the red crosshair in an empty space below and type:
Type age:23 See on screen

Notice that when you type the colon [:] key or, press the assignment operator key.

on the Arithmetic Palette, Mathcad displays :=. The assignment operator ("colon
equals") in Mathcad is used for definitions. To see what age equals, you just type the
name followed by the equals sign:
Type age=
If you wanted to assign a different value to age, just click to the right of the 23 on the
right-hand side of the definition of age above, backspace over it to delete it, and enter the
new value. Notice that as soon as you press [Enter], age= changes as well. Because of
this ability to vary the value of a name, this type of definition is called a variable in
Mathcad. You can now use a Mathcad variable in an equation:

33

Or, use the variable to define another variable:

Try defining some variables of your own (you can call your variables x or money_spent
or any other names you can think of) and use them in equations in your main worksheet.
Remember that you use the assignment operator [:] for definitions, and you type [= ] to
calculate an answer.

6. Defining Functions
The syntax used for defining a function in Mathcad is the same as you see in textbooks.
For example, position the red crosshair in a blank area and try typing:
Type f(x):x^2 See on screen

Notice that you use the assignment operator to define functions, just as you use the
assignment operator to define variables in Mathcad. Once you've defined a function like
f(x), you can use it in a number of ways:

Plug in a numerical value as the argument of f(x).

Define a range variable (more on this later) and plug it in as the argument of f(x) to see a
table of values.

33

Even define another function in terms of f(x).

You can define a function using expressions you build up from the keyboard or from the
palettes of math operators, as described above, and you can also include any of Mathcad's
hundreds of built-in functions. To see a scrolling list of builtin functions along with brief
descriptions, select Function from the Insert menu, or click on the

button on the toolbar. The Insert Function dialog box, pictured below, lets you insert a
function name directly into a math placeholder in your worksheet.

33

You can also type the name of any built-in function directly from the keyboard. Here are
just a few examples that use some of Mathcad's built-in functions.
6.1 Trig and Logs

6.2 Matrix Functions

7. Building Mathematical Expressions


Click to position the red crosshair in the empty space below and type the following. Pay
particular attention to what happens when you press the spacebar:
Type f(x):x+6[Spacebar]*(x^3[Spacebar]-1) See on screen

33

The first time you pressed [Spacebar], you selected

in blue editing lines. So, when you typed the multiplication sign, you were multiplying
this entire expression by the expression that followed. If you hadn't pressed [Spacebar]
the first time, you would have seen

which is a completely different expression. When you pressed [Spacebar] the second
time, x3 was selected in the blue editing lines. Therefore, when you typed -1, you were
performing subtraction on the entire expression x3 . Compare what you typed above to
what happens when you type f(x):x+6*(x^3-1) you probably get something that looks
like

The exponent operator is called a sticky operator because your keystrokes will "stick" to
the exponent until you specifically ask to get out by pressing [Spacebar]. This stickiness
applies to exponents, square roots, subscripts, and division. To create the expression type
below:

follow the following steps:

33

Type x^2[Spacebar]
Now x2
is selected in blue editing lines, then Type +3[Spacebar] so that the entire equation is in
the editing lines, then
Type /5[Enter] and done!
If you try entering the expression again without pressing [Spacebar] after typing +3 you
should get

And if try typing x^1/t^2[Spacebar][Spacebar][Spacebar]/3You should get

You may need to create some of your own equations in your main worksheet window in
order to get a better feel for sticky operators.

8. Editing Expressions
Understanding the structure of expressions in Mathcad will help you edit them efficiently.
Looking at the highlighted equation below, do the following with the mouse:

Click on the square root symbol. Notice that the square root and everything under
it is selected in blue editing lines.
Click immediately to the right of the 5 under the radical, then start pressing
[Spacebar]. Notice how more and more of the expression is selected in blue editing lines.

33

Click immediately to the left of the 3 in the exponent of x3, then start pressing
[Spacebar]. Notice how more and more of the expression is selected in blue editing lines.
The blue editing lines define a subexpression that will be operated on by the next
operator or expression you type. If your editing lines are positioned to the left of an
expression, the next operator or expression you type will appear to the left of the vertical
line; if your editing lines are to the right of an expression, the next thing you type will
appear to the right of the vertical line.
Now notice what happens when you use other mouse selection methods on parts of the
highlighted equation below:

Double-click on the x in the expression f(x). Notice that double-clicking selects the
variable in reverse video.
Click to the left of the x2 under the radical, then start dragging your mouse to the right.
Notice how more and more of the expression is selected in reverse video.
When you select a part of a math expression in reverse video, the next operator or
expression you type will replace the selected expression. This is probably how you're
already used to editing text on the screen in most word processors.
Try It Out!

If you want to replace the 5 with a 6 , double-click on the 5 so it appears in reverse


video, then type 6.
If you want to replace the division with multiplication, click to the left of the 8 in the
denominator, press the [Backspace] key, and type [*].

33

If you want to take the square root of the entire right side of the equation, click to the
left of the radical and press [Spacebar] until the entire right-hand side is selected in blue
editing lines. Then type a backslash [\]s.
If you want to subtract x instead of x3 on the right-hand side, drag-select the x 3 and
then type 1/2[Spacebar]*x.
If you are editing an expression and make a mistake, just select Undo from the Edit
menu to return to the original expression. Or, if you recently saved your worksheet, close
it without saving changes and reopen it.
Here is another example you can try to get the hang of editing math in Mathcad. Enter the
following lines in the MathCad editor

then edit the last expression so that it looks like

The variable x has been defined at the beginning so you can see the effects of your edits.

Here Are the Steps . . .


First, change the x2 to(x- 5)2 . Double-click on the first x in the expression and then type
x-5.
Now change the leading constant from 2 to -2. Click immediately to the left of the
leading 2 so you see blue editing lines, and then type .
Now edit the fraction 3/2. Double-click on the 3 in the fraction bar to select it and then
type 5.
Finally, change the addition at the end to a subtraction. Click immediately to the left of
the final equals sign in the expression so you see blue editing lines. Press [Backspace] to
delete the plus sign. Now type [-].

33

So, incorporating everything you've learned so far, try to reproduce the following
equations yourself:

You should have typed


score:3[Enter]
result:score+6[Spacebar]\+1/2[Spacebar]
[Spacebar]/score^2[Spacebar]3[Enter]
result=[Enter]
If you had trouble with this, try practicing with some more examples until you feel
comfortable editing Mathcad expressions.

9. Defining Range Variables


Assigning a range of values to a variable is straightforward in Mathcad. For example, to
create a variable x that runs from 0 to 10, just click to position the red crosshair in some
free space and type x:0;10
After clicking away, you should see .

Notice that when you type the semicolon character [;], it displays on the screen as two
dots (..) followed by a placeholder.
This is Mathcad's range variable operator. Another way to put the range variable operator
in your worksheet is with the
Range Variable button

33

on the Math Palette.


You can now use a range variable as you would any other variable. Notice that Mathcad
creates an output table a vertical series of boxes that contain numbers -- when you type
[=]after an expression involving a range variable.

Type x= See on screen

Type f(x)=See on screen

If you want your range to be in increments other than 1 (the default), enter the next value
in the range after the first one.For example, to create a range variable x that goes from 1
to 10 in increments of 0.1, type:

33

Type x:1,1.1;10 See on screen

Notice that you typed a comma before the second value in the range, and then you typed
the semicolon [;] after the second value. Here are some other examples, along with the
keystrokes used to create them:
Type x:1,1.1;1.8See on screen
x := 1 1.1 1.8
Type data:10,8;0See on screen
data := 10 8 0
Type n:202,192;102See on screen
n:= 202 192 102
Here the range goes down!
Type x=See on screen

Type data=See on screen

33

Type n=See on screen

Try defining your own range variable and using it in an expression below.

10. Defining Vectors and Matrices


The examples you've seen so far have involved single numbers or scalars. Mathcad has
many powerful features and functions, however, for dealing with arrays of numbers, such
as vectors and matrices. Creating a vector or matrix in Mathcad involves just choosing
the dimensions of the array and filling in the placeholders. For example, to create a vector
v like the one shown below, click to position the red crosshair in some free space and
Type v:
Choose Matrix from the Insert menu (or click on the matrix button inside the Vector
and Matrix Palette)

33

Fill in the appropriate number of rows and columns. For example, the vector below has
3 rows and 1 column.
Click on Insert.
Fill in the placeholders with the appropriate values. Use [Tab] to move from
placeholder to placeholder inside the vector, or click on the appropriate placeholder to
select it.

To access a particular element of a vector, you use the subscript operator, which you
create by typing a left square bracket ( [ ), or by using the
in the Arithmetic Palette. By default the first element has the index 0:
Type v[0= See on screen
v0 3.3

The next element has the index 1:


Type v[1= See on screen
v1 1.2

The last element has the index 2, and so on:


Type v[2= See on screen
v2 8

If z is a matix, then the 3rd element in the first column can be accessed by typing v[2,0
For convenience, you can define the index as a range variable to access all of the
elements at once:
Type i:0;2 See on screen
i:= 02

Then
Type v[i= See on screen

33

For your exercise, try defining a vector and its index. It's important to understand that an
index for a vector will always be a range of consecutive integers in Mathcad, starting
from 0. Any values not specifically defined by you will be defined to equal 0 by Mathcad.
For example, consider the followings:
Type i:2;5 See on screen
i :=25
Type wrong[i:1 See on screen
wrong i:= 1
Type wrong= See on screen

You might expect the vector wrong to have four elements (the 2nd, 3rd, 4th and 5th).
However, as you can see, it has six. This is because internally, Mathcad still keeps track
of the 0th and 1st elements. And because these were not specifically defined, Mathcad
made them equal to 0.
It is useful to use vector elements as arguments of functions. For example, we'll use the
constants and function defined
below:
b:= 9.7
a:= 1.1

33

Now define a vector and use its elements as an argument of the function:

Try defining a vector and using its elements in a function. You can also use vectors as
arguments of functions. For example:
Type f(x):[Ctrl]4x See on screen

Here we use the vector summation operator, which is also available via the

button on the Vector and Matrix Palette.

Most of the vector and matrix operators can be found in the Vector and Matrix Palette,
but here is a listing of a few basics:

33

Mathcad has a wide variety of built-in functions for manipulating vectors and matrices.
Here is a small sampling, using the matrix M defined below:

Eigenvalues of a matrix

33

QUESTIONS
1. Explain MathCAD Tool Bars and Palettes.
2. Discuss Working with MathCAD Regions.
3. Explain the method of entering math and text regions in mathCAD.
4. Discuss Working with MathCAD Styles and Templates.
5. Define the variables and functions.
6. Explain building mathematical expressions.
7. Define range variables, vectors and matrices.
8. Explain editing expressions.
9. Explain the method of working with matrices and vectors in mathCAD.

33

CHAPTER-2
The MathCAD Advantage
Introduction

1. Do arithmetic with MathCADs built-in functions and math operators


2. Define your own variables and functions
3. Evaluate functions and expressions over ranges
4. Plot functions quickly
5. Visualize data in two and three dimensions
6. Compute sums and integrals
7. Do matrix computations
8. Solve equations numerically
9. Carry out symbolic operations
10.Create multiline procedures using new programming operators
11.Create animations to visualize results over time

33

Introduction
Mathcad is a unique, powerful way to work with equations, numbers, text, and graphs.
Unlike any other math software,Mathcad does math the same way you do. That's because
it looks and works like a scratchpad and pencil. Mathcad's onscreen interface is a blank
worksheet on which you can enter equations, graph data or functions, and annotate with
text --anywhere on the page. And instead of forcing you to use a programming-like
syntax, Mathcad lets you use the language of mathematics.In a programming language,
for example, equations look like this:
In a programming language, for example, equations look like this:
x=(-B+SQRT(B**2-4*A*C))/(2*A)
In a spreadsheet, equations go into cells looking something like this:
X = (-B1+SQRT(B1*B1-4*A1*C1))/(2*A1)
In Mathcad, the same equation looks the way you would see it in a text or a reference
book:
2

b b 4 a c
2 a

The only difference is that Mathcad's equations and graphs are live. Change any data,
variable, or equation, and Mathcad recalculates the math and redraws the graphs -instantly. With Mathcad, you can solve a wide range of technical problems -- from the
simple to the very complex -- numerically or symbolically. You can also visualize
equations and data with 2D and 3D graphing. With Mathcad Electronic Books you also
get a wealth of mathematical knowledge and reference material -- all live and ready to be
dragged and dropped into your worksheets. Most important, Mathcad gives you all the
power you need to get the job done -- from start to finish. With Mathcad you can truly do
it all explore problems, formulate ideas, analyze data, model and test scenarios, select
the best solution . . . then document, present, and communicate the results. Using

33

Mathcad's connections to the Worldwide Web, you can also share your Mathcad
worksheets with colleagues and other professionals. This means you can collaborate
easily during any phase of a project -and you can do it in the rich and powerful language of mathematics.

1. Do arithmetic with Mathcad's built-in


functions and math operators
The operator palettes accessible from the palette strip at the top of the window give you
access to Mathcad's mathematical operators. First click in your worksheet to place a red
crosshair cursor, then click on a button in one of these palettes to insert a math operator
into your worksheet. To see a scrolling list of Mathcad's built-in functions, go to the
Insert menu and select Function, or click on the Insert Function button on the toolbar.

The red crosshair

Here are a few examples. These calculations are computed internally to 15 places, but
you can show fewer places in the answer -- just click on an answer and choose Number
from the Format menu, then change the number in the Displayed Precision field in the
dialog box. Get the square root and the power from the Arithmetic Palette, and type =to
see the answer. For the four basic operations, use +,,*, and / right from the
keyboard.

33

2. Define your own variables and


functions
The definition symbol := is in the Arithmetic Palette; you can also enter it by typing a
colon (:).

When you change a definition, Mathcad immediately recalculates any new values that
depend on it.

33

Try it! Click just to the right of the 4 in the definition of a above so you see the blue
editing lines:

Then type [Backspace] once to get a placeholder:

Now type 3. Click the mouse anywhere else on the screen and you'll see the answers
change.

3.Evaluate functions and expressions


over ranges
The .. range operator is in the Arithmetic Palette and can also be entered by typing a
semicolon [;]at the keyboard. Change the 2 in the definition of z to a 4 to see bigger
tables. To create these tables, just type z=, f(z)=and so on.

33

4.Plot functions quickly


Use the X-Y Plot button in the Graph Palette, or type [Ctrl]2 to get a plot operator; then
type expressions you want to plot in the middle placeholders on the x and y axes. You can
type expressions on the y axis only, and Mathcad will choose a default range for you
automatically on the x axis! You can enter several expressions separated by a comma (,)
in these axes placeholders to see multiple traces.

33

5.Visualize data in two and three


dimensions
The following plots show how Mathcad can automatically interpolate a 3D scatter plot to
create a surface plot. The same array of points is displayed in both plots. The first plot
was created using Graph/3D Scatter Plot from the Insert menu, and the second plot was
created using Graph/Surface Plot from the Insert menu. You can also use the
corresponding buttons from the Graph Palette.

33

6.Compute sums and integrals


The sum and integral operators are in the Calculus Palette. To build one of these
expressions, click in your worksheet to position the red crosshair, click on the appropriate
button in the palette, then fill in each placeholder.

7.Do matrix computations


To enter a matrix, click on the 3 by 3 matrix icon in the Vector and Matrix Palette (or
choose Matrix from the Insert menu), choose the number of rows and columns, then fill
in the placeholders.

33

8.Solve equations numerically


Start Mathcad's root finder off with a guess . . .
t:= 1
. . . andMathcad finds the closest root.

9.Carry out symbolic operations

33

You perform these symbolic operations by clicking on an expression and choosing


commands from the Symbolics menu.You'll find commands for simplifying, expanding,
factoring, differentiating, integrating, solving an equation, generating series expansions,
carrying out symbolic matrix operations, and more. Copy the expression below to your
main worksheet window, then click on it so you see it surrounded by blue editing lines (if
necessary press the spacebar to select more of the expression); then choose Simplify
from the Symbolics menu:

10.

Create multiline procedures using

new programming operators


Use the operators on the Programming Palette in Mathcad Professional to build
multiline Mathcad procedures with standard control structures: for and while loops,
branching, recursion, and more. Programs are seamlessly integrated with Mathcad's live
worksheets and math notation and can operate on scalars, vectors, arrays, and even arrays
of arrays. Look at the following programming example.

33

The above program implements Newton's method for finding nth roots of numbers within
a tolerance e which is then used in the following example.

11 .Create animations to visualize results


over time
Any part of a Mathcad worksheet can be animated. Try animating the graph below by
choosing Animate from the View menu, then entering values of FRAME from 0 to 20 in
the dialog. Next drag-select the regions below including the graph and equations to the
right, and finally press Animate. You will see the animation pre-process. Then you can
Mathcad lets you play back and save the animation as a standard video file or embed it in
your worksheet.

33

This only scratches the surface of Mathcad's mathematical features, but we hope it whets
your appetite to explore the product further! In the next sections you'll learn how to create
the basic elements of Mathcad worksheets: equations, text,and graphics.

QUESTIONS
1. Describe the different MathCADs built-in functions and math operators define
your own variables and functions.
2. Evaluate functions and expressions over ranges and explain the method to plot the
functions.
3. Explain the method of visualizing the data in two and three dimensions.
4. Explain the matrix computations in detail.
5. Explain the computation of sums and integrals.
6. Explain the method of solving equations numerically and the method carrying out
symbolic operations.
7. How will you create multiline procedures using new programming operators?
8. Explain the method of creating animations to visualize results over time.

33

CHAPTER-3

MathCAD -graphics
1. Creating Graphs
2. Two dimensional graph- three dimensional graphs
3. Formatting Math and Text
4. Formatting Results
5. Using Units
6. Creating Programs
7. Conditional statements
8. Program loops
9. Fourier series
10. Bohrs theory of atomic structure
11. Numerical solution of Schrdinger wave equation
12. Lorentz force
13. Van-der-Waals equation
14. Resistivity

33

1. Creating Graphs
Mathcad makes it easy for you to create an x-y plot. Just click in a new file, type an
expression that depends on one variable, for example, sin(x), and then click on the X-Y
Plot button

in the Graph Palette, or choose X-Y Plot from the Insert/Graph menu. Then press
[Enter]. Voila, a plot! You should see a nicely formatted plot that looks like this:

Try It Out!
The expression you plot doesn't even have to be a function of x. Try typing
y^2[spacebar]-3*y, followed by the @ key (a shortcut for creating an x-y plot). Mathcad
will plot over a reasonable default range for the dependent variable in your expression.
Here are a couple of other expressions you can try plotting in this way:

33

2. Two dimensional graph-Three


dimensional graph
2.1 Graphing a Function Using Range Variables
When you graphed the above expressions, Mathcad was choosing a default range for the
dependent variable. You can have control over the range of values that are plotted. To
graph a simple function using a range variable, do the following:
Define a function of one variable that you wish to plot. For example, graph the
following function: Type f(x):x^2[Spacebar]+8*x27See on screen

Define an independent variable for the horizontal axis. For example: Type x:0;10 See
on screen
Create your plot by clicking in the worksheet window, then type @ to create the x-y
plot and type x in the middle placeholder on the horizontal axis and type f(x) in the
middle placeholder on the vertical axis. Then press [Enter].
Your plot should look like this:

33

Those of you familiar with the plot of f(x) will notice that the trace looks a little rough.
To smooth the trace out, try changing the definition of x highlighted above to x:=
00.110 . The smaller increment (or step) means more points calculated, which means
more plotted, which makes the trace smoother because Mathcad is simply connecting the
dots. To format an x-y plot, just double-click on it (or choose Graph from the Format
menu) to bring up a formatting dialog box. The tabbed dialog box lets you change options
for logarithmic axes, grid lines, legends, trace types, markers, colors,axis limits, and
more. Experiment with the x-y plot below. Double-clicking on any Mathcad plot -contour, surface, polar,vector, etc. -- brings up an appropriate formatting dialog box.

33

2.2 Graphing Vector Elements


Here is a vector of data points called money_spent. We created the vector using the
Matrix command on the Insert menu; our vector below has 8 rows and 1 column.

To plot these data points, the horizontal axis must be either (a) an index variable into the
variable money_spenor (b) another vector with the same number of elements. For case
(a), first define an index into the vector:
Type i:0;7See on screen
i:= 0..7

33

Create your plot by typing [@] and typing


Type money_spent[iSee on screen
money_spent I in the placeholder on the y axis, and i in the placeholder on the x axis. You
should see a plot similar to this:

Notice here that box symbols have been used on a dashed blue line. To demonstrate case
(b), plotting two vectors of equal size against each other, we will define a second vector,
called day:

33

Now it's easy: Create the plot by typing @, as above, and type
Type money_spentSee on screen
money_spent
in the placeholder on the y axis, and
Type daySee on screen
day
in the placeholder on the x axis. The resulting plot should look similar to this:

Here the "points" trace type has been used with magenta O's. Notice that grid lines have
been turned off on both axes.

2.3 Graphing a Function of Vector Elements


You can plot a function over a domain that doesn't contain evenly spaced points. For
example, your domain could consist of a vector of values. Plotting a function of vector
elements entails defining a function, defining a vector which will be the domain for the
function, and plotting. An example of this is:

33

Define a function of one variable.


Type f(x):x^2See on screen
f (x):= x2
Define a vector of numbers to be the domain for the function. Type x: followed by
[Ctrl]M , and fill in the Matrices dialog box with the appropriate number of rows and
columns (here, 5 rows and 1 column), followed by OK. Then fill in the placeholders in
the vector.

Define an index variable. Type i:0;4 See on screen


i:= 0.. 4
Type @ and fill in the middle placeholders on the y and x axes with f (xi)
and xi. The result should look similar to this:

Here, the difference with plotting a function of a range variable is that the horizontal axis
does not have to be in even increments (such as 1, 2, 3, ..., 10). Rather, it can be any set of
numbers you may wish to plot.

33

2.4 Graphing Two or More Functions


Plotting multiple functions over a single domain on a single graph is straightforward. For
example, suppose you want to plot both 1/z and z 2 on one plot. It's easy! Just type the
two expressions separated by a comma and then type @:
Type 1/z [Spacebar] , z^2 @ [Enter] You'll see a graph similar to this:

In this example both expressions are plotted over the same default range of values, but
you could use two separate range variables if you wish. Try it out in your worksheet
window now.
Type f(x):sin(x) See on screen
f(x):= sin(x)
Type g(t):t^3 See on screen
g (t):=t3
Type x:-10,-9.9;10 See on screen
x:= 109.9 10
Type t:-2,-1.9;2 See on screen
t:= 21.9 2
Then,
Type @ in some blank space.
In the middle placeholder on the horizontal axis, type x,t.
In the middle placeholder on the vertical axis, type f(x),g(t).

33

Type [Enter].
Your result should look like this:

As you can see, plotting more than one function is simple --- just separate your arguments
with a comma (,). The same syntax holds for plotting multiple traces using vectors and
functions of vectors.

3. Formatting Math and Text


You can easily modify the way text and math appear in your worksheet. You can select
different default fonts, sizes, and styles using the controls on the Format Bar that
appears in the Mathcad window. (If the Format Bar is hidden, and you want to see it,
make sure Format Bar on the View menu is checked.) If you're used to working with a
word processor, this should be familiar.
Definitions for plot:
x:= 11.1 10
For example, suppose you want to make the following style changes to the math and text
in your worksheet.
F(x) := -2*(x-5)2 + 5/2*x -2

33

In the text region, make the word "Here" appear in Courier 12-point bold.
Change the math fonts to Times New Roman 12-point bold italic.
Here is a graph of f(x).

To practice, create some regions in your worksheet window by dragging them over. The
directions to make these changes follow.

3.1 Formatting Text


Here are the steps for changing the font and size for selected text:
Drag-select or double-click the word "Here" in the text region above when you are in
your worksheet window. The selected word will appear in reverse video.
Now choose your fonts and point sizes from the drop-down lists in the Format Bar,
and click on the appropriate buttons for special effects like boldface, italic, etc.
Further text formatting options are available by choosing Text from the Format menu.

3.2 Text Styles and Templates


You can access current text styles from the first drop-down list in the Format Bar. To
make a new text style, choose Style from the Format menu. If you want to save your
styles to use in new documents, save this file as a template. You can then open the
template and all your styles will be available for new documents. You may want to
examine the built-in styles
and templates which you can see when you choose File New or in the Template directory.

33

3.3 Formatting Math


To change the math fonts, first notice that Mathcad distinguishes between variables
(names of variables and functions in math regions) and constants (numbers), and it lets
you apply different font tags to each. Just click on a variable or constant in a math region
and use the Format Bar or choose Equation from the Format menu to make any
changes you want for variables and constants.
Mathcad also lets you highlight equations to emphasize them. Just click on an equation
and choose Properties/Highlight Region from the Format menu in the main worksheet
window. To select different default colors for the worksheet background and equation
highlighting, choose Color from the Format menu.

4. Formatting Results
Now that you've learned how to get results, both numerical and graphical, there are a few
tips you should know for formatting your results in Mathcad. Suppose you define some
function using the following steps:
Define the variables as constants
Type P:500 See on screen
P:= 5000
Type r:.07 See on screen
r:= .07
Type n:365 See on screen
n:= 365
Define A as a function of t , i.e. A(t)
Type A(t):P*(1+r/n)^n*t See on screen
A(t):= P*(1+r/n)n.t
Get the results for different values of t
Type A(3)= See on screen

33

A( 3) = 6.168 10 3.
This is a compound-interest calculation. Notice that by default Mathcad displays the
result (highlighted above) in exponential form if it's larger in absolute value than 1000,
and the result is shown by default with three places after the decimal point. Suppose your
calculation involved currency and you wanted to see the result in nonexponential form
with two places after the decimal point. To change the format of the result:
Double-click on the result (A(3)=), or click on the result and choose Number from the Format
menu.
Notice that the Number Format dialog box pops up.
Change Exponential Threshold from 3 to 6 (or another value > 3).
Change Displayed Precision from 3 to 2.
Click on OK.
A(3) would now display as
A(3) 6168.27
This changes the exponential threshold locally -- i.e., only for a(3). If you want to change it for
the entire worksheet,
Click on a blank part of the worksheet.
Select Number from the Format menu.
Change Exponential Threshold to the desired number.
Change Displayed Precision to the desired number.
Click on OK.
Under Number Format, you can also control, among other characteristics:
Complex tolerance
Zero tolerance
The radix of the result (octal, hexadecimal, or decimal) for integer values.
Plots, too, are easy to format via a dialog box you can summon by double-clicking on a result
(plot), or by choosing Graph
from the Format menu.
Suppose you want to change the traces on the following plot:

33

Type f(x):sin(x) See on screen


f(x):= sin(x)
Type g(y):cos(y) See on screen
g(y):= cos (y)
Type x:-10,-9.9;10 See on screen
x:= 109.9 10
Type y:-2,-1.9;2 See on screen
y:= 21.9 2

To create the plot above:


Type @ in some blank space.
In the placeholder on the horizontal axis, type x,y .
In the placeholder on the vertical axis, type f(x),g(y).
Type [Enter]. Notice that the traces are different colors. To reformat the plot,
Double-click near the center of the plot to see the X-Y Plot Format box. You can also
access this dialog box in your

33

main worksheet window by clicking on a plot and choosing Graph/X-Y Plot Format in
the Format menu.
Click on the Traces tab.
Click on trace 1, and change the Color to green (for example).
Click on trace 2 and change the Line to dadot (for example).
Click on OK.
Experiment with the different options to see how you can alter the trace types and other
graph characteristics. For example, you could end up with this plot . . .

. . . or with . . .

You can also make your plot log scaled (if appropriate), put in grid lines, set markers for
emphasizing certain areas of the graph, create legends and axis labels, even create a title

33

for the plot. Be sure also to try clicking once on a plot when you are in the main
worksheet window and then select Trace or Zoom from the Graph Palette. And, of
course, you can stretch the plot to make it wider or longer by dragging the sizing handles
you see at the right and bottom edges when you click on a plot in the main worksheet
window.

5. Using Units
One of the handy features of Mathcad is its ability to track standard units during
calculations and to convert the units of calculated quantities automatically. For example,
you can define a variable in terms of the built-in unit kilometers simply by multiplying a
number by km. Here we define the radius of the Earth and a surface area function:
Type r:6370*kmSee on screen
r:= 6370 km
Type A(r):4*p[Ctrl]g*r^2See on screen
A(r):= 4r2
(The symbol is also available on both the Arithmetic Palette and the Greek Symbols
Palette.) Then you can evaluate these expressions directly, or perform more extensive
calculations involving them:
Type A(r)=See on screen
A(r ) = 5.099. 1014
Notice that the result is automatically shown in terms of the base units of your default
unit system -- in this case SI. To see what the surface area of earth equals in hectares,
click once on any part of the equation below and notice the trailing black box on the
right-hand side. Double-click on this black box to bring up the Insert Unit dialog box.
Then double-click on
one of the displayed units to replace the units shown.

33

4 r2 5.099 .1014 m2
The result in hectares is
4r2 5.099 .1010 . hectare
This principle holds for all of the Mathcad built-in units, which is a very extensive list, as
well as for any units you may wish to define yourself. To see the list of built-in units in
Mathcad, choose Unit from the Insert menu.
w:= 100 joule
w 100 m. N
m:= 10-6. m
smoot:= 5.23 ft
smoot = 1.594 106 .m
m 6.273. 10-7 smoot
The units feature is also very convenient because it lets you know if you have made a
mistake in the units in your calculations. For example, the force calculation below should
end up in newtons (or an equivalent force unit) . . .
a:= 10.m/sec
mass:= 2 kg
F:= mass. a
F 20 s newton
but it appears to have an extraneous factor of seconds. Looking closely at the statements
in the calculation, you can see that the definition of the acceleration a is missing a term of
sec-1.

6. Creating Programs
6.1 What is a program?

33

A program is simply an expression made up of more than one statement (available in


Mathad Professional only). If you click on the examples below, you'll see how they look
when written as a program rather than as a single expression.

Despite the underlying equivalence between programs and simple expressions, programs
offer two distinct advantages:
When you use control structures like loops and conditional branches, a program can
become far more flexible than a simple expression could ever be.
A program made of several simple steps is often much easier to create than an
equivalent, but far more complicated expression draped with parentheses.

6.2 Defining a program (Mathcad Professional only)


To following steps illustrate how to define a the program

Type the left side of a function definition followed by the assignment operator ":".
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.

Click the "Add Line" button or press ]. This creates a vertical bar.

33

Click on the top placeholder, type "z" and click on the local assignment button.
(Be aware that the definition of z is local to the program. It is undefined outside the
program and has no effect anywhere but inside the program. You cannot use the
Mathcad's usual assignment operator ":=", inside a program. You must use the local
assignment operator represented by "<-".)
Complete the local assignment by typing "x/w" in the placeholder to the arrow's right.
The last placeholder should always contain the value returned by the program. Type
"log(z)" into this placeholder. You can now use this function just as you would any other
function or evaluate it symbolically.

7. Conditional statements
Use a conditional statement whenever you want a program statement to execute only
upon the occurrence of some condition as in the following program

type the value you want the program to return if the condition is false.
Note: To insert a conditional statement:
Click on the placeholder into which you want to place the conditional statement.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.
Click the "If" button or press Shift+]. Do not just type the word "if".
In the right placeholder, type a boolean expression.
Click the "Add Line" button to insert placeholders for additional statements if
necessary.

33

Click in the remaining placeholder and click the "otherwise" button. Do not just type
the word "otherwise".
In the remaining placeholder
If you use more than one "if" statement before an "otherwise" statement, the "otherwise"
statement is executed only when all the conditions are false.

8. Program loops
A loop is a program statement that causes one or more statements (the body of the loop)
to execute repeatedly until a particular condition occurs. There are two kinds of loops:
"For" loops are useful when you know exactly how many times the body of the loop
should execute.
"While" loops are useful when you want to stop execution upon the occurrence of a
condition but you don't know
exactly when that condition will occur.
When using loops, you may need to break out of them or control particular iterations.

8.1 "FOR" LOOPS


Use a "for" loop when you know exactly how many times you want the body of the loop
to execute.

To insert a "for" loop


Click in the placeholder into which you want to place the "for" loop.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.

33

Click on the "for" button or press Ctrl+". Do not just type the word "for".
In the placeholder to the left of the "e", enter the iteration variable.
In the placeholder to the right of the "e", enter the range of values to be taken by the
iteration variable (although you will most often use a range variable here, you can also
use a vector, a list of scalars, and vectors separated by commas).
Click the "Add Line" button to insert placeholders for additional statements if
necessary. If you want the body of the loop to execute until the occurrence of a condition
but you don't know exactly how many times this will take, use a "while" loop instead.

8.2 "WHILE" LOOPS


Use a "while" loop whenever you want a set of statements to keep executing until a
condition is met. Make sure you have a statement somewhere that makes the condition
false. Otherwise the loop will execute indefinitely and you will need to stop it by pressing
Esc.

To insert a "while" loop:


Click in the placeholder into which you want to place the "while" loop.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.
Click on the "while" button or press Ctrl+]. Do not just type the word "while".
In the placeholder to the right of the "while", type a boolean expression. Click the "Add
Line" button on the Programming toolbar to insert placeholders for additional statements
if necessary.

33

In the placeholder below the "while", enter the statement you want to execute
repeatedly. Use the "Add Line" button to insert placeholders for additional statements if
necessary.
"While" loops are useful when you want to stop execution upon occurrence of a condition
and you don't know exactly when that condition will occur. If you know exactly how
many iterations you want, use a "for" loop instead.

8.3 "BREAK" STATEMENT


Use a "break" statement in a loop whenever you want to halt execution in a loop.

To insert a "break" statement:


Click in the placeholder in which you want to put the "break" statement.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.
Click on the "break" button or press Ctrl+{. Do not just type the word "break".
When Mathcad encounters a "break" statement in the body of a for or while loop:
1. The loop ceases execution and return the most recent value computed.
2. The program execution then continues with the next line of the program after the loop.
Controlling iterations in a loop

8.4 Controlling iterations in a loop


Program loops are designed to continue until a certain condition is met or after a certain
number of iterations. However, you may want to halt a loop during a certain iteration and
continue with the next iteration. To do so, use a continue statement.
To insert a "continue" statement:

33

Click on a placeholder into which you want to place the "continue" statement.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.
Click on the "continue" button or press Ctrl+[. Do not just type the word "continue".
When the program encounters a continue, it halts the iteration, goes to the nearest
outer loop, and continues with the next iteration.

8.5 Returning a value from a program


By default, a program returns whatever is on the last line. However, you can return a
value located elsewhere in the program by using a return statement.

To insert a "return" statement:


Click on the placeholder into which you want to place the "return" statement.
Click on the Math Toolbar to open the Programming Toolbar containing the
Programming Operator.
Click on the "return" button or press Ctrl+|. Do not just type the word "return".
In the placeholder to the right of the "return", type whatever you would like to return.

33

"Return" statements are useful when you want to return a value from a particular loop.
Trapping errors

8.6 Trapping errors in a program


To return an alternative value when an error is encountered in an expression, use the on
error programming operator:

Click on the placeholder into which you want to place the "on error" statement.
Click on the Math toolbar to open the Programming toolbar containing the
programming operators.
Click on the "on error" button or press Ctrl+'. Do not just type the words "on error".
In the placeholder to the right of the "on error", type whatever you would like to return,
assuming it can be evaluated successfully.
In the placeholder to the left of the "on error", type whatever you would like to return if
the default return expression cannot be evaluated. Use the "Add Line" button to insert
placeholders for additional statements if necessary.
The right-hand expression is evaluated and returned if no errors occur. If an error occurs,
the left-hand argument is returned.

8.7 Recursion
Recursion is a powerful programming language that involves defining a variable in terms
of itself as shown in this example: Recursive function definitions should always have at
least two parts:

33

1. An initial condition to prevent the recursion from going forever, and


2. A definition of the function in terms of a previous value of the function.
The idea is similar to that underlying mathematical induction: if you can get f(n+1) from
f(n), and you know f(0), then you know all there is to know about f. Keep in mind
however, that although recursive function definitions, despite their elegance and
conciseness, are not always the most computationally efficient definitions. You may find
that an equivalent definition using one o f the iterative loops will evaluate more quickly.
Evaluating a program symbolically
Once youve defined a program that you want to evaluate symbolically:
(1) Type the name of the function or variable name which is defined in terms of a
program.
(2) Press Ctrl +Period to insert the right arrow representing the symbolic equal sign.

9. FOURIER SERIES
In physical sciences we often express functions as series. Power series are
very common, for example the Taylor series. Another important series is the Fourier
series. The Fourier series is a trigonometric series, a sum of sine and cosine terms. The
Fourier series is important because certain functions that cannot be expanded as a Taylor
series can be expanded instead using a Fourier series. The Fourier series is also the
prefered series for representing periodic functions. Examples of periodic functions
include harmonic oscillators, rotors of various kinds, pendulums, etc. Since the Fourier

33

series is a sum of sine and cosine terms it is essentially a periodic series. More generally
we can say that the Fourier series is an expansion of a periodic function, f(x), with a
uniformly convergent series, i.e. a sum of sine and cosine terms, in a range from 'a' to 'b'
where x is greater than or equal to 'a' and less than or equal to 'b'. For a range [a,b] that is
symmetric about zero, if f(x) is an even function, f(-x) = f(x), then only cosine terms
contribute to the sum and if f(x) is an odd function, f(-x) = -f(x), then only sine terms
contribute to the sum. A series is uniformly convergent for a function f(x) if, in a given
interval, the series equals f(x) for every value of x in the interval.
Expansions of a function as an infinite series like this are only possible because the sine
and cosine functions form a complete orthonormal set of functions that fully span the
space of the periodic function that they are being used to approximate.
Mathematically the orthonormal property is expressed as:
b

sc i ( x ) sc j ( x ) dx ij

(note: this equation is toggled off)

where sci is either the sine(ix) or cosine(ix) and scj is either sine(jx) or cosine(jx)
and i,j is the Kronecker delta.
i,j = 1 when i is equal to = j
= 0 when i is not equal to j
The following expressions are useful in derivations of the coefficients of the terms in a Fourier
series. These expressions are toggled off in this part of the document.

sin ( n x ) dx

=0

n = 0, 1, 2, 3,....

=0

n = 1, 2, 3, .....

cos ( n x ) dx

= 2

n=0

33

cos ( m x ) sin ( n x ) d x

cos ( m x ) cos ( n x ) dx

= 0 m not equal to n
= m = n not equal to 0

= 0 m = 0, 1, 2, 3,.... and n = 0, 1, 2, 3,.......

sin ( m x ) sin ( n x ) d x

=0
=

m not equal to n
m = n not equal to 0

The general equations for a fourier series are shown here. Notice the use of a and b for
the coefficients for the cos and sin terms respectively. Here F(x) is the function that is to
be fit by the Fourier series. In the sections that follow you will be lead through a series of
exercises that will put into practice the Fourier series method for both odd and even
functions.

F(x) some function of x

1
a 0 a n cos n x b n sin n x
2
n1
n1

f (x)
an

bn

2
L

F(x) cos n x dx

F(x) sin n x dx

33

Let us start with a simple Fourier expansion for a periodic function, a simple step function.

2
an F (x)cos(n x)dx
0
bn 0

2
bn F (x)sin(n x)dx
0
an 0

When you work with this document do not repeat the exercises using the same
variable names. This will confuse Mathcad and give you a headache trying to debug
your Mathcad code.
Let us start with a simple Fourier expansion for a periodic function, a simple step
function. When you work with this document do not repeat the exercises using the
same variable names. This will confuse Mathcad and give you a headache trying to
debug your Mathcad code.

33

N can equal 0 up to any large integer.

x 3.1

Notice the relationship between N and i


j 0 N

f ( x )

Notice the way the range of x is defined.

1
2 j 1

sin [ ( 2 j 1 ) x ]

Values of N are entered below just above the graph. The


entry point for this integer was placed there so as to
make exploration and graphical insights possible
without excessive scrolling of the screen view. N is a
Mathcad Global variable in this document. Depending
on how you have your worksheet options set a change
in N will immediately result in a new figure or you may
need to press F9 to do do the calculations that will
show a new figure. This can also be accomplished by
pressing the = sign in the first tool bar of the window.

33

9.1 Sample Problem:


Expand the function F(x)=x in the interval - to by a Fourier series.
1. First we write the function and set the interval for the expansion.
F ( x ) x

x 3.0

2. Then we choose an upper limit for the number of terms in the expansion (the value for
M). Explorations on the effect of changing the upper limit are easily implemented by just
changing the value for M. M is a global variable and is placed below just above the
graph.

n 0 M

M 5

3. Next we have the integral for Bn. In this integral note the presence of the function F(x).
Any odd function can be used here. n is the index used to identify the integrals in the
expansion for the fitting process. Using M and n makes possible a more general
exploration of the series in the area below.
1
B n

F ( x ) sin ( n x ) dx

Ask Mathcad to show several of the Bn coefficients in the Fourier expansion for the
function given here. Comment on their magnitude and the significance of the magnitude
as n increases.

33

Write out the expression that would correspond to the coeficients for the cosine terms in a
Fourier series expansion of this function. Show that several of these An coefficient
values are in fact zero.
4. We wrote f(x) here instead of F(x) so as to prevent Mathcad from overwriting our
original function. We will compare the fourier series fit, f(x), of the function to the
function, F(x), itself as an exercise. Now write out by hand f(x) as the sum of several
terms.

f ( x )

B n sin ( n x )

n 1

Notice M is an upper limit in the sum. Varying M allows rapid and efficient exploration
of the variation of the number of terms in a Fourier expansion. Graphical presentation is a
real time saver in understanding the consequences of changing the number of terms in the
series.

33

10 .BOHRS THEORY OF ATOMIC


STRUCTURE
Postulates of Bohr:
1. An electron in atom can revolve in certain stable orbits without the emission of
radiant energy.The angular momentum of the electron should in the integral multiples of
(nh/2)
2. An electron may make a transition from one of its specified non-radiating orbits
to another of lower energy equal to the energy difference between initial and final states.
In stationary states the energy of the atom is assumed to be constant. Thus the atom does
not radiate em waves while in any one of these stationary states.
By the first postulate the angular momentum of the electron is

me v n rn

n h

---------(1)

By the second postulate the emission of energy is:

---------(2)

Ei Ef

where is the frequency of the energy emitted : Ei and Ef are the energies of initial and
final states. Applying the Coulomb's law of force between the electron and proton:

where is the frequency of the energy emitted : Ei a


states. Applying the Coulomb's law of force between
F
Equating the RHS of the equation (3) to the cetripetal force

1
4 0

2
2

me v n .rn

rn

Solving (1) and (4) for rn and vn we get,

33

rn

----------(4)

1
4 0

2
2

rn

-------

Solving (1) and (4) for r n and vn we get,


12 farad

31

me 9.1093897 10

kg

0 8.854187817 10

19

e 1.60217733 10

coul

n h

v ( n )
Kinetic energy of the electron is

sec

joule sec

1
4 0
2

me e
e

34

h 6.6260755 10

4 0

r( n ) 0

c 299792458

k
k

-------------(5)

------------(6)

0 2 n h

1 k e 1
KE( n )

2 r( n ) e

---------------(7)

Potential Energy of the electron is:

Potential Energy of the electron is:


PE( n )
Total Energy of the electron is
E( n ) KE( n ) PE( n )

k e

r( n )

1
e

----------------(8)

---------------------(9)

According to Bohr's second postulate, a hydrogen atom radiates energy when the
electron jumps from one orbit to another of lower energy. The energy radiated is given
by the condition:

Ei Ef
h

Substituting the values


of Ei and Ef using equation(9)
2
2

KE( n )

1 k e

2 r( n )

PE( n )

k e

r( n )

33

E( n ) KE( n ) PE( n )

E( 1)
2
ni h

E( 1)
2

E( 1)

nf h

ni

nf

10.1. LYMAN SERIES


E( 1)

( n )

( n )

( n)

10

n 2 3 20

10.2. BALMER SERIES


( n )

( n )

E( 1)
h
c

( n)

n 3 4 20

33

n
7

10

10.3. PASCHEN SERIES


( n )

( n )

E( 1)
h
c

(n)

10

n 4 5 20

10.4. BRACKET SERIES


( n )

( n )

E( 1)
h
c

( n)

n 5 6 20

33

2
n
7

10

10.5. FUND SERIES


( n )

( n )

E( 1)
h
c

( n)

10

n 6 7 20

33

11. NUMERICAL SOLUTION OF


SCHRODINGER WAVE EQUATION
11.1 HYDROGEN ATOM
The hydrogenic atom wavefunctions will also be used as the basis functions in the Linear
Combination of Atomic Orbitals (LCAO) method. The Schrodinger equation for the
hydrogenic atom used in the LCAO method is
2

2m
Zq 2

0
E

2
4 0 r

where m is the mass of the electron, h is Planck's constant divided by 2, Z is the atomic
number, q is the electronic charge, 0 is the permittivity of free space, and
2

1 2
1


1
2
r

sin

r 2 r
r
r 2 sin

r 2 sin 2 2

in spherical coordinates.
As shown in numerous textbooks, this equation can be separated by the trial solution
( r , , ) R ( r )( ) ( )

The functions () and () are solutions to the separated angular equations and their
products are the spherical harmonics. Solution of the equation gives rise to the
quantum number ml and solution of the equation involves the associated Legendre
equation, which gives rise to a second quantum number l. The integer l corresponds to the
degree of the associated Legendre function while the integer ml corresponds to its order.
A third quantum number n arises from the solution of the separated radial equation R,
which involves the associated Laguerre equation. Its solutions are the associated Laguerre
functions, and their properties require that

l n 1

orbitals in their characteristic shapes.

33

. The spherical harmonics give atomic

11.2 Spherical Harmonics


Select values for the quantum numbers l and |m|. Note that |m| must be less than or equal to
l.
Angular momentum quantum number
l 1
m 1

Magentic quantum number


The solution to the equation is given by

The normalization factor for this function is


1
A
2
Letting x = cos , the solution to the equation (associated Legendre polynomial of the first
kind) is given by

Note for the case in which l = 0, m = 0, MathCad cannot symbolically solve the above
expression for the associated Legendre polynomial. The solution can be shown to be equal to 1.
To plot the resulting spherical harmonic simply type (x): = 1 below.
Substituting cos for x gives as a function of

The normalization factor for the function is


2l 1 ( l m)

2
( l m)
The spherical harmonic is given by the product of the and functions.
B

The indices and equations needed to transform the spherical harmonics into Cartesian coodinates
for plotting in Mathcad are contained in the hidden section below.

33

11.3 Radial Wavefunctions


Select values for the quantum numbers n and l. Note that l must be less than or equal to n 1. The atomic number Z can also be varied, but the solutions are only valid for one-electron
atoms.
Principal quantum number

n 3

Angular momentum quantum number

l 2

Atomic number

Z 1

The solution to the R equation (Laguerre polynomial of the first kind) is given by

where is given by
2 Z r
n
We'll express r in Bohr units (1 Bohr = 0.0529 nm) in this workbook.
( r)

The normalization factor for the R function is

33

The radial wavefunction is

The radial wavefunction Rln(r), radial density function Rln2(r), and radial distribution function
4r2Rnl2(r) are plotted below. Note that the scale may need to be modified depending on the
selection of the quantum numbers.

The normalized hydrogenic wavefunctions are the products of the normalized real spherical
harmonics and the normalized wavefunctions. These functions are summarized for the 1s, 2p,
and 3d orbitals.

33

Numerical Solutions for Schrodinger's Equation


Integration limit:
Potential energy:

xmax 1

Effective mass:

V( x) 1

Numerical integration of Schrodinger's equation:

Given

1 d 2

( x) V( x) ( x)
2 d x2

Odesolve x xmax

E ( x)

( 0)

Normalize wave function:

' ( 0)

0.1
( x)

( x)

x
max

Enter energy guess:

E 4

33

( x) d x

Fourier transform coordinate wave function into momentum space.


p 20 19.5 20

( p )

x
max

2 0

exp ( i p x) ( x) d x

33

12. LORENTZ FORCE


We study the motion of a particle of charge q and mass m in a magnetic field B
and in an electric field E. The force acting on the particle is given by the Lorentz
formula: F = qE + qvxB where v is the velocity vector. For small enough velocities, v <<
c, we can use Newtonian mechanics to describe the motion of the charged particle: ma =
F . Lorentz formula and Newton's second law give: dv/dt = (q/m)E + (q/m)vxB. First we
input the mass and charge of the particle, proton for example.
19

27

q 1.6 10

m 1.67 10

Next we input the magnetic field B and the electric field E.


In this computation we will study the case of no electric field E = 0.

E 0

0.0001

q B

We will compute the position and velocity


of the particle 1000 times during a period.
T
t

n 0 5000

1000

t n t
n

The initial velocity is v0 and


the initial position is r0.
6
10

v
0

10

r 0
0

We integrate numerically the equation of motion a = F/m by using a = dv/dt = (vn+1 vn)/t and v = (rn+1 - rn)/t. This implementation is called the Euler method and its
accuracy depends on the smallness of the time interval: t << T.

33

n 1

n 1

v t
n

q v B q E

m
m n

r t v
n

To graph the trajectory, use


vxthe
3d scatter plot .
n

vy v
n
n

vz
n

y r
n
n
zn

So when E = 0 the trajectory is a helix.

13. Van der Waals Equation


For an industrial process, it is necessary to introduce 1400 mols of mesytylene (1,3,5trihydroxybenzene) at a temperature of 560 K and pressure of 150 kPa in a steel cylinder.
Calculate the volume of the cylinder using the van der Waals equation, if the a and b
constants are known.
The van der Waals formula is a third degree equation for the volume:

33

or in an expanded form:

Higher degree equations are handled by Mathcad with the root function. The syntax is:
root(f(x),x).
It returns the value of x that makes the function f equal to zero.
defining the constants and parameters:

R 8.3136

a 3.56

b 1.979 10

p 150000

n 1400

T 560

Since an iterative algorithm is used for the calculation, an initial


guess value is necessary.

It must be borne in mind that for a third

degree equation there are three solutions and which root is found
depends on the initialization value. Of the three roots, only one will
have physical meaning. In other words a negative or a complex value
for the volume, although mathematically correct, has no physical
meaning.

guess value

V 10000

a good guess value always speeds the calculation,


although in this case, even a bad estimate converges
fast.

or the equation can


2 in the recognizable form:
be written

a n
V root p
( V nb) nRT V
2

the answer is the same:


However, a guess value in the "wrong direction" gets the not converging message:
guess value

V .1

33

Instead of making wild guesses, the function can be graphed, and the intercepts with
the apscissa easily recognized:
V 0 100

QUESTIONS
1. Explain the method of creating two and three dimensional graphs.
2. Discuss the following (a) Formatting math and text (b) formatting results.
3. Explain the following (a) using units (b) creating the programs.
4. Explain the theory of Fourier series and write a mathCAD program to find a Fourier Series for an
odd function.
5. Explain the Bohrs theory of atomic structure and write a mathCAD program for studying the
various Series of Hydrogen Spectrum.
6. Explain the MathCAD procedure to find the numerical solution of Schrdinger wave equation.
7. Discuss the MathCAD procedure to study the Lorentz force.
8. Discuss the MathCAD procedure to study the Van-der-Waals equation.

33

CHAPTER-4
COMPUTER ORIENTED NUMERICAL METHODS
1. Euler's method of solving ode
2. False-position method
3. Fixed point iteration procedure

4. Modified Euler predictor corrector method


5. Newton-Raphson method
6. Numerical Integration-3/8 Simpson Rule
7. Predictor - Corrector method

8.

Range-Kutta method

33

1. EULERS METHOD OF SOLVING


ODE
It is often impossible to find elementary solutions to differential equations of the form y'
= f(x,y). In applications, though, it is usually sufficient to find a numerical approximation
to the function satisfying the governing differential equation. We will develop a simple
numerical technique for the estimation of such solutions.
Remember: The solution to a differential equation is an equation relating the variables in
the derivative. Thus, a numerical approximation would result in a plot of the relationship
between the variables in the derivative but would not provide the functional relationship.
Let:

y'

dx

( x y)

f ( x y)

x 1

Note that a derivative "function" can be denoted in the same way as the original function
from which it came.
f' ( x y)

( x y)
2

x 1

In order to obtain the required relationship between variables we need a starting point,
commonly called an initial condition: y ( 0)

1,

c 1

. This is the initial condition for the

desired relationship between x and y.


For purposes of illustration, let the solution function be denoted by: y = g(x), g(0) = c
The initial-value problem y' = f(x,y) has solution:

.5 .

g ( x ) c x 1

A very practical

way of proving this is the case is by simply substituting y' and y into the original ODE to
generate an identity
taking the derivative of g(x) we get:

y'

1.0 x

33

x2 1 1.5

Substitute y' and y into the original expression. If y is a root we will get an identity

1.0 x

x2 1 1.5

simplify :

.5

x c x 1

x 1
c

x2 1 1.5

x 2 1 1.5

We get an identity, thus proving g(x) is a solution of the original equation. Now we have
an analytical solution with which we can compare our numerical solution.
In calculus you learned that if you had a function you could differentiate it to get the
"derivative function". If you had the derivative function you could integrate it to get the
original function back again. Thus, one of the first ways you learn for solving simple
differential equations is to simply integrate the derivative function analytically. However,
this is not always easy, or even possible. In such cases we resort to "numerical methods".
One of the first numerical methods usually learned is Euler's explicit method. Euler's
method depends on writing the differential equation to be solved as a "finite difference
approximation".
y'

d
dx

f ( x y)

( x y)
2

here is the original differential equation.

x 1

We will rewrite it in finite difference form as:


y
x

( x y)
2

x 1

or y

( x y)
2

x 1

yi yi 1 and x xi x i 1 we can write :


x i 1 yi 1
x i x i 1 or:
x i 1 2 1

Now, if we let y
yi yi 1

yi

yi 1

x i 1 yi 1
x i x i 1
x i 1 2 1

a recursive relationship. If

we have an initial condition we can use this equation to compute a sequence of y values.

33

The values of y are values of the solution function you are trying to get. The derivative
function (which you have) allows you to compute the slope between the points. The
approximation in Euler's procedure arises as a result of our estimate of the slope. We have
evaluated the slope between

x i yi

and

x i 1 yi 1

as the value obtained at point i-1. The

process is described graphically below.


COMPUTATION PROCEDURE
Euler's Method for solving Ordinary
Differential Equations of the form y' = f(x,y)
y

yi+1 = yi + f`(x,y)*h
f'(x,y)

k1

in words: "new y value = old y value


*slope*h"

h
xi

x
xi+1

These are the estimates of points on the solution of the differential equation

f'(x,y) is the slope of the tangent line to the solution function at x,y

We will use this function to rate the accuracy of our estimates. Each method will rely on
iteratively estimating values at N+1 evenly spaced points on [0,L]. Here, we take

33

L 10 domain over which the solution function is to be approximated

N 250 number of intervals into which the domain is to divided, the dependent variabl
is then approximated at each point
1

h L N

size of each interval

i 0 N counter to keep track of interval values approximated

1.1 LINEAR APPROXIMATION (EULER'S METHOD)

Define

sequences recursively by

y0 1

initial value for y when x = 0

x i i h

= (counter)(interval size) = value of independent variable

yi 1 yi h f' x i yi

in words new value = (old value)*(slope)*x

Effectively, we are progressing along the tangent-line to each y value to estimate y at the
next point on the curve.

2. FALSE POSITION METHOD


33

Introduction: The false position procedure is a method for locating the roots of equations
based on the fact that the equation changes sign as it crosses the x axis. The method
requires 2 initial guesses which result in functional values with different signs. The false
position procedure is generally considered an improvment over the bisection method in
that it takes into account the fact that one of the initial guesses may be located quite close
to the root. An estimate of the root is made using the equation below. This estimate then
replaces one of the original endpoints and the procedure is repeated.
xr

xu

f x l f x u

f xu x l x u

Use the false position method to solve the following family of equations

f ( x n)

x 1.

We will see that the number of iterations required to get an acceptable root is heavily
dependent on the value of n.
x .01 .015 1.5 plot the function for a range of values, hopefully bracketing a root
n

equation to be solved

f ( x n) x 1
x l .01

x u 2.5

initial guesses for upper and lower values

when possible, plot equation(s) to locate roots check to see if xu and xl bracket a root. Guess
again if the product below is > 0

33

Observation : Note that the higher the values of n the sharper the degree of curvature of
the function and the flatter the curve is on either side of the turn. It is this degree of
curvature which makes the root of the equation difficult to locate.We now create an
algorithm for false position procedure which stores sequences of root estimates as well as
sequences of end points.
Mathcad programs are in the form of functions

false_position_root x u x l n

. The items in

the parentheses are the inputs to the function, in this case the upper and lower guesses
and the value of the exponent in the equation being solved.

33

false_position_root x u x l n

i0
store initial
guesses
in a vector

upi x u
downi x l

if f x u n f x l n
f x l n f x u n
break if f x u n f x l n 0
f x u n x l x u
xr xu
f x l n f x u n
xu

f xu n xl xu

if x u and x l don't
bracket a
root, stop
store initial and
subsequent root
estimates, x r , in

si x r

vector

x rr x l
while

x r x rr

.000005

x rr

x rr x r

x u x r if f x r n f x l n 0
upi 1 x u

x l x r if f x r n f x l n 0
downi 1 x l
xr xu

establish stopping
criteria based on
approximate relative
error. While loop is
executed as long
as condition is true
set current value
of guess to
old value, x rr
determine which
endpoint
current x rreplaces

f x l n f x u n
f xu n xl xu

compute next x r
and store it in s
vector

si 1 x r
ii1

increment counter

( s up down i )

create output vector


where s, up,
and down are
vectors. i is the last
value of the counter

create a matrix containing the estimates of the root together with the upper end points for
each iteration, lower end points for each iteration and the number of iterations completed
The outputs of the function are the values on the last line of the program:
n 0 10

soln0 n false_position_root x u x l n

run the program for each value of n, store the results in a vector called [soln]
each element in [soln] is itself a 1 row 4 column vector

33

each element within each value of [soln] (for instance

soln0 4

) contains, in turn, three 70

row, 1 column vectors and a number. The number is the number of iterations it took to get
the solution for that value of n.
range of the value of the exponent :

n 0 10

The number of iterations to get to the root rises exponentially as the value of n.
Lets examine just how the algorithm approaches the root for a specific value of n. Plot
3

sequence of root estimates for

x r soln0 3
0 0

x 1

.....

i 0 soln0 3
03

x u soln0 3
0 1

x l soln0 3
0 2

rename each column of solution vector and plot them.

33

Now do the same for n = 9. Note the increase in the number of iterations required.

i 0 soln0 9
03

x r soln0 9
0 0

x u soln0 9
0 1

x l soln0 9
0 2

rename each column of solution vector and plot them.

33

Note that in this case each sequential root estimate is always extremely close to the last
lower limit used but it takes a very large number of iterations for the root estimate to
converge acceptably.

3. THE FIXED POINT ITERATION


PROCEDURE
An object falling vertically through the air is subjected to viscous air resistance as well as to the
force of gravity. Assume that an object with mass "m" is dropped from a height, So and that the
height of the object after t seconds is given by:
S ( t)
where:

So

m g
k

m g
2

k
ft

g 32.17

k t

m

1 exp

acceleration of gravity

sec
k 0.1

lb
sec

coefficient of resistance, a.k.a drag

coefficient
Suppose So = (see below) ft., m = 0.25 lb and k = 0.1 lb-sec/ft. Use the fixed point
iteration method to find, within 0.01 sec., the time it takes for this object to hit the
ground.

mass .25lb

S o 300 ft

Solution: First lets plot the function as given:

t 0 sec .1 sec 10 sec

S ( t) So

mass g
k

33

mass g
2

k t

mass

1 exp

S ( t ) So
f (t)

mass g
k

mass g
2

k t

mass

1 exp

This equation is of the form

According to plot below the mass strikes the ground after about 6 seconds

The fixed point procedure involves taking a function in the form


it to the form x

g (x) .

f (x)

and converting

For this problem we take the function above, in the form

and convert it to the form: t

g ( t ) . This
g (t)

is on the left side and a function

is done by rearranging f ( t )

f (t)

into a form where t

remains on the right. A graphical representation is

shown below:

33

Graphical Interpretation of the Fixed Point Iteration Procedure

y
x = f(x) denoted by

g(x) = 0
y = x

y = f(x)

xi+1

root of g(x) = 0
x
xi

The fixed point iteration procedure converts g(x) = 0 to the form x = f(x)
The recursive version of the fixed point procedure is : x i+1 = g(xi)

mass g

S So

mass g

k t

mass

1 exp

Here we isolate the t in the second term of the equation,

mass g
k

, on the LHS of the

equation, everything else on the right.


2

mass g
t

k t S

o
mass

1 exp

mass g
k

g (t)

The recursive form of the equation is then:


2

mass g
2

ti 1

k ti
So
mass

1 exp

mass g
k

N 15

total number of iterations

i 1 N

iteration number

33

This equation is of the form

mass g
2

ti

k ti1
So
mass

1 exp

mass g
k

Discussion : The fixed point procedure is an "open method" meaning that initial guesses
bracketing the root are not required. The price to be paid for this is that the solution
sequence may diverge, or not converge to a solution. In addition, a number of equations
of the form f(t) = 0 can be put into the form t = g(t) in more than one way and the
behavior of the these variations may be different, that is they may not all converge or
converge to the same solution.

4. Modified Euler Predictor Corrector


Method
Introduction: There are a number of Euler type solute on techniques for first order
differential equations. The explicit Euler procedure is simple but only conditionally
stable. The implicit procedure can result in the need to solve nonlinear equations but it is
unconditionally stable. Pedictor corrector methods offer a compromise. An explicit
method is used to predict the solution and an implicit method is used to correct the

33

prediction. The procedures are numerically explicit and they generally have the accuracy
of the corrector (implicit method). They are only conditionally stable however and the
minimum necessary step size may not be much larger than that of the explicit predictor
method. However, they avoid the problem of repeated solution of nonlinear equations.
Solution of the equation governing the radiation of heat from a lumped mass (sphere) at
an initial temperature To to the environment temperature at Ta.
The governing differential equation is:
where:
radius of sphere

d
dt

T4 Ta4

f ( t T)

r 1.0 cm

= Stephan Boltzman constant,


material density

8000

5.67 10

sec m K

kg
m

= emissivity of the body, dimensionless .5

C = specific heat of the material, joule/kg - K

time step :

t .5 sec

initial temperature

T0 2500 K

ambient temperature
initial time

Ta 100 K

t0 0 sec

33

C 500

J
kg K

NOTE: By "playing around" with lumped mass properties students will (hopefully)
eventually realize there is a tradeoff between the value of and the required
computational step size. As gets larger the required t gets smaller. Also, the
computational interval affects how well the predicted and corrected temperatures agree.
d
dt

T4 Ta4

f ( t T)

equation to be solved

The mass temperature at any time is equal to the temperature at the end of the previous time
step plus the incremental change during the current interval.
Tn = Tn-1 + (dT/dt) (t)

Modified Euler Predictor - Corrector solution algorithm:


In the modified procedure the slope, dT/dt, is computed as an average using the
previous value of T a new T value computed using the standard Euler procedure.
Tn Ta
4

fp

yp

yp t fp
n

fp

f tp yp

n 1

n 1

yC

n 1

n 1

yn

1
2

counter for time steps

dt

T
explicit prediction

t fp fp
n
n 1

maximum number of time steps

f ( t T)

implicit correction

N 10000

n 1 N

tn tn1 t

( T t) T Ta
4

Tp

keep in mind that ( T t)

Tn1 Tn1 tn 1 t

d
dt

Note that we insert the RHS rather than the variable T p in the

expression below. If we had inserted Tp the loop would have broken, as there is no way
to redefine Tp as Tn in the next time step.

33

Note that in order to implement the procedure using subscripts instead of actual
programming we write each expression such that the same variable name is used on each
side of the expression differing only in the time subscript. If we change the variable name
there is no way redefine the current value as the previous value in the next step. The
expression below is the entire predictor-corrector method written in terms of T n and Tn-1
where n and n-1 are real subscripts referring to the time step.
Since :
( T t)

d
dt

( T t) t

Tnew

We can write the entire predictor-corrector method as :


Tn Tn 1

1
2

Told ( T t) t

Tn 1 tn1 Tn 1 Tn1 tn 1 t tn t

Conclusion : It takes a while (> 81 minutes) for even a small sphere (r = 1 cm) at an
initial temperature of 2500 K to cool to an ambient temperature of 100 K via radiation
alone.

33

5. NEWTON RAPHSON METHOD


When a fluid flows in a steady fashion through a round pipe, the pressure drop due to
wall friction is given by the empirical formula:
P

2 L

0.5 f V

where:
P= pressure drop

D = pipe diameter

= fluid density

f = Darcy friction factor

V = fluid velocity
L = pipe length

Several empirical formulas exist for the friction coefficient as a function of the Reynolds
DV

number, Re, which is given by

where is the fluid viscosity. For flow in the

turbulent regime between completely smooth pipe and wholly rough pipe surfaces
Colebrook developed an empirical equation for the friction factor
1
1

_D_ratio 2.51

2 log

3.7

Re f

Develop a procedure to determine f for specified values of /D and Re. Use the
approximation proposed by Genereaux (1939) ,

0.16 Re

.16

, to determine an initial

approximation for f. The equation is transcendental in anture therefore an analytical


solution is not possible. Here we will use the Newton Raphson procedure. A graphical
description of the procedure is given below.

33

Geometric Interpretation of the Newton-Raphson


Procedure
function for which root is
desired

f(x)

xi+1 = xi -

f(xi)
f '(xi)

f '(x1)

recursive equation

If initial guess is not too far


off sequence of iterates
converges to root

f ' (x2)

1. May not converge, root not


bracketed
2. Quadratically convergent when
it does converge
3. Requires evaluation of
analytical derivative which may
not exist

f(x1)

f(x2)

root
x2

x1

NOTE: Equation to be solved must be recast in the form f(x)=0

SOLUTION - find the friction factor using the Newton Raphson procedure. Define
values for /D and the Reynolds Number
_D_ratio

_D_ratio .001

n 6

Re ( n) 10
_D_ratio

F ( f ) 2 log

3.7

2.51
Re ( n) f

This is the Colebrook White equation


2.51

F' ( f )

Re ( n) f

3
2

2.51
ln ( 10)
.270 _D_ratio

Re (n) f

The derivative w.r.t. f of the Colebrook White equation

33

2f

33

6. NUMERICAL INTEGRATION-3/8
SIMPSON RULE
Stream cross sectional areas (A) are required for a number of tasks in water resource
engineering, including flood forecasting and reservoir design. Unless electronic sounding
devices are available to obtain continuous profiles of the channel bottom, the engineer
must rely discrete depth measurements to compute A. An example of a typical stream
cross section is shown below. The data represents places where a boat was anchored and
depth measurements taken. Estimate the cross sectional area of the channel.

Data below scaled from drawing


In Mathcad origin default is 0, reset to 1 in the Math / built-in variables submenu
i 1 12

33

distance

depth

6.5

13.00
19.5

26

32.5

39

Data

46.5

5.5

52.5

59

65.5

72

ft

3.5

2.8

1.4

78.5

n 12

number of points

h 6.5 ft

distance between sequential data


points

disti Data i 1
depthi Data i 2

label each column separately

compute the flow area using Simpson's rule

i 1 2 11
Area

Area ( width) ( ave_height)


depthi depthi 1
( h)
2

or

i 1 2 n 1

j 2 3 12

depthi depth j
i

h ft

Simpson's rule with summations multiplied


through

Simpson's 1/3 rule - each segment requires 3 points

33

i 1 3 n 1

j 2 4 n

Area 2

k 3 5 n 1

( width) ( average_height)

2h

segments

Area 2

f ( 1) 4 f ( 2) f ( 3)
6

segments

depthi 4 depth j

Area 2 2 h

depthk

Simpson's 3/8 rule - each segment requires 4 points

Area 3

( width) ( average_height)

segments

Area 3

segments

i 1 4 n 2

Area 3 ( 3 h)

3h
8

( f ( 1) 3 f ( 2) 3 f ( 3) f ( 4) )

j 2 5 n 1
depthi 3

k 3 6 n

depth j

l 4 7 n 2

depthk 3

depthl

If the average flow velocity in the stream is 6 fps what is the flow rate?

33

7. PREDICTOR - CORRECTOR
METHOD
Introduction: There are a number of Euler type solution techniques for first order
differential equations. The explicit Euler procedure is simple but only conditionally
stable. The implicit procedure can result in the need to solve nonlinear equations but it is
unconditionally stable. Pedictor corrector methods offer a compromise. An explicit
method is used to predict the solution and an implicit method is used to correct the
prediction. The procedures are numerically explicit and they generally have the accuracy
of the corrector (implicit method). They are only conditionally stable however and the
minimum necessary step size may not be much larger than that of the explicit predictor
method. However, they avoid the problem of repeated solution of nonlinear equations.
Solution of the equation governing the radiation of heat from a lumped mass at an initial
temperature Tinit to the environment temperature at Ta.

A
mass C

where:
A = surface area of mass

A
mass C
A = surface area of mass
8

= Stephan Boltzman constant, 5.67 10


= emissivity of the body, dimensionless

.4

mA=mass
kg
100 of the body,
C 10

mass 4000

C = specific heat of the material, joule/kg - K


A
Tinit 2500
Ta 250

mass C

d
dt

T4 Ta4

33

f ( t T)

t .5

equation to be solved

The mass temperature at any time is equal to the temperature at the end of the previous
time step plus the incremental change during the current interval.
Tn = Tn-1 + (dT/dt) (t)
Modified Euler Predictor - Corrector solution algorithm:
Tn Ta
4

fn
yp

yn t fn

fp

f tp yp

n 1

n 1

n 1

yn

yC

n 1

1
2

f ( t T)

explicit prediction

t fn fp

n 1

implicit correction

Mathcad programs are in the form of functions. The items in the parentheses are the
inputs to the program.

fct Tinit Ta t

n0

initialize counter

T0 Tinit

initialize temperature

calculate until temperature drops


below 500 degrees. This value can
be changed as desired.

predictor corrector algorithm

while Tn 500

4 Ta4
Tp
Tn t f n
n 1

fp

f n Tn

n 1

Tn

Tn 1 TC
n 1

Tn Tn 1

nn1

n 1

Tp
n 1

TC

TC

n f fp Tp

1
2

4 Ta4

t f n fp
n 1

set TC = Tn

increment counter by 1 and return

output vector

33

soln fct Tinit Ta t


n soln0 1

define n based on solution, this way counter always set correctly

redefine solution vector elements with more recognizable names

TC soln0 0
i
i

Tp soln0 4
i
i

f ii soln0 2
ii

fp soln0 3
i
i

8.RUNGE-KUTTA METHOD TO SOLVE


ODE
This document deals with using Runge Kutta methods to solve differential equations of
the form

33

d
dx

f ( x y)

Here we are interested in finding a function, y = f(x,y), such that its derivative satisfies
the original differential equation. In general, a numerical procedure for solving such
equations involves rearrangement of the equation to a finite difference form:
y

f ( x y) x

yi f ( x y) x 2 x 1

yi 1

In words the above equation can be stated as: "new y value = old y value + (function
slope)(x)". The given equation therefore is the slope of the desired solution function at
any point.
Runge Kutta methods achieve the accuracy of a Taylor series approach without requiring
calculation of higher order derivatives. There are a variety of methods but all can be cast
in the generalized form:

x i yi h

yi x i yi h h

yi 1

is called an increment function. It is essentially a representative slope over the

interval, h
A Second Order Runge Kutta Method
The simplest method works for differential equations of the form y' = f(x,y):
Note: we are operating on a function which specifies the derivative of another function.
Our solution will be the functional relationship between x and y. We must also have an
intial condition, namely:

y' x 0

y0

Here's how it works. Let's try an example in which . . .y'


f' ( x y) y

f' ( x y)

initial condition x 0 0 and y0 1

O.K. we are looking for the numerical approximation of a function, f(x,y), whose
derivative at any point is equal to y
Select an increment h:

h .2

In the general Runge-Kutta method, you must define a function as follows:

33

( x y h) f' x

can be different in different variations on the method. Here we

h f' ( x y) evaluate the function at x+h/2 and y+(f'(x,y)*h/2). Since the


2
function is the derivative, the number returned each time is a
slope.
1

This represents the slope evaluated at x+h/2 and y + ((y/2)*h).


So we can find a set of points on the curve as follows:
1. Set a counter to determine the number of points to find
2. Define the x values as :

x i x 0 i h

N 500 i 0 N

. Note that xo and yo are already defined as 0

and 1.
3. Now use:

yi 1 yi h x i yi h

to define the y values. Note that the relationship is

recursive in that each new y value is then used in ( x y h)

f' x

h
2

f' ( x y)

to compute the next y value.


In words : yi+1 = yi + (x * (average between yi and yi+1))
d
dx

has an analytical solution:

Note that the derivative of

ydep x ind e

x ind

also written as x

ln ( y)

x ind 0 .2 100

x ind

returns

xind

demonstrating that it is in deed the

solution to the given ODE, y' = y If we plot the analytical solution we see that it exhibits
pronounced curvature once x approaches 9 to 10. This type of behavior is difficult to
reproduce with a numerical approximation algorithm. We will verify this fact by
evaluating and plotting both the analytical solution and the numerical solution on the
same set of axes.

33

Now let's compare the analytical and numerical solution techniques. We plot them on the
same set of axes below. We have used a log scale for the y axis to better see the solutions
over a wider range of x. At first glance the two techniques appear to give essentially the
same result. However this misleading and occurs because the solution to each gets very
large very fast, thus masking the difference.

QUESTIONS
1. Explain Eulers method of solving Ordinary differential equation.
2. Explain the False-position method of solving ODE.
3. Explain the Fixed point iteration procedure for solving ODE.
4. Explain Modified Euler predictor corrector method.
5. Explain the Newton-Raphson method.
6. Explain Numerical Integration-3/8 Simpson Rule for integrating a function with
given conditions.
7. Explain the Predictor - Corrector method.
8. Explain the Range-Kutta method.

33

CHAPTER-5
MATHCAD PROGRAMS TO PHYSICS PROBLEMS
1. Numerical solution of Schrdinger wave equation
2. Harmonic oscillator

3. Learning molecular symmetry-H2O,NH4


4. Numerical solution of second order differential equation

5. Study material of hydrogen atom and molecule


6. Ground state of helium atom byVariation method
7. Electron motion through rectangular potential barrier
8. XY3- planar

33

1. NUMERICAL SOLUTION OF
SCHRODINGER WAVE EQUATION
1.1 HYDROGEN ATOM
The hydrogenic atom wavefunctions will also be used as the basis functions in the Linear
Combination of Atomic Orbital (LCAO) method. The Schrodinger equation for the
hydrogenic atom used in the LCAO method is
2

2m
Zq 2

0
E

2
4 0 r

where m is the mass of the electron, h is Planck's constant divided by 2, Z is the atomic
number, q is the electronic charge, 0 is the permittivity of free space, and
2

1 2
1


1
2
r

sin

r 2 r
r
r 2 sin

r 2 sin 2 2

in spherical coordinates.
As shown in numerous textbooks, this equation can be separated by the trial solution
( r , , ) R ( r )( ) ( )

The functions () and () are solutions to the separated angular equations and their
products are the spherical harmonics. Solution of the equation gives rise to the
quantum number ml and solution of the equation involves the associated Legendre
equation, which gives rise to a second quantum number l. The integer l corresponds to the
33

degree of the associated Legendre function while the integer ml corresponds to its order.
A third quantum number n arises from the solution of the separated radial equation R,
which involves the associated Laguerre equation. Its solutions are the associated Laguerre
functions, and their properties require that

l n 1

The spherical harmonics give atomic orbitals their characteristic shapes. The effect of
changing the quantum numbers on the and equations can be explored below.

1.2 Spherical Harmonics


Select values for the quantum numbers l and |m|. Note that |m| must be less than or
equal to l.
Angular momentum quantum number

l 1

Magentic quantum number

m 1

The solution to the equation is given by


The normalization factor for this function is
A

1
2

Letting x = cos , the solution to the equation (associated Legendre polynomial of the
first kind) is given by

Note for the case in which l = 0, m = 0, MathCad cannot symbolically solve the above
expression for the associated Legendre polynomial. The solution can be shown to be
equal to 1. To plot the resulting spherical harmonic simply type (x): = 1 below.
Substituting cos for x gives as a function of

The normalization factor for the function is

33

2l 1 ( l m)

2
( l m)

The spherical harmonic is given by the product of the and functions.

The indices and equations needed to transform the spherical harmonics into Cartesian
coodinates for plotting in Mathcad are contained in the hidden section below.

1.3 Radial Wavefunctions


Select values for the quantum numbers n and l. Note that l must be less than or
equal to n - 1. The atomic number Z can also be varied, but the solutions are only valid
for one-electron atoms.

33

Principal quantum number

n 3

Angular momentum quantum number

l 2

Atomic number

Z 1

The solution to the R equation (Laguerre polynomial of the first kind) is given by

where is given by
( r)

2 Z r
n

We'll express r in Bohr units (1 Bohr = 0.0529 nm) in this workbook.


The normalization factor for the R function is

The radial wavefunction is

The radial wavefunction Rln(r), radial density function Rln2(r), and radial distribution
function 4r2Rnl2(r) are plotted below. Note that the scale may need to be modified
depending on the selection of the quantum numbers.

33

The normalized hydrogenic wavefunctions are the products of the normalized real
spherical harmonics and the normalized wavefunctions. These functions are summarized
for the 1s, 2p, and 3d orbitals here.

33

1.4 Numerical Solutions for Schrodinger's


Equation
Integration limit:

xmax 1

Effective mass:

V( x) 1

Potential energy:

Numerical integration of Schrodinger's equation:


Given

1 d2

( x) V ( x) ( x)
2 dx2

Odesolve x xmax

E ( x) ( 0)

Normalize wave function:

' ( 0)

( x)

0.1
( x)

x
max

Enter energy guess:

E4

33

( x)

dx

Fourier transform coordinate wave function into momentum space.


p 20 19.5 20

( p )

x
max

2 0

exp ( i p x) ( x) d x

33

2. Harmonic Oscillator
Goal: to provide students with a working document through which they can explore
some of the properties of the quantum mechanical harmonic oscillator
Objectives:
1. Students will be able to obtain any required Hermite polynomial from the
recursion formula.
2. Students will be able to prepare graphs of and * as a function of x for any
quantum
mechanical harmonic oscillator state.
Students will be able to discuss the shape of the curve and its significance.
The wave functions for the n non-degenerate harmonic oscillator states are given by:

n Nn Hn x e

x
2

(1)

Note: this is an inactive equation.

Identify each part of this wave function being sure to specify how it is significant for
the solution to the Schroedinger equation for the harmonic oscillator.
In this section we will develop the first 7 wave functions.
The various components can be written as follows:
This identifies the set of vibration numbers to be used in this exercise.

n 1 2 7

k 4
h

Identify all of the components of a.

This is done to simplify the mathematical representation.

let 1

N( n )

1
n

2 n

The normalization factor is a function of n,


the vibration quantum number

33

Beginning of Solve Block


Here a solve block is used to find the first Hermite polynomial
for the n=1 harmonic oscillator wave function.

n 1
Given
H( x)

( 1) exp x

n
n

dx

(2)

exp x

(3)

Find ( H( x) )

Note:[ctrl] and equal used simultaneously here.

Note: I used [ctrl] and period simultaneously to


create this expression.

End of Solve Block


Since the range of x has not been defined the [ctrl]= is used in equation (2) to
separate the right and left sides of the solve block.
The Hermite polynomial for n=1 is to the right of the arrow in equation (3) of the
solve block above. Highlighting the polynomial and using copy and paste permits
the creation of the first expression that you will need for the remainder of this
exploration of quantum mechanical harmonic oscillator functions. The subscript
in equation (4) was created with a period, i.e. you type a period followed by the
number or letter you wish to use. This is known as a literal subscript in MathCAD.
The results are:
H1

2 exp x x exp x

(4)

This equation can be simplified by highlighting all of the right hand side of the
expression and then choosing Simplify from the Symbolic Menu. The result is
shown here:
H1

2 x

By inspection write the polynomial that results when n=0.


Vary n above and determine the first seven Hermite polynomials.
Simplify each one and compare to those published in texts.
Make a table of these to use in the next part of this exploration.
(Hint: use separate regions or Insert lines from the Edit menu to give yourself
space
in this work sheet.)
Now prepare a table of the first seven wave functions for the harmonic oscillator.

33

Plot these and compare to the curves found in most texts.


The first two are shown here as examples. A range for x is set to permit plotting
of the functions.
x 5 4.99 5

0( x) N( 0) H0 e

1( x) N( 1) H1( x) e

Now plot * as a function of x for each one wave function.


Compare your results to diagrams in your text.
The first two graphs are shown for illustration.

Compute the area under each curve. Two examples are given below.
Do two more and then predict what will be the value of the integral for the others.
Explain the significance of this result.
Note: normally integration would be done from - to +his causes an
overflowing MathCAD.
Large numerical limits are used as a substitute. In cases like this the value for the
limits can be determined from the behavior of the function when it is graphed.

33

H0 1 H1( x) 2 x H2( x) 2 4 x H3( x) 12 x 8 x H4( x) 12 48 x 16 x


3

H5( x) 120 x 160 x 32 x H6( x) 120 720 x 480 x 64 x


3

H7( x) 1680 x 3360 x 1344 x 128 x

3. LEARNING MOLECULAR
SYMMETRY-H2O, NH4
Symmetry operations
All symmetry operations in 3-dimensional space can be represented by 3x3 matrices. The
simplest, E operation, is represented by a 3x3 identity matrix created by the command
identity(3).A rotation of angle along z-axis is represented by: In the space to the right
type identity(3)= to see the 3x3 identity matrix..

In general, a rotation of angle about any unit vector, A, passing through the origin, is
represented by:

33

It is to be understood that all symmetry matrices in this work will operate on a


displacement vector (x,y,z).To check if Eq [2] reduces to Eq[1], let's define

This is the matrix representing a rotation of 90 degree about the z-axis. We will then use
Eq.[2] throughout the discussions. A reflection by a plane that is perpendicular to the zaxis is represented by :

In general, a reflection by a plane passing through the origin, that is perpendicular to a


unit vector, A, is represented by a Refl(A) matrix:
Let us check this equation to see if the
matrix reduces to Eq.[3] when A is a unit vector along z-axis:

An inversion about the origin is represented by an Inv matrix:

These few matrices will give us sufficient tools to conduct algebric operations on
molecules.

33

Exercise 1: Write an arbitrary unit vector and write a 90 degree rotation matrix, a
reflection matrix on a plane that is perpendicular to this unit vector. Find the
determinants of these two matrices. What do you discover ? These symmetry matrices are
often called unitary matrices. Do you know why?

3.1 Water molecule


The coordinates of the water molecule can be obtained from quantum computations using
software such as HyperChem. In HyperChem, you need to align the molecule such that zaxis is the axis of the rotation. In setting up the molecule for quantum computation, you
need to use "Align Viewer" with the z-axis (This assures you are looking down the zaxis.) Next, align the tertiary axis (axis of rotation in water) with the z-axis, using "Align
Molecules" and align the tertiary axis with the z-axis.After the alignment, perform abinitio calculations with 6-31G**, Restricted Hartree-Fock with MP correlation. Go to the
log to find your coordinate data. The unit of length used in this matrix is the Angstrom.

First column represents the x-coordinate of three atoms; 2nd column, the y-coordinates;
3rd column, the z-coordinates. First row represents (x,y,z) for the oxygen atom; two
hydrogen atoms are represented by the second-row and third-row of the matrix.If we
want to graphically represent 2 OH bonds in the water molecule, we may want to express
water molecule matrix as follows:

33

Graphical representation of water molecule:

Internal Coordinates

33

Fig 4 can be further simplified, if we use internal coordinates such that the
oxygen atom is set as the origin, and the principal axis of rotation is set as the zaxis.By substracting (x,y,z) coordinates of O from H1(and H2), we have r1 and r2
as coordinates of two hydrogen atoms.

We still need to define the principal axis of rotation, which is a unit vector between 2 OH bonds

C2 Rotation along a principal axis


Closely look at the water molecule shown in Fig.4, the principal axis of rotation is a unit
vector between 2 O-H bonds. A 180 degree rotation along this unit vector, the molecule
returns to itself. This axis of rotation is defined as the C2 rotation for the water molecule.
To see this, we shall first define 2 r vectors,r1= r<0> and r2=r<1>, connecting O atom to
2 H atoms.

33

Exercise 2: Write x, y, z, r1, r2, and OH1 OH2 above and beside the matrix in Eq [8]
similar to those written on Eq.[6] Align C2 axis with a unit vector along the z axis The
procedures to align principal axis of rotation with a unit vector along the z-axis involve
rotation operations through 3consecutive Euler angles.

To align A with the z axis, we first rotate A about z-axis with an angle of =(90-26.224)
degree. This essentially align A with the x-axis. A second rotation of 90 degree will align
A with z axis. We can experiment the rotation operation as follows

33

The Euler operator defined in Eq.[10] can be used to linearly transform both OH bonds as
follows:

Plotting bond vectors


Define a new water molecule matrix:

33

C2 rotation on OH1 results in OH2. Similarly, C2 rotation on OH2 results in OH1.

Exercise 3 Write x, y, z, O, H1, H2 over or beside the matrix NewH2O (Eq.[12]) similar
to those shown in Eq [5b].

Angle between the two O-H bonds


Exercise 4: If there are two vectors, a and b, that intersect with an angle , how would
you express the relationship between , and the dot product of a and b?

33

Reflection by a plane containing a principal axis


There are two such planes. One such plane is such that its normal is a vector that connects
H1 to H2. The other plane is a plane conaining all three atoms.

Reflection of OH1 vector with v1 returns OH2 and vice versa. Reflection of OH1 with
v2 returns to itself.

Symmetry operators for water molecule form a group


We can show that these 4 symmetry operators, E, C2, v1, and v2 form a group,
according to group theory. We need to demonstrate:
1) if A and B are symmetry operations of the group, then AB is also a symmetry operation
of the group.
2) associative rule is obeyed: (AB)C= A(BC)
3) there is an identity symmetry operation, E, such that EA=AE=A
4) for every A, there is A-1 such that AA-1=A-1A=E
With Fig.5 of OH1 and OH2 of water molecules, we re-write these 4 operators.

Exercise 5 Show these symmetry elements satisfy Group Property [1]: If A, and B are
elements of a group then AB is an element of a group.
Exercise 6 Demonstrate the associative property for these elements: If A, B, C are
elements of a group, then (AB)C=A(BC)
Exercise 7 What is the inverse of the element of C2 ? Is the inverse of C2 also a

33

member of the group? What is it ?

Unitary properties of symmetry operations


We can show these symmetry operations are unitary by showing that their transpose
matrices are also their inverse matrices.

You may also notice that the determinants for these matrices are either +1 or -1:

Exercise 8: Are these symmetry matrices Hermitian (the transpose of a conjugate equals
to itself) ? If they are, what are their eigenvalues?
Exercise 9: Are these symmetry matrices symmetric ( the transpose equals to itself) ?
Exercise 10: Are the eigenvectors of these matrices orthonormal ? An example of
orthonormal properties for C2 is shown here.

Exercise 11 Demonstrate the unitary property of these symmetry matrices. An example of


conservation of length is demonstrated here. You will need to demonstrate length
conservations with other operators.

33

3.2

The Ammonia Molecule

Hyperchem data and three N-H vectors

The HyperChem ammonia coordinate data (the unit is Angstrom) are shown as follows:

The matrix NH3 consists of coordinate data of NH3; N in the first column (x=(-0.6121),
y=(-0.3974), z=0.5807; H1 in the second column, H2, the third column, H3 in the 4th
column. Three vectors (r1, r2, r3) that connect the central N atom and each of the three
individualH atom can be created from the data in Eq[20]. Shown below are the Mathcad
commands to extract data and generate vectors. Remember, in Mathcad, we use [ for the
vector or matrix subscript to extract data.

33

The matrix r in Eq[21] is made of three N-H vectors. All three H-atoms have the same
z-coordinates implying that they are in the same plane. It indicates that the unit vector
along z-axis is a unit vector for C3 rotation. Z-axis is the principal axis of the rotation.

Plotting ammonia molecules


To plot ammonia molecule with three NH bonds, we need to construct a matrix from Eq.
[21]

33

Angles between N-H bonds

Exercise 13: Determine the angles between two arbitrary NH bonds. How close are these
angles to the tetrahedral angles ?
Exercise 14: What are the bond lengths for any of the NH bonds ? Are the bond lengths
reasonable?

C3 Rotation

The right-hand side matrix for C3*r is essentially the same as the left-hand side matrix in

33

Eq.[23] except the numerical value -2.642 x 10-4 for C3*r11 on the left is set to zero on
the right. The matrix is disabled by right-clicking on the box to disable the evaluation.
Exercise 15 Is C3 a Hermitian operator? Is C3 a symmetric operator? If not, find the
eigenvalues and eigenvectors for C3. Are the eigenvalues real numbers? Are the
eigenvectors orthonormal?

Reflection
These reflection planes are perpendicular to vectors: H1-H2, H2-H3, and H3-H1
Exercise 15: Write three vectors that are perpendicular to the reflection planes. One of
the
vectors is wriiten here as A1. Write the other two vectors.

Exercise 16 Demonstrate that the ammonia molecule has three such reflection planes of
symmetry. One demonstration is shown here. Complete the rest.

Exercise 18 Construct coordinate matrices based on Eq[25] and plot them to


demonstrate that the molecule returns to an identical configuration after the reflection

33

operations.

Reflection-Rotation(Improper Rotation) of Methane Molecules


Hyperchem Quantum Computation to collect coordinate data. Your objective is to write
4 vectors from the central carbon atom to each individual H-atom. The goal of this hand
s-on exercise is to learn about the improper rotation, S 4 , which is one of the symmetry
operations for methane. You also need to show that there is no C4 symmetry operation for
this particular molecule. The units used in the following table are Angstroms.

You need to write 4-CH vectors, and check whether they are tetrahedrally oriented . The
experience you have gained through the previous ammonia exercises will help you to
write such vectors.

Exercise 19 Find the bond angles between any of these 4 bonds. Find the bond lengths
for all these bonds. Do they agree with the definition of a tetrahedral molecule?

Plotting methane molecule

33

Exercise 20 Write x, y, z, C, H1, H2, H3,H4 over or beside the matrix CCH4 (Eq.
[28]) similar to those shown in Eq [5b].

The methane molecule has an reflection-rotation symmetry, S4, which consists of a


combination of first, a 90 degree of rotation followed by a reflection which is
perpendicular to this axis of rotation. By looking at the plot shown above, is the axis of
rotation the same as z-axis ? Obviously, it is not. Therefore, you need to identify the axis
of rotation. The axis of rotation is half way between any of two C-H bonds.
Exercise 21: Find all the axes of rotation-reflection for methane. One of the axes is
shownhere. Find the other axes. How many of these axes are unique?

33

Now, let us look at the C4 operation about A with each CH bond of the CH4
molecule. What do you discover?

You can see that none of the column vectors in r <0> is the same as C4*r. On the
other hand,
as for the rotation-reflection operator, S4*r=Refl(A)*C4*r

After the S4 operation, r<0> becomes r<1>. You can repeat the operaion for other column
vectors.
Exercise 22 Using other axes of rotation, construct new S4 matrices. Does S4 on these
new axes return the molecule to itself its original configuration?
S4 in methane is not Hermitian, it is unitary

33

Two out of three eigenvalues for S4 are imaginary. But S4 is unitary.

This means that lengths of the transformed C-H bonds are conserved:

4. NUMERICAL SOLUTION OF
SECOND ORDER DIFFERENTIAL
EQUATION
4.1

Introduction

In this document we will explore the use of numerical methods for solving second order
differential equations. As an illustration of this technique we choose both the classical
and quantum mechanical harmonic oscillator problems. In the classical case the solutions
were written easily. For the quantum mechanical oscillator the solutions consisted of
polynomials that were obtained by requiring that these solutions were well behaved
functions.
So suppose you did not know the analytic solutions to the classical and quantum
mechanical oscillator differential equations. Is there a method that you could use to
understand the properties of the harmonic oscillator solutions without requiring explicit
solution of the differential equations? In other words is it possible to use a method that
would produce numerical answers for the differential equations? We would then plot
these answers and visualize the solutions. In the case of the harmonic oscillator we would

33

then also be able to compare our results with the known solutions and make a preliminary
assessment of the value of numerical methods.
In this Mathcad document we will explore a technique for finding graphical solutions to
differential equations. The method is numerical rather than analytical, i.e. the analytical
form found by direct solution of the differential equation is not used. The differential
equation is written and the graphical solution bracketed by successive approximations to
a fitting parameter. The choice of fitting parameter and variations in it are guided by
inspection of the graphical behavior of the function at the boundaries of the physical
model described by the differential equation. The function must satisfy these boundary
conditions. In the case of the classical harmonic oscillator described in the background
section of this document, at time zero the function X(t) equals the maximum extension of
the oscillation and at this point the first derivative of X(t) equals zero. Furthermore the
range of the numerical solution extends from time = 0 to time = the period of the
oscillation.

4.2 Goal
To provide an introduction to the use of numerical methods for solving quantum
mechanical problems.

4.3 Prerequisites
1. College calculus including differentials and integrals. You should know what a second
derivative is.
2. Basic skills with Mathcad.

4.4 Objectives
1. Explain the relationship between a physical model and the differential equation
representing that model.

33

2. Discuss the relationship between the shape of the curves that are solutions to
differential equations and the properties of the physical system described by the
differential equations.
3. Compare and contrast the analytic solutions of the harmonic oscillator classical model
and quantum mechanical oscillators to each other.
4. Compare and contrast the graphical solutions obtained by numerical methods for both
oscillators.

4.5 Background
First we can review some of the basic ideas about the classical harmonic oscillator model
and equation. The equations in this section of this document are not Mathcad active. They
are images inserted into the text by paste/special/picture from equations written in
MSWord6.0.
The differential equation for the classical harmonic oscillator is:
d 2 X (t )
k

X (t )or
2
dt
m
k X (t )
X
m

--------------(1)

A standard approach for finding the solution to a differential equation like this is to try a
guess for the solution to this differential equation. A good choice would be some
oscillatory function like a sine or cosine function. A better guess would be a sum of the
two possibilities as written next.
X (t ) A cos(bt ) B sin(bt ) --------------------(2)

Next use the boundary conditions to determine A and B. One boundary condition we will
impose is that at time zero the value of X(0) is the maximum extension of the spring. This
maximum value of X is the amplitude of the oscillation, namely AMP.
so AMP A cos(b0) A

---------------(3)

Now we must determine the value for B. For this we do the following:

33

First write X (t ) AMP cos(bt ) B sin(bt ) ---------------(4)


Take the derivative with respect to t to get
(t ) AMPb sin(bt ) Bb cos(bt )
X

------------------(5)

Then impose another boundary condition, namely that


(0) 0
whent 0then X
B 0

so X (t ) AMP cos(bt )

-------------------------------(6)

substitute equation 6 into equation 1 to find b


b2
b

k
m

---------------------(7)

Question: Write the final solution to the classical harmonic oscillator differential
equation. Provide the units for k and the significance of k for the oscillator. Describe
how k can be used to model the strength of a chemical bond.

4.6. The Classical Harmonic Oscillator Using the Numerical Solution Algorithm
In this section we will examine the implementation of the algorithm step by step. After
analyzing the process you will be directed to apply it to the quantum mechanical
harmonic oscillator. Later you will also be able to use another Mathcad document 2, 3 to
explore the solutions to the radial function for a spherical potential problem. You will
then be better able to describe and interpret two of the classic quantum chemistry models
that lie at the core of the discipline. So now let's get started.
First write the differential equation with f(t) being a constant k/m:

dt

X( t )

X( t)

k
m

33

To use this numerical method make a grid that spans the range of the problem. Here we
set the grid for 300 computed points. This will adequately span the range for this and
most problems. We need a large number of points so that the distance between points
throughout the whole range is small.
n 300
Next choose values for any parameters that appear in the differential equation. In the
equation in this introductory example this is the constant k. For simplicity let k=1 and
m=1. You are free to change k later as it is defined as a global variable below. Changing
m would require adjusting the algorithm equation for Xi. Since initially we want to focus
on k we will not include m in the equations to follow.

k 1

m 1

Mathcad will plot the computed 300 points using the difference algorithm shown in
equation 8. The solutions appear as plots of X(t) versus t.Here we set the time scale range
for the problem. For the simple classical harmonic oscillator the range here is the period
of the oscillation. You may choose any values to start. These too can be changed later. In
differential equations for real physical situations the range will be determined by the
physical context of the problem. Experience will allow you to set good ranges.

tmin 0

tmax 5

Compute the parameter. is the spacing between the grid points. In effect tmax is the
period of the oscillation.

tmax tmin
n

Now step through the grid to generate the ti values

i 0 n

t tmin i
i

Set the initial values for X(t). The algorithm depends on the difference between
successive estimates of X(t) as the calculation steps through all the i values of the grid.
The choice of the two initial values for the function X(t) is somewhat arbitrary but

33

depends on the system you are studying. For the simple function in this initial exercise
you can use other values for X 1 and the result will be the same. Other functions that you
may try in a Quantum Chemistry course are more sensitive and require that the two initial
values for the function be rather closely spaced. Only trial and error and experience will
tell you how to proceed. This is part of the process of becoming an expert problem solver.
X 4
X 4.001
0
1
Now step through the algorithm. That is:
Implement the algorithm by computing X(t) for all values of i > 1. (Remember i = 0 was
the first one. The default in Mathcad is zero as the start of all array subscripts.) X 0 and
X1 were assigned values in order to start the process. We can think of these as seed
values for the algorithm.
i 2 3 n
The big equation shown below is the differential equation
solution algorithm.
2
2 X
X

i1

i 2

12

k X

1 k

k 1.0

i2

10 k X

i 1

12

The parameter k is set as a global variable. Adjust the value of k here to the left and
determine the value of k for which the curve equals X0 at the two ends of the range.
A preliminary graphical solution is shown here to the left. This solution clearly does not
give the correct value for the amplitude at the two extremes of the period of oscillation
that we chose at the beginning of the exercise. Adjust k until the function equals 4.0 at
both ends of the range. Adjust the graph layout to show grid lines and the correct range
that matches your differential equation.

33

Questions:
What is the range for this differential equation?
Find values of k that give a graphical solution with zero, one, and two nodes. A
graphical solution occurs when Xi = 4 at t equals 0 and at t equals the period of the
oscillation.
How does the value of k seem to vary for solutions that have different numbers of
nodes?

5. STUDY MATERIAL OF HYDROGEN


ATOM AND MOLECULE
5.1 The Ionized Hydrogen Molecule

33

In the sections below, wavefunctions for the ionized hydrogen molecule are first obtained
by using the linear combination of atomic orbitals (LCAO) method and then by solving
the exact Schodinger equation using the numerical technique known as the Shooting
Method. The solutions from the two different techniques are then compared. In both
cases, the protons are assumed to be fixed at a distance rAB apart using the BornOppenheimer approximation [5] since they are much more massive than the electron.

5.2 LCAO Solution


In the LCAO view, the effects of each proton on the motion of the electron are considered
separately. In other words, the electron is assumed to be completely governed by proton
A when it is closer to proton A and to be completely controlled by proton B when it is
closer to proton B. This results in an overlap region the area of which depends on the
distance between the two protons. In a planar view, the position of the electron can be
defined by its distance to the nearest proton, rA or rB, and its angle, A or B . This
geometry, illustrated below, is best described in polar coordinates.

Lines of constant r are circles around the proton, while constant defines a line
extending from the proton. Rotation about an axis creates spheres for constant r and
cones for constant , which can be described in spherical coordinates, where is the
angle of rotation.
Linear combinations of the atomic hydrogen orbitals can be used to approximate the
orbitals of the ionized hydrogen molecule. Both the sums and the differences of these
atomic orbitals must be considered, which suggests the trial molecular orbitals

33

(4a)
and
(4b)

The coefficients can be determined from the variational principle.


To compare the molecular orbitals from the LCAO method to those of the exact method,
the real hydrogenic orbitals must be converted from spherical to spheroidal coordinates.
The necessary relationships between the spherical coordinates r, , and and the prolate
spheroidal coordinates , , and are given below.

The 1s orbitals in spherical coordinates are given by


(5a)
and
(5b)

for orbitals centered on protons A and B, respectively. We'll assume the protons are two
Bohr apart.
rAB 2

Thus, substituting the expressions for rA and rB given above transforms them into the
following expressions in spheroidal coordinates:
1sa

rAB

2
e

1sb

33

rAB

2
e

To determine the coefficients with the variational principle, we need to calculate the
overlap integral, which in spheroidal coordinates is given by

1 0

1sa 1sb

rAB
8

d d d

The coefficients can be calculated from the following expressions.

The LCAO 1g orbital is

1g cb 1sa cb 1sb

and the LCAO 1u orbital is

1u ca 1sa ca 1sb

Here is the plot of the LCAO approximation of the 1g orbital and its probability
distribution.

33

Here is the plot of the LCAO approximation of the 1u orbital and its probability
distribution.

Here is the plot of the LCAO approximation of the 1u orbital and its probability
distribution.

33

6. GROUND STATE OF HELIUM


ATOM BY VARIATION METHOD
Gaussian Trial Wave Function:

Demonstrate the wave function is normalized.

The terms contributing to the total electronic energy of the helium atom are the kinetic
energy of each electrons interaction with the nucleus, and the interaction of the electrons
with each other.
Calculate kinetic energy:

Calculate electronnucleus potential energy:

Calculation of electronelectron potential energy:


a. Calculate the electric potential of one of the electrons in the
presence of the other:

b. Calculate the electronelectron potential energy using result of part


a:

33

Write the equation for the total electronic energy in terms of the
variational parameter and minimize the energy with respect to :

Compare the variational calculation to the HartreeFock limit:

Compare the variational calculation to the HartreeFock limit:

Compare optimized trial wave function with the HartreeFock wave function (see
McQuarrie and Simon, page 283) by plotting the radial distribution functions.

33

7. ELECTRON MOTION THROUGH


RECTANGULAR POTENTIAL
BARRIER
We will examine the problem of a particle incident on a 1-dimensional potential
barrier.The particle approaches the barrier from the left with an incident energy E.
The barrier has a height of Vo and a width L. We will look at the wavefunctions
for the case where the incoming energy is lower than the barrier height.
________________
|
|
E
Vo |
|
T
|
|
---------------------------
|
|
-- - - - - - - - - - - - >
|
|
___________________________|
___________________________ <------- L ------->
In the first section, the wavefunction for a particle colliding with a barrier is plotted
out.
Use this wavefunction to describe the reference particle. Later on you get to
change the characteristics of a second particle and compare it with this reference
particle.
First, let's define the characteristics of the reference particle

33

MAS 5

Set the particle's mass.

E 0.008

Set the particle's energy (kinetic energy in this case).

EoverV 0.9

Set the ratio of the particles energy to the barrier height. This
value should be kept less than unity.

Set the width of the barrier.

WID 5
E

Vo

Compute the barrier height.

EoverV

Here we calculate the wavefunctions, which are found by solving the Schrodinger
equation !You need not know the details of
this coding.

K2

2 MAS ( Vo E)

A1 1.

A3

factor cosh ( K2 WID)

Wid0 WID

z 1

z K1 K2
2 K1 K2

sinh(K2WID)

A1 ( cos ( K1 WID) z sin ( K1 WID) )

A1p
A2

K1 2 MAS E

factor

2 K1 K2

0.5
K2

sinh(K2WID)A3(cos (K1WID) zsin(K1WID))

z K2 K1

[ A1 ( K2 z K1) A1p ( K2 z K1) ]

i 1 100

x 5 WID i
i

A2p A1 A1p A2

10 WID
100

i
i A1p cos K1 xi z sin K1xi
P2 A2 exp K2 x A2p exp K2 x
P3 A3 cos K1 x z sin K1 x
i
i
i
i
i
i

P1 A1 cos K1 x z sin K1 x
i

potr if x WID x 0

Rwf Re wf
i

2
EoverV

wf if x 0 P1 if x WID P3 P2
i

x1 x
i

Below we plot out the real part of the wavefunction as it approaches the barrier from the
left. The wavefunction is indicated in red, the potential barrier is the thick black line.

33

Now we will write this wavefunction into a new vector which will be the reference
wavefunction.

ref i Rwf

Now we will compute the wavefunction for the particle whose characteristics you should
change. You will compare this wavefunction with the reference wavefunction ref.
E 0.008

This parameter specifies the particles energy.

MAS 5

Change this parameter to modify the mass. For nice


wavefunctions this mass should be greater than 1 !

WID 23

Change this parameter to modify the width of the barrier !

EoverV 0.9

Vo

E
EoverV

Change this parameter to vary the ratio of the incoming energy to


the barrier height.
Here we compute the barrier height.

Here we calculate the wavefunction, which is found by solving the Schrodinger


equation !
You need not know the details of this coding.

33

K2

2 MAS ( Vo E)

A1 1.
A3

factor cosh ( K2 WID)

z K1 K2
2 K1 K2

sinh(K2WID)

A1 ( cos ( K1 WID) z sin ( K1 WID) )

A1p
A2

K1 2 MAS E

factor

z K2 K1
2 K1 K2

0.5
K2

sinh(K2WID)A3(cos (K1WID) zsin(K1WID))

[ A1 ( K2 z K1) A1p ( K2 z K1) ]

A2p A1 A1p A2

WIDL if ( WID Wid0 Wid0 WID)


i 1 100

P1 A1 cos K1 x z sin K1 x
i

pot0 if x WID x 0

Rwf Re wf
i

100

A1p cos K1 xi zsin K1 xi

P2 A2 exp K2 x A2p exp K2 x


i

10 WIDL

x 5 WIDL i

2
EoverV

P3 A3 cos K1 x z sin K1 x
i

x1

wf if x 0 P1 if x WID P3 P2
i

xmax if x1

100

100

100 100

This is the wavefunction of the reference particle

xp x
i

z 1

This is the wavefunction of your particle.

33

8. PLANAR XY3 TYPE MOLECULEEXAMPLE HCHO-FORMALDEHYDE.


As the figure below reminds you, formaldehyde is a four atom non-linear
molecule. The point group to which it belongs is C2v, and it is a nearly prolate top with
an asymmetry parameter near -1. The permanent dipole moment is directed along the aaxis. Since it is non-linear, there are 3(4)-6 = 6 non-degenerate normal modes of
vibration. In the order derived by G. Herzberg, these six modes are:

33

The structure and vibrational normal modes of formaldehyde.


What are the symmetries of the normal modes? Clearly, the C2v symmetry of the
molecule is maintained in the 1,2, and 3 modes, and so they are all A1. The 6,
or out-of-plane bending, mode, is B1, and the remaining 4 and 5 modes are B2. The
1, 2, and 3 modes have dipole derivatives that change along the a-axis,
The six normal modes of vibration of formaldehyde in the point group
C2v(3A1+2B1+B2)are all Raman and Infrared active. The internal coordinates of H2CO
are shown in the figure and the coordinate for the out of plane mode() are not shown.
The symmetry coordinates are easily constructed and are easily shown below. The

33

geometrical parameters are r(C=O)1.216 A,r (C-H)1.09A,(HCH)and (OCH)each


120deg.are employed.
Symmetry coordinates :
A1 species :
1 r r
S1

1
2
2

S2
S3
Sr

d
1 2

1
2
6


1
2
3

(redundant coordinate)
B1 species
1 r r
S4

1
2
2

S5

1
2
2
S6

B2 species

The general form of the G and F matrices for H2CO in internal coordinates are shown in
the table for the inplane modes.Since there is only one out of plane vibration and belongs
to a different symmetry species, it could conveniently be considered seperately.

A B

F
E1 F1

E1

r1

r2

D
A1 B1 D1 D2 C1

A1 D1 C1 D2

33

With the aid of Decius or Shimanouchi tables , the G matrix elements are written down.
In the following expression,r1=r2=r and 1=2= are used. The symbol denotes the
reciprocal of the mass of the atoms shown as a subscript.

C O

G11

G22

G33

G23

B1

C cos

2 C

G14

G15

G16

G24

G34

G25
G26

G35
2

G55

G66

G56

G45

G46

C cos

sin
r

D2

C1

C H

sin
d

sin
cos
C
r
d

2 C

cos
r

C H C H

E1

C O
d
F

G13

sin
r

F1

G12

sin
r

D1

G36

G44

C H

A1

cos

2 C

r d

cos
cos

2 C
C
2
r d

C H
r

cos
r

33

MO 16

MH 1.008

1
MO

MC 12

1
MH

1
MC

120
180
r 1.09

B1 C cos

A1 C H

120
180

d 1.216
A C O

C H

E 2

B C cos

C H

2 C

2 C

C O

C H

F1

cos

C H

E1

2 C

cos
r d

cos
cos

C
2
r d
r

cos
r

33

A1 B1

2 B

GA1

( C D)
6

D1 D2 C1
6

0.146

0.162

3.096

A1 B1 D2 C1

E1 F1

fr 4.35

fd 10.8

fd 0.291
f 0

f 0.83 f 0.46

fr 0 frr 0
f 0

fr 0

fdr 0.29

fd 0.173

tr 0

fr frr

fd

2 fd fd

2 f f f 4 f

FA1

2 fdr

( E 4 F) 2 E1 2 F1
3

For B1 species

GB1

2
E F E1 F1
3

1.034 0.059 0.027


0

Ga1

C 2 D

1
2 E E1 F1 4 F
3

2 D1 C1 D2

2 fr fr tr

33

fr frr fr tr

FB2

f f

33

QUESTIONS
1. Derive the numerical solution of Schrdinger wave equation.
2. Describe the motion of a harmonic oscillator in an electrostatic potential well.
3. Discuss the molecular symmetry in H2O molecule.
4. Discuss the molecular symmetry in NH4 molecule.
5. Explain the method of solving second order differential equation through
mathCAD.
6. Explain the study of Hydrogen molecule through mathCAD.
7. Discuss the Ground state of helium atom by Variation method.
8. Explain the Electron motion through rectangular potential barrier.
9. Discuss the Formaldehyde molecule as an example of XY3 molecule. Derive the
frequencies of six modes of vibrations.

33

***************

33

You might also like