PH15720 Laboratory Techniques - An Introduction to MATHCAD.

Slides:



Advertisements
Similar presentations
INTRODUCTION LOGICAL OPERATIONS TRUTH TABLE AND RULES.
Advertisements

PHYS707: Special Topics C++ Lectures Lecture 2. Summary of Today’s lecture: 1.More data types 2.Flow control (if-else, while, do-while, for) 3.Brief introduction.
Computer Science & Engineering 2111 IF and Boolean Functions 1 CSE 2111 Lecture-IF and Boolean Functions.
Selection Structures Tonga Institute of Higher Education.
Boolean Algebra Lecture 7: Supporting Material Dr Kathryn Merrick Tuesday 24 th March, 2009.
Section 4.2: Functions that Test Conditions (continued)
Week 10 Recap CSE 115 Spring For-each loop When we have a collection and want to do something to all elements of that collection we use the for-each.
Introduction Chapter 4: Control structures. Introduction to OOPDr. S. GANNOUNI & Dr. A. TOUIRPage 2 Objectives What are control structures Relational.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Logical and Relational Expressions Nested if statements.
Chapter 4: Control Structures: Selection
ACOT Intro/Copyright Succeeding in Business with Microsoft Excel 2010: Chapter1.
Fall 2006AE6382 Design Computing1 Relational and Logical Operators Use relational operators to test two values Work with values of true and false Compare.
3-3 Solving Multiplication Equations. Solve Solution GOAL Find the value of the variable that makes the equation TRUE. The value that makes the equation.
Chapter 5 Boolean Algebra and Reduction Techniques 1.
CSci 125 Lecture 10 Martin van Bommel. Simple Statements Expression followed by semicolon Assignments total = n1 + n2; Function calls printf(”Hello.\n”);
Unit 5 – “Watch Out!”. Introduction New Topics Case Structures New Functions Less? Comparison Function Ultrasonic Sensor.
Computer Science 101 The Boolean System. George Boole British mathematician ( ) Boolean algebra –Logic –Set theory –Circuits –Conditions in if.
PAGES:51-59 SECTION: CONTROL1 : DECISIONS Decisions.
1. We’ve learned that our programs are read by the compiler in order, from top to bottom, just as they are written The order of statement execution is.
1 CSE 2337 Chapter 4 Logic. 2 Objectives Boolean Values Logical Operators Conditional Logic Nested Functions.
Lesson 5: Working with Formulas and Functions Logical and 3D Formulas.
CPS120: Introduction to Computer Science Operations Lecture 9.
BASIC LOGIC GATES. In studying digital in integrated circuits, one must start with the simples group of circuits, the SSIs or Small Scale Integrated Circuits.
Chapter 2 Guobao Jiang Outline 2.1 Information Storage 2.2 Integer Representations 2.3 Integer Arithmetic 2.4 Floating Point.
Conditions in Java. First…Boolean Operators A boolean data type is always true or false. Boolean operators always return true or false For example: (x.
1 2. Program Construction in Java. 2.4 Selection (decisions)
1 © 2002 John Urrutia. All rights reserved. Qbasic Chapter 4 IF Statements and READ & DATA.
Chapter 51 Decisions Relational and Logical Operators If Blocks Select Case Blocks.
Relational and Boolean Operators CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Copyright 2008 by Pearson Education Building Java Programs Chapter 4 Lecture 4-1: if and if/else Statements reading: 4.2 self-check: #4-5, 7, 10, 11 exercises:
OPERATORS Chapter2:part2. Operators Operators are special symbols used for: mathematical functions assignment statements logical comparisons Examples.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Chapter 1 Real Numbers and Introduction to Algebra.
An Object-Oriented Approach to Programming Logic and Design Chapter 5 Making Decisions.
Squares of Numbers Greater than 20 Return to Table of Contents.
TestScore < 80 testScore * 2 >= < w / (h * h) x + y != 2 * (a + b) 2 * Math.PI * radius
An Introduction to MathCAD More Symbolic Maths And First Steps in Calculus.
NAND, NOR, and EXOR (more primitive logical gates) CS Computer Architecture David Mayer.
Inequality Notation.
4-5 Inequalities (pages ) P6  Represent inequalities on a number line or a coordinate plane.
Relational Operator and Operations
CPS120 Introduction to Computer Science
Boolean Expressions Return or display the Boolean value TRUE or FALSE
Sequence, Selection, Iteration The IF Statement
Comparison Operators Relational Operators.
Introduction To Robot Decision Making
Computers & Programming Languages
Relational Operators Operator Meaning < Less than > Greater than
L1-6 Notes: Algebra: Variables and Expressions
Control Structures: Selection Statement
Computer Science 210 Computer Organization
Introduction to Variables, Algebraic Expressions, and Equations
Chapter 4: Decision Structures and Boolean Logic
Pages:51-59 Section: Control1 : decisions
3-1 Inequalities and their Graphs
Introduction to Predicates and Quantified Statements I
Introduction To Robot Decision Making
3.) Which is greater 4 • or 4(5 - 3)
Computer Science Core Concepts
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Understanding Conditions
Relational Operators.
SIMPLE INEQUALITIES.
Control Structures: Selection Statement
Pages:51-59 Section: Control1 : decisions
Algebra: Variables and Expressions
Symbols, Variables, and Types of Sentences used in Algebra.
3-1 Inequalities and Their Graphs
Chapter 4: Decision Structures and Boolean Logic
boolean Expressions Relational, Equality, and Logical Operators
Conditionals.
Presentation transcript:

