PH15720 INTRODUCTION TO COMPUTATIONAL AND EXPERIMENTAL PHYSICS - MATHCAD.

Post on 12-Jan-2016

228 views 1 download

Tags:

Transcript of PH15720 INTRODUCTION TO COMPUTATIONAL AND EXPERIMENTAL PHYSICS - MATHCAD.

PH15720

INTRODUCTION TO COMPUTATIONAL AND EXPERIMENTAL PHYSICS -

MATHCAD

Introduction• What can MathCAD do ?• Why is MathCAD important ?• When will we learn MathCAD ?• Which is the best MathCAD book ?• Who do we ask about MathCAD ?• How will we be tested on MathCAD ?• How do we start MathCAD ?

Congratulations on choosing a hard subject

• Physics has:– Right & Wrong answers – Difficult concepts – Hard mathematics – Continual coursework

• MathCAD can help

Degree grade is very important

• 30%+ of 18 year olds at university

• Not good enough to aim for a pass

• Grade affects rest of your career

Degree Outcomes• 1st International Science, PhD

• 2.1 National laboratory, PhD

• 2.2 Science officer, teacher

• 3rd Teaching

• Pass “Do you want fries, sir?”

Research Led Teaching• 2 strands

– Using lecturers research interests to give direction to undergraduate teaching

– Encourage students to learn through discovery

No Clowns !!• Turn up

• Do the work

• Use time wisely

• Think about what you are doing

What can MathCAD do ?- Simple Calculations

1 1 2

91

3 5 4 19

23

8

What can MathCAD do ? - Process equations

NB. Use of unitsNB. Use of units

What can MathCAD do? – Help visualise maths & physics

• Electron wave function

X Y Z210( )

210 r 1

32 a 05r e

r2 a 0

cos

What can MathCAD do? - Process experimental results

.

0 2 1014 4 1014 6 1014 8 1014 1 10152

1

0

1

2

3

hf0

q

StopPotential

StopTheory f( )

f0

f

hf0

q 1.904V

StoppingData0 1

0

1

2

3

4

5

366 1.48

405 1.15

436 0.93

492 0.62

546 0.36

579 0.24

What can MathCAD do? -

Symbolic algebra

x 7 10 solve x 3

sin x( )1

2solve x

1

6

a x2 b x c 0 solve x

1

2 a( )b b

24 a c

1

2

1

2 a( )b b

24 a c

1

2

What can MathCAD do? -

Calculus

xx3d

d3 x

2

xx y( )

2d

d2 x 2 y

x1

x

d ln x( )

1

2

x1

x2

d1

2

What can MathCAD do? Animation 1 – Projectile Motion

What can MathCAD do?

Animation 2 – Planetary Orbits

What CAN’T MathCAD do ?

• Process huge amounts of data

• Work in real time

• Control test equipment

• Work that fast– Use Labview to control test gear

Why use MathCAD ?• Good ratio of answers/keystroke

• Uses mathematical notation

• Uses units & dimensions

• Departmental Strategy– MathCAD– Labview

Example - C

• Calculate mass of tank of water

• 12 lines

• 185 characters

(* Program to calculate mass of water tank *)(* Program to calculate mass of water tank *)

(* C code version *)(* C code version *)

#include stdio.h#include stdio.h

#include math.h#include math.h

main()main()

{{

float R, H, Rho, V, M;float R, H, Rho, V, M;

R = 2;R = 2;

H = 1.8;H = 1.8;

Rho = 1000;Rho = 1000;

V = 3.1316 * pow(R, 2) * H;V = 3.1316 * pow(R, 2) * H;

M = Rho * V;M = Rho * V;

printf("V = %f \n M = %f", V, M );printf("V = %f \n M = %f", V, M );

}}

Example - Pascal

• Calculate mass of tank of water

• 195 characters

(* Program to calculate mass of water tank *)(* Program to calculate mass of water tank *)

(* Pascal code version *)(* Pascal code version *)

program tank(input, output);program tank(input, output);

varvar

R, H, Rho, V, M : real;R, H, Rho, V, M : real;

beginbegin

R := 2;R := 2;

H := 1.8;H := 1.8;

Rho := 1000;Rho := 1000;

V := 3.1316 * R * R * H;V := 3.1316 * R * R * H;

M := Rho * V;M := Rho * V;

writeln('V =', V);writeln('V =', V);

writeln('M =', M);writeln('M =', M);

end.end.

Example - Labview

Mass

Volume

Density

Radius

Height

Example - MathCAD

75 keystrokes• Units calculated

Why is MathCAD important ?

• Forms core of computing on UWA physics course

• Can be used in most aspects of physics degree scheme

• A useful tool for the rest of your professional life

When will we learn MathCAD ?

• Spread over 3 years• Year 1

– Fundamentals, units, matrices

• Year 2– Data Analysis, symbolic maths

• Year 3– Numeric methods, ODEs, Animations, fancy

stuff

First year Course• 10 lectures/practicals

• 5 weeks

• Worksheets to lead you step by step

• Worksheets & lecture notes available on the web:http://users.aber.ac.uk/dpl

Which is the best MathCAD book ?

• An Introduction to MathCAD 2000

• R.W. Larsen

• Prentice Hall

• ISBN 0–13–020007–7

• £12.99 – Buy it now

Who do we ask about MathCAD ?

• Online Help system– MathCAD Help, Resource Centre

• UWA Staff:– dpl, kb & demonstrators

• Web:– http://www.mathcad.com

(resources|MathCAD files around the world)– Or via online help system

How do we start using MathCAD ?

• On lab machines:Start Menu

Mathsoft Apps

MatchCAD 13

Which bits of MathCAD will give us problems ?

• Editing/Selecting equations

• Types of Equals signs

Editing & Selecting Equations

• Blue underline & insertion line enclose expressions

• Use arrow keys & spacebar to move

Insertion pointInsertion point

UnderlineUnderline

Selecting expressions• Click in expression with mouse

• Use <space> to select more/less of expression

• Use arrow keys to move around in expression

• Insertion point is where things happen

Using the spacebar • Spacebar select more & more of

expression & then returns to start

spacespace spacespace spacespace

space

Using the spacebar #2• What gets selected depends on where you

start

Arrow & Insert keys• Arrow keys move insertion point

• Insert key swaps sides

Insert

Placeholders• Black rectangle

• Holder for expression that needs to be filled in

PlaceholderPlaceholder

Practice Makes Perfect• Invest time in MathCAD

• Use for:– Example sheets– Other coursework– Visualising concepts in lectures

What do we do now ?• Login

• Work through exercise sheet 1“First steps with MathCAD”

• Notes & Handouts from:

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

& follow “Course Material” link