Presentation is loading. Please wait.

Presentation is loading. Please wait.

PH15720 Laboratory Techniques - An Introduction to MATHCAD Lecture 2.

Similar presentations


Presentation on theme: "PH15720 Laboratory Techniques - An Introduction to MATHCAD Lecture 2."— Presentation transcript:

1 PH15720 Laboratory Techniques - An Introduction to MATHCAD Lecture 2

2 Introduction Review of Last Week Variables Names for Things Using Units Text areas & comments

3 Review of Last Session What, Why & Wherefore ? Starting MathCAD Simple calculations Saving work to M: drive Emailing worksheets

4 Variables #1 Storage for numbers in MathCAD Write formulae without using ‘magic numbers’ Do not re-type intermediate results Simplifies changing parameters

5 Use of variables - Example Compare the 2 solutions to a problem below  Which is clearer ?  Which is easier to change parameters ?

6 Variables #2 Variable set by using := Assignment operator ( := ) created by colon ( : ) key Declares the variable and sets its value to

7 Variables #3 Variables displayed by = sign Press = key  If variable already defined, MathCAD will print value =  Otherwise MathCAD will create assignment operator & placeholder for you to define value :=

8 Names for Things Very Important step in problem solving Applicable to all problems Applicable to all solution methods Develop convention & stick to it

9 Naming convention #1 Make names descriptive Use standard physics nomenclature UseCamelCapitalisation Examples:  MRocket0 : initial mass  VRocketFinal : final velocity Problem should suggest names

10 Naming Convention #2 Keep names short Use comments to explain names Don’t try & put spaces in names Avoid using names already used for mathematical/physical constants (unless you mean it !)  g,c,e,q,   MathCAD will warn you

11 Naming Convention #3 Good examples: MBallA := 1.7 kg Mass of Ball A vBallA0 := 23 m/s Velocity of Ball A at t=0 VResA0 := 12 volt Voltage across Resistor A = 12V at t=0

12 Naming Convention #4 Bad examples: A := 7 m/s  No clue as to physical quantity  Probably too short (unless diagram)  Conflicts with A = Ampere v TheBallThrownByJohn := 17 m/s  Way too long g := 19  Redefined acceleration due to gravity

13 Greek Letters Enter into variables etc by:  Select from Greek toolbar  Type corresponding roman character +  =  Enter into text regions (comments) by changing to symbol font

14 Using UNITS #1 All variables in MathCAD may have units attached to them Units propagate through calculations MathCAD checks to ensure ‘sanity’ Results may be manipulated to desired units

15 Using UNITS #2 To enter units:  Assign a variable (Name + :)  Press * to introduce multiplication  Either: Enter units if you know them Press or units button to bring up selection dialog

16 Using units #3 Units displayed on result Many conversions possible

17 Using Units #4 To convert units of result  Select placeholder after result  Type/select desired units for result  MathCAD will scale result to new units.  Will add extra terms if dimensions wrong Placeholder

18 Text Regions #1 Very Important to:  Introduce problem  Introduce & explain variables  Explain solution method  Introduce & Explain answer

19 Text Regions #2 Text regions added by:  Insert|Text Region  “ key  Typing a comment. MathCAD will convert the text to a text region when the first space is typed. Text regions moved/resized with mouse – watch cursor change


Download ppt "PH15720 Laboratory Techniques - An Introduction to MATHCAD Lecture 2."

Similar presentations


Ads by Google