An Introduction to MathCAD You can always find a solution !!

Slides:



Advertisements
Similar presentations
PSOD Lecture 2.
Advertisements

Solution of Equations Example Problem Desire to find the temperature (T) that corresponds to a desired pressure, P.
Chapter 2 Solutions of Systems of Linear Equations / Matrix Inversion
SOLVING SYSTEMS OF LINEAR EQUATIONS An equation is said to be linear if every variable has degree equal to one (or zero) is a linear equation is NOT a.
PH36010 Numerical Methods Solving Differential Equations using MATHCAD.
Example 1 Matrix Solution of Linear Systems Chapter 7.2 Use matrix row operations to solve the system of equations  2009 PBLPathways.
Chapter 4 Systems of Linear Equations; Matrices Section 2 Systems of Linear Equations and Augmented Matrics.
1 Copyright © 2015, 2011, 2007 Pearson Education, Inc. Chapter 4-1 Systems of Equations and Inequalities Chapter 4.
Part 3 Chapter 9 Gauss Elimination
Solving systems using matrices
MECH300H Introduction to Finite Element Methods Lecture 2 Review.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 15 Solution of Systems of Equations.
UNIT 6.15 Special Solutions: Graphing I can identify special solutions within a system of equations graphically.
Directions: Solve the linear systems of equations by graphing. Use the graph paper from the table. Tell whether you think the problems have one solution,
9.4 – Solving Absolute Value Equations and Inequalities 1.
Module 1 Introduction to Ordinary Differential Equations Mr Peter Bier.
Non-Linear Simultaneous Equations
6-1 Solving Inequalities by Addition and Subtraction Objective: Students will be able to solve linear inequalities by using addition and subtraction.
4.7 Inverse Matrices and Systems. 1) Inverse Matrices and Systems of Equations You have solved systems of equations using graphing, substitution, elimination…oh.
Solving Systems of Equations: Elimination Method.
Solving Linear Systems by Linear Combinations
Math 021. * Interval Notation is a way to write a set of real numbers. The following are examples of how sets of numbers can be written in interval notation:
Review of Matrices Or A Fast Introduction.
Using Matrices to Solve Systems of Equations Matrix Equations l We have solved systems using graphing, but now we learn how to do it using matrices.
Section 3.6 – Solving Systems Using Matrices
Lesson 13-1: Matrices & Systems Objective: Students will: State the dimensions of a matrix Solve systems using matrices.
1 Ch. 4 Linear Models & Matrix Algebra Matrix algebra can be used: a. To express the system of equations in a compact manner. b. To find out whether solution.
1. Inverse of A 2. Inverse of a 2x2 Matrix 3. Matrix With No Inverse 4. Solving a Matrix Equation 1.
PSOD Lecture 2. Matrices and vectors in Chemical & Process Engineering Appear in calculations when process is described by the system of equations:
3-2 Solving Equations by Using Addition and Subtraction Objective: Students will be able to solve equations by using addition and subtraction.
An Introduction to MathCAD Finding Solutions and Symbolic Maths.
Progress in identification of damping: Energy-based method with incomplete and noisy data Marco Prandina University of Liverpool.
Substitution Method: 1. Solve the following system of equations by substitution. Step 1 is already completed. Step 2:Substitute x+3 into 2 nd equation.
Class Opener:. Identifying Matrices Student Check:
Beginning Programming for Engineers
1. 2. * Often times we are not able to a quadratic equation in order to solve it. When this is the case, we have two other methods: completing the square.
Inequalities Symbols and line graphs. Symbols  < is less than  > is greater than  < is less than or equal to  > is greater than or equal to points.
Solve a system of linear equations By reducing a matrix Pamela Leutwyler.
10.3 Systems of Linear Equations: Matrices. A matrix is defined as a rectangular array of numbers, Column 1Column 2 Column jColumn n Row 1 Row 2 Row 3.
Slide Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley A set of equations is called a system of equations. The solution.
3.6 Solving Systems Using Matrices You can use a matrix to represent and solve a system of equations without writing the variables. A matrix is a rectangular.
9.3 – Linear Equation and Inequalities 1. Linear Equations 2.
GUIDED PRACTICE for Example – – 2 12 – 4 – 6 A = Use a graphing calculator to find the inverse of the matrix A. Check the result by showing.
> 0 is always POSITIVE< 0 is always NEGATIVE The sign on the leading coefficient is the sign of the RHB. Once the regions are labeled, shaded the desired.
4-8 Cramer’s Rule We can solve a system of linear equations that has a unique solution by using determinants and a pattern called Cramer’s Rule (named.
 Recall that when you wanted to solve a system of equations, you used to use two different methods.  Substitution Method  Addition Method.
Multiply one equation, then add
Tuesday, October 15, 2013 Do Now:. 3-1 Solving Systems of Equations by Graphing Objectives: 1)solve systems of linear equations by graphing 2) Determine.
ACSL, POSTECH1 MATLAB 입문 CHAPTER 8 Numerical Calculus and Differential Equations.
An Introduction to MathCAD More Symbolic Maths And First Steps in Calculus.
Chapter 5.  Graphing Inequalities Graphing Inequalities  Solving Inequalities Solving Inequalities  Compound Inequalities Compound Inequalities  Absolute.
Chapter 5: Matrices and Determinants Section 5.5: Augmented Matrix Solutions.
4.1 An Introduction to Matrices Katie Montella Mod. 6 5/25/07.
Matrices and systems of Equations. Definition of a Matrix * Rectangular array of real numbers m rows by n columns * Named using capital letters * First.
EEE 244-3: MATRICES AND EQUATION SOLVING
5.3 Solving Systems of Linear Equations by Elimination
Introduction Mathcad is a product of mathSoft inc. The Mathcad can help us to calculate, graph, and communicate technical ideas. It lets us work with.
Systems of Linear Equations
Solve a system of linear equation in two variables
5.3 Solving Systems of Linear Equations by Elimination
Applying Determinants to solve Systems of Equations 2x2 & 3x3
7.4 Solve Linear Systems by Multiplying First
Solving a System of Equations in Two Variables by the Addition Method
Cramer's Rule Gabriel Cramer was a Swiss mathematician ( )
Solving systems using substitution
Systems of Equations Solve by Graphing.
EEE 244-3: MATRICES AND EQUATION SOLVING
Inverse Matrices and Systems
Cramer's Rule Gabriel Cramer was a Swiss mathematician ( )
Warm- Up: Solve by Substitution
Presentation transcript:

