


Finding Solutions with MATHCAD 






Aims 

Structure of Course 

Assessment 

Recommended Reading 

Other Resources 

Stuff you should know already 






http://users.aber.ac.uk/dpl 



Follow link: 

Course MaterialPH36010 





Use MathCAD to: 

Manipulate & solve equations 

Do Monte Carlo analysis 

Find numerical solutions to DEs 

Use MathCAD facilities 

Symbolic solver 

Solve blocks 

Programming 

Animation 




“Research Led” teaching: 





I can only show you the door, 

You have to walk through it 



(Morpheus, The Matrix) 





Lecture / Seminar 

Tuesday 10:00 

Physics B Lecture 

Computer Lab 

Friday 9:0011:00 

Physics Computer Room 112 

DPL 50% (5 weeks) 

A.N. Other 50% (5 weeks) 





Exercises 

Follow the steps 

Only a selection will be marked 

Contribute towards portfolio (10%) 

Assignments 

More involved questions è thinking 

Set in Week 5 (40%) 

Email to me 





Introduction to MathCAD 2000 

Ronald W. Larsen 

ISBN 0130200077 

Library (6 copies) QA76.95.L3 

£13.99 





Explorations in MathCAD 

Kevin P. DesRues 

ISBN 0201427923 

Library (3 copies) QA76.95.D4 

A first course in computational physics 

Paul L. DeVries 

ISBN 0471548693 x 

Library (4 copies) QC52.D5 





Code Complete: A Practical Handbook of Software
Construction. 

Steve McConnell 

ISBN 1556154844 

£25.99 (Amazon.co.uk) 

$10.50 (Amazon.com) 





Notes on the web 

http://users.aber.ac.uk/dpl/course.htm 

Covers both PH15010 & PH36010 

MathCAD Help system 

Online Help 

Resource Centre 

Quicksheets 




Lay out a simple worksheet 

Assign variables 

Enter Expressions 

Work with Units 

Define Functions 

Matrix maths 

Read in & process experimental data 

Do Simple Plotting 




Site licensed 

On computer unit machines: 

Start MenuCoursewarePhysicsMathCAD 8
Professional 

On Year 1 lab machines: 

Start MenuProgramsMathsoft AppsMathCAD 8
Professional 





FilePage SetupSizeA4 

Highlight Results 

<rtclick>propertieshighlight region 

Format  Headers/Footers 

InsertPageBreak to split up work 







State problem in text region at top of
worksheet. 

Use text regions to explain the worksheet. 

Introduce: 

Variables 

Functions 

Calculations 

Can collapse regions to make “production
version” 





Use meaningful name for variables/functions 

Make names descriptive 

Use standard physics nomenclature 

UseCamelCapitalisation 

Examples: 

MRocket0_{
}: initial mass 

VRocketFinal
: final velocity 

Problem should suggest names 






Avoid using the following: 

Names of units/constants already defined: 

A,C,F,G,H,J,K,L,N,R,S,T,V,W 

m,s,e,g 

mi, sec, rad, deg… 

Names that differ only in case/font 

Fred ¹ fred ¹ fred ¹ fred ¹ fred 

Names with spaces in them 






Be Very Careful with subscripts 

Text Subscript 

Generated with <.> key 

Used to make name ‘pretty’ 

Best avoided (except by wizards) 

Array Subscript 

Generated with <[> key 

Gives Index into array 

Selection box act differently 

Watch the screen while editing 





To see if <name> is already used 

Type <name>= 

Will display value <name> if already
defined 

Will display := and placeholder for definition
if <name> not already defined 




MathCAD can work with units 

Understands SI & Imperial 

Units carried through calculations to result 

Use wherever possible 

Provides cross check on correctness of work 







For when you’re not sure about name of unit 

Either: 

Type <ctrlu> or 

Press key on toolbar 

Then select from dialog box 




Results display in base units 

Add units in placeholder after result 

MathCAD will scale result to keep dimensions
correct 






A function is a piece of ‘program’ which: 

Takes input (parameters) 

Performs calculations 

Returns value(s) 

Defined once 

Used many times 





Builtin – see f(x) dialog 

Math [exp(x), log(x), ln(x) … ] 

Trig [sin(x), cos(x), tan(x), atan(x)] 

String [ concat(S1,S2…), strlen(S)] 

Piecewise [if, step, delta ] 

File I/O 

User Defined 




Like defining a variable 

Add list of parameters after name 

Parameters will be substituted when function is
used 





Parameters are substituted when function is
used. 

Parameters are just placeholders 

No connection with variables of the same name 

Other variables in definition must be defined
before function 





InsertGraphXY plot <@> 

Put ‘x’ in Xaxis placeholder 

Put ‘f(x)’ in Yaxis placeholder 

X range defaults to ±10 

Change axis ranges using placeholders on axes 

Format to taste 

