240 likes | 649 Views
An Introduction to MathCAD. Finding Solutions and Symbolic Maths. Finding Solutions. Finding roots of an equation Finding roots of a polynomial Solving systems of equations. Finding roots of an equation. Equations of the form f( x ) = 0 One equation in one unknown
E N D
An Introduction to MathCAD Finding Solutions and Symbolic Maths
Finding Solutions • Finding roots of an equation • Finding roots of a polynomial • Solving systems of equations
Finding roots of an equation • Equations of the form f(x) = 0 • One equation in one unknown • Define guess value for x • Use root(f(x),x) function to find root • plot function to get initial guess value(s)
What if MathCAD can’t find roots • Expression has no roots • roots are far away from initial guess • local maxima or minima between guess and root • discontinuities between guess and root • complex root • Plot function to narrow in on solution
Finding roots of a polynomial • Represent coefficients of polynomial at vector • Use polyroots to find roots • Doesn’t need initial guess • Finds all roots simultaneously • Finds real and complex roots
Solving systems of equations #1 • Solve up to 50 simultaneous equations in 50 unknowns • Equations not restricted to linear equations • Allows equations and inequalities
Solving systems of equations #2 • Assign guess values to all variables with := • Given starts solve block • Solve block contains system of equations • Equations in solve block use: • = <ctrl => • < < • > > • ³ <ctrl 0> • £ <ctrl 9>
Solving systems of equations #3 • Solve block terminates with find(a1,a2,a3,a4...) • returns scalar for one argument • returns vector of solutions for more than one argument • Only returns one solution • Use inequalities to force other solutions
Symbolic algebra • Simplify expressions • Derive formulae • Solve equations symbolically • Get exact answers to integrals etc • Subset of Maple symbolic processor
Use of symbolic processor • Type equations using = (boolean equals) <ctrl=> • Select equation/variable to process • Options on symbolic menu change depending on what is selected • Derivation format changes result format
Simplifying expressions #1 • Use up-arrow/space bar to select part of expression • Symbolic|Simplify • Result appears as defined in derivation format • Horizontal • Vertical • With or without comments
Simplifying expressions #2 • Processor will simplify polynomials by collecting powers • Understands math & trig identities • Will simplify numeric operations & fractions
Expansion / Factoring of expressions • Select expression • Symbolic|Expand or Symbolic|Factor • Factoring will also factor integer numbers
Re-arranging equations to solve for variable • Use = to define equation <ctrl => • select variable you wish to solve for • Symbolic|Solve for Variable • Need to comment after result to remember which variable you have solved for !!
Use of symbolic processor in problems • Define problem in terms of known equations • Use symbolic processor to solve for desired result • Copy resultant expression • Define variables • Paste in solution • Evaluate for numeric solution
Why use symbolic maths ? • Gives general solution • Numeric solution only solves for one set of conditions • Symbolic solution shows how solution varies with inputs • Determine which terms are important
Today’s practical session • Use of root() & polyroots() in conjunction with plotting to solve simple equations • Using a solve block to solve simple systems of equations • Using the symbol processor to: • simplify expressions • expand & factorise expressions • solve equations • Use symbolic processing for a real world problem
Next week’s assesment • Morning lecture: revision session • Practical session 4-6 • Exam conditions • Graded series of exercises • Complete worksheet & email • Marked on: • layout & commenting • understanding key points • thinking for yourself