PH15720 Laboratory Techniques - An Introduction to MATHCAD

Introduction The if() functionThe if() function Complex NumbersComplex Numbers Symbolic AlgebraSymbolic Algebra

The if() function if(condition,Tval,Fval)if(condition,Tval,Fval) condition evaluatedcondition evaluated –True ( 0) returns Tval –False (=0) returns Fval

Conditional Operators From evaluation paletteFrom evaluation palette –= (bold, logical equals) –= (bold, logical equals) –> greater than –< less than – greater than or equal to – less than or equal to

Boolean Algebra False = 0False = 0 True = 1 (or 0)True = 1 (or 0) Use multiplication for ANDUse multiplication for AND Use addition for ORUse addition for OR (x>5)(x 5)(x<8) –True if x>5 and x 5 and x<8 (x 16)(x 16) –True if x 16

Boolean algebra #2

Magnetic field due to long straight wire #1 Different equations inside and outside conductorDifferent equations inside and outside conductor Inside:Inside: Outside:Outside:

Magnetic Field due to long straight wire #2 Combine two equations using if() functionCombine two equations using if() function Outside Inside Combined with if()

Magnetic Field due to long straight wire #3

Complex Numbers in MathCAD Handled same as other numbersHandled same as other numbers Full range of complex mathsFull range of complex maths Put i (or j) directly after complex numberPut i (or j) directly after complex number Enter i as 1iEnter i as 1i Use |x| to get modulusUse |x| to get modulus Use arg() to get argumentUse arg() to get argument Avoid using i as variable when using complex numbersAvoid using i as variable when using complex numbers

Complex Numbers #1 Basic complex mathsBasic complex maths

Complex Numbers #2 Principle roots foundPrinciple roots found Need to get other roots by hand or by using polyroots()Need to get other roots by hand or by using polyroots()

Symbolic Algebra #1 Manipulate equations rather than numbersManipulate equations rather than numbers Symbolic PaletteSymbolic Palette –Evaluate –Evaluate –Simplify simplify –Simplify simplify –Expand expand, –Expand expand, –Substitute substitute, = –Substitute substitute, = –Solvesolve, –Solvesolve,

Symbolic Algebra #2 Not covered in depth hereNot covered in depth here Handout gives resource centre referencesHandout gives resource centre references Worth a lookWorth a look

The tin can problem #1 From example sheet - solve using mathCADFrom example sheet - solve using mathCAD A manufacturer of tin cans wishes to maximise the volume contained in a can, whilst minimising the amount of metal used to construct the can. Show that, for given amount of metal, the volume of a can is maximised when the radius is half the height.A manufacturer of tin cans wishes to maximise the volume contained in a can, whilst minimising the amount of metal used to construct the can. Show that, for given amount of metal, the volume of a can is maximised when the radius is half the height.

The tin can problem Overview of Solution Assume Area of tin constantAssume Area of tin constant Obtain expression for Volume in terms of Area and radiusObtain expression for Volume in terms of Area and radius Find dVol/drFind dVol/dr dVol/dr will be 0 at max volume so use this to find rdVol/dr will be 0 at max volume so use this to find r Substitute to find r in terms of hSubstitute to find r in terms of h

The tin can problem #2 Need to find when dVol/dr=0Need to find when dVol/dr=0 Write down expressions for Volume & AreaWrite down expressions for Volume & Area Use bold, logical equals signUse bold, logical equals sign

The tin can problem #3 Copy & Paste expression for Area & solve for hCopy & Paste expression for Area & solve for h

The tin can problem #4 Copy & paste expression for VolCopy & paste expression for Vol Substitute expression for hSubstitute expression for h

The tin can problem #5 Use symbolic differentiation to find dVol/drUse symbolic differentiation to find dVol/dr This will be 0 at maximumThis will be 0 at maximum

The tin can problem #6 Solve for dVol/dr = 0 to find rSolve for dVol/dr = 0 to find r 2 solutions, copy +ve2 solutions, copy +ve

The tin can problem #7 Have expression for r in terms of AreaHave expression for r in terms of Area Substitute expression for AreaSubstitute expression for Area Now have expression for r in terms of r and hNow have expression for r in terms of r and h

The tin can problem #8 Take expression for r in terms of r and hTake expression for r in terms of r and h Add r=Add r= Solve for r to get answerSolve for r to get answer

Summary Modelling a discontinuous universe with the if() functionModelling a discontinuous universe with the if() function Complex NumbersComplex Numbers Symbolic AlgebraSymbolic Algebra

Assessment Next WeekNext Week In classIn class Processing experimentalProcessing experimental DataData

Assessment Golden Rules Comment & ExplainComment & Explain Get paper size right (A4)Get paper size right (A4) Layout/Page breaksLayout/Page breaks Use MathCAD 8 formatUse MathCAD 8 format Name/UserID on Header/FooterName/UserID on Header/Footer Attempt everythingAttempt everything