An Introduction to MathCAD You can always find a solution !!

2 MathCAD #6  dpl 2001 When things go wrong “Result is too large to Display”

3 MathCAD #6  dpl 2001 Can we fix it ? Yes we can !! Force solver to work with real numbers

4 MathCAD #6  dpl 2001 What if its still broken ? Risky !! – OK in this case

5 MathCAD #6  dpl 2001 Still can’t solve it ? u Use polyroots to find roots u Use coeffs keyword on solver to get coefficients of x

6 MathCAD #6  dpl 2001 Still can’t solve it ? u Graph shows maxima & minima u => there must be solutions u Try guessing & using roots(f1(x),x)

7 MathCAD #6  dpl 2001 Solving ODEs numerically u Produce numeric solution to system of ODEs. u Must have initial conditions u Manipulate equations u Use one of several different solvers u Produces matrix of solutions

8 MathCAD #6  dpl 2001 First order linear ODE #1 u Radioactive decay, Newton’s law of cooling etc u A is amount of material temperature difference etc u k is rate constant

9 MathCAD #6  dpl 2001 First order linear ODE #2 u Define initial conditions as a vector u 1 st order so only 1 element in vector u Can’t use units in ODE solver u Call vector ‘ic’ u Element 0 = A at t=0

10 MathCAD #6  dpl 2001 First order linear ODE #3 u Now define ODE & manipulate for mathCAD

11 MathCAD #6  dpl 2001 First order linear ODE #4 u Now define range of solution Start time Finish Time Number of Points u And solve using rkfixed u Creates matrix ‘Soln’ containing solution

12 MathCAD #6  dpl 2001 First order linear ODE #5 Column 0 holds t values Column 1 holds A values The Solution Matrix 1 row of matrix per timestep (0..N)

13 MathCAD #6  dpl 2001 First order linear ODE #6 u Plot the results u Use M <> to extract columns u Use subscripting to extract rows

14 MathCAD #6  dpl 2001 Second Order ODE u Same steps as for first order u Slightly less obvious manipulation u Replace ODE by system of 1 st orders u Can use symbolic solver to formulate equations

15 MathCAD #6  dpl 2001 Second Order ODE Example #1 u Damped SHM –LCR circuit –Damped Pendulum Substitute for i & divide through by L Gives:

16 MathCAD #6  dpl 2001 Second Order ODE Example #2 Gives manipulated equation:

17 MathCAD #6  dpl 2001 Second Order ODE Example #3 u Use solver to solve for q2 u Now ready to create D(t,q) function

18 MathCAD #6  dpl 2001 Second Order ODE Example #4 u Equations to create D(t,q) u 2 row vector to hold D(t,q) u Change subscripts for suffixes

19 MathCAD #6  dpl 2001 Second Order ODE Example #5 u Specify initial conditions u For second order need 2 elements in ic vector Charge (q) at t=0 Current (dq/dt) at t=0 u Also need to specify constants in D(t,q) equations u Watch for lack of units !!

20 MathCAD #6  dpl 2001 Second Order ODE Example #6 u Define times and number of points as before u Call rkfixed to solve u Matrix Soln filled with solution points

21 MathCAD #6  dpl 2001 Second Order ODE Example #7 Column 0 holds t values Column 1 holds q values Column 2 holds dq/dt values The solution matrix

22 MathCAD #6  dpl 2001 Second Order ODE Example #8 u Graphing the solution

23 MathCAD #6  dpl 2001 Surely nothing can go wrong ? u Solution relies on numeric integration which divides timestep up into smaller chunks for integration u If system is changing much faster than timestep, solution will fail u Clues to look for: –“found a number >10^307” –Singularity at t finish

24 MathCAD #6  dpl 2001 Can we fix it ? u Check time constants u Try more point in solution (N) u Try smaller interval u Use a different solver –‘Stiff’ systems give problems –Special solvers for stiff systems –See Quicksheet & help system