PH15720 Laboratory Techniques - An Introduction to MATHCAD
Introduction Review of Last Week Built-In Functions Trigonometry Define your own functions
Review of Last Week Variables Names for things
Names #1 Problems if you use the name of built-in unit or function E.g. : m := 1kg Defines metre as 1kg => broken universe
How to tell if already used Type Press = IF defined: MathCAD gives value Else: MathCAD puts up :=
Names #2 MathCAD is Case-Sensitive Fhook is different from FHook Also Font-Sensitive myName myName aVariable aVariable
Translating Equations Equations in physics given in general form Need to translate for specific problem
Translating Equations #2 Textbook MathCAD
Translating Equations #3 Textbook MathCAD
Functions in MathCAD #1 Approx 250 functions Use f(x) on toolbar Trig: sin(x), cos(x), tan(x), acos(x) etc, etc Log & Exponential: ln(x), log(x), exp(x) Random Numbers: rnd(x)
Functions in MathCAD #2 Trigonometric Functions sin(x), cos(x), tan(x) asin(x), acos(x), atan(x) x in radians use ‘deg’ unit to convert from degrees
Functions in MathCAD -Define your own #1 Like defining variable, but uses parameter list (p1,p2…):=
Functions in MathCAD -Define your own #2 Examples: Define the function …and use it Define the function …and use it …and use it again
Why use functions ? Can simplify complex formulae Save cut & paste Better for graphing Makes it easier to separate out parameters & constants
Function Parameters Parameters are local Parameters do not affect rest of worksheet Parameter names only work here Not a parameter => Must be defined before
Simple X-Y plots ‘Quickplot’ Plot functions with 1 parameter Use with built-in & user defined Insert|Graph|X-Y plot
Simple X-Y Plot #1
Simple X-Y Plot #2
Plot Formatting Double click in graph Format|Graph|X-Y Plot… Dialog box Gridlines, Numbered Axes, Log Scales Traces: Colour, Points, Lines &c Axis titles, legend Defaults
Doing More with Plots #1 Add more curves to y-axis Separate with, Fix scale on x- & y-axis Add markers on x- & y-axis - from dialog box
Scaling plot axes
Doing More with Plots #2