Dynamic-System-Modeling-and-Control

Copyright © 1993-2001, Hugh Jack page 1 Dynamic System Modeling and Control by Hugh Jack (Draft Version 2.6, Decem

Views 312 Downloads 19 File size 5MB

Report DMCA / Copyright

DOWNLOAD FILE

Citation preview

Copyright © 1993-2001, Hugh Jack

page 1

Dynamic System Modeling and Control

by

Hugh Jack

(Draft Version 2.6, December 20, 2004)

© Copyright 1993-2004 Hugh Jack

page 1

PREFACE How to use the book. • read the chapters and do drill problems as you read • examine the case studies - these pull together concepts from previous chapters • problems at the ends of chapters are provided for further practice Tools that should be used include, • graphing calculator that can solve differential equations, such as a TI-85 • computer algebra software that can solve differential equations, such as Scilab Supplemental materials at the end of this book include, • a writing guide • a summary of math topics important for engineers • a table of generally useful engineering units • properties of common materials Acknowledgement to, Dr. Hal Larson for reviewing the calculus and numerical methods chapters Dr. Wendy Reffeor for reviewing the translation chapter Student background a basic circuits course a basic statics and mechanics of materials course math up to differential equations a general knowledge of physics computer programming, preferably in ’C’

Special notes - despite all common wisdom, inertia is presented as a force, this makes it easier for students attempting to learn, and keep sign conventions correct

TO BE DONE small italicize variables and important terms fix equation numbering (auto-numbering?) fix subscripts and superscripts fix problem forms to include therefores, mark FBDs, etc. check C programs for ANSI compliance big verify the phase angle relationships cos vs/ sin.

page 2

chapter rotation replace the rotational case with IC motor chapter non-linear systems develop chapter chapter magnetic consider adding/writing this chapter chapter fluids consider adding/writing this chapter chapter thermal consider adding/writing this chapter chapter c programming review section add problems

Buzzword topics: - Distributed systems - Intelligent manufacturing systems - Adaptive control - Architectures for signal processing and control algorithms - Discrete event systems - Hybrid systems - Predictive control - Robust control

page 1

1.

INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 1.1 1.2 1.3 1.4

2.

2.3 2.4 2.5 2.6 2.7 2.8

INTRODUCTION MODELING 2.2.1 Free Body Diagrams 2.2.2 Mass and Inertia 2.2.3 Gravity and Other Fields 2.2.4 Springs 2.2.5 Damping and Drag 2.2.6 Cables And Pulleys 2.2.7 Friction 2.2.8 Contact Points And Joints SYSTEM EXAMPLES OTHER TOPICS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

2.1 2.3 2.4 2.4 2.8 2.10 2.18 2.21 2.23 2.25 2.25 2.35 2.36 2.36 2.41 2.45

ANALYSIS OF DIFFERENTIAL EQUATIONS . . . . . . . . . . . . 3.1 3.1 3.2 3.3

3.4 3.5

3.6 3.7 3.8 3.9 3.10

4.

1.1 1.3 1.3 1.3

TRANSLATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 2.1 2.2

3.

BASIC TERMINOLOGY EXAMPLE SYSTEM SUMMARY PRACTICE PROBLEMS

INTRODUCTION EXPLICIT SOLUTIONS RESPONSES 3.3.1 First-order 3.3.2 Second-order 3.3.3 Other Responses RESPONSE ANALYSIS NON-LINEAR SYSTEMS 3.5.1 Non-Linear Differential Equations 3.5.2 Non-Linear Equation Terms 3.5.3 Changing Systems CASE STUDY SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

3.1 3.2 3.16 3.17 3.23 3.28 3.31 3.33 3.34 3.38 3.41 3.47 3.51 3.51 3.56 3.61

NUMERICAL ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1

page 2

4.1 4.2 4.3

4.4

DATA

4.5 4.31 4.6

4.7 4.8 4.9 4.10 4.11

5.

ADVANCED TOPICS 4.6.1 Switching Functions 4.6.2 Interpolating Tabular Data 4.6.3 Modeling Functions with Splines 4.6.4 Non-Linear Elements CASE STUDY SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

4.33 4.33 4.36 4.37 4.39 4.39 4.46 4.47 4.50 4.60

ROTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.1 5.1 5.2

5.3 5.4 5.5 5.6 5.7 5.8

6.

INTRODUCTION 4.1 THE GENERAL METHOD 4.1 4.2.1 State Variable Form 4.2 NUMERICAL INTEGRATION 4.10 4.3.1 Numerical Integration With Tools 4.10 4.3.2 Numerical Integration 4.15 4.3.3 Taylor Series 4.21 4.3.4 Runge-Kutta Integration 4.23 SYSTEM RESPONSE 4.29 4.4.1 Steady-State Response 4.30 DIFFERENTIATION AND INTEGRATION OF EXPERIMENTAL

INTRODUCTION MODELING 5.2.1 Inertia 5.2.2 Springs 5.2.3 Damping 5.2.4 Levers 5.2.5 Gears and Belts 5.2.6 Friction 5.2.7 Permanent Magnet Electric Motors OTHER TOPICS DESIGN CASE SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

5.1 5.2 5.3 5.7 5.12 5.14 5.15 5.19 5.22 5.23 5.23 5.28 5.28 5.35 5.44

INPUT-OUTPUT EQUATIONS . . . . . . . . . . . . . . . . . . . . . . . . . 6.1 6.1 6.2 6.3

INTRODUCTION THE DIFFERENTIAL OPERATOR INPUT-OUTPUT EQUATIONS

6.1 6.1 6.4

page 3

6.4 6.5 6.6 6.7 6.8 6.9

7.

6.6 6.9 6.11 6.20 6.20 6.22 6.26 6.27

ELECTRICAL SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7.1 7.1 7.2

7.3 7.4 7.5

7.6 7.7 7.8 7.9 7.10 7.11

8.

6.3.1 Converting Input-Output Equations to State Equations 6.3.2 Integrating Input-Output Equations DESIGN CASE SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSGINMENT PROBLEMS REFERENCES

INTRODUCTION MODELING 7.2.1 Resistors 7.2.2 Voltage and Current Sources 7.2.3 Capacitors 7.2.4 Inductors 7.2.5 Op-Amps IMPEDANCE EXAMPLE SYSTEMS ELECTROMECHANICAL SYSTEMS - MOTORS 7.5.1 Permanent Magnet DC Motors 7.5.2 Induction Motors 7.5.3 Brushless Servo Motors FILTERS OTHER TOPICS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

7.1 7.1 7.2 7.4 7.8 7.10 7.11 7.16 7.18 7.26 7.26 7.28 7.29 7.32 7.33 7.33 7.34 7.38 7.43

FEEDBACK CONTROL SYSTEMS . . . . . . . . . . . . . . . . . . . . . . 8.1 8.1 8.2 8.3

8.4 8.5

INTRODUCTION TRANSFER FUNCTIONS CONTROL SYSTEMS 8.3.1 PID Control Systems 8.3.2 Manipulating Block Diagrams 8.3.3 A Motor Control System Example 8.3.4 System Error 8.3.5 Controller Transfer Functions 8.3.6 Feedforward Controllers 8.3.7 State Equation Based Systems 8.3.8 Cascade Controllers SUMMARY PRACTICE PROBLEMS

8.1 8.1 8.3 8.5 8.7 8.12 8.17 8.21 8.21 8.22 8.24 8.24 8.24

page 4

8.6 8.7

9.

9.1 9.1 9.8 9.10 9.10 9.12 9.14

INTRODUCTION BODE PLOTS SIGNAL SPECTRUMS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS LOG SCALE GRAPH PAPER

10.1 10.5 10.21 10.22 10.22 10.25 10.35 10.36

ROOT LOCUS ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 11.1 11.2 11.3 11.4 11.5 11.6

12.

INTRODUCTION PHASORS FOR STEADY-STATE ANALYSIS VIBRATIONS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

BODE PLOTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10.1 10.1 10.2 10.3 10.4 10.5 10.6 10.7 10.8

11.

8.31 8.37

PHASOR ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.1 9.1 9.2 9.3 9.4 9.5 9.6 9.7

10.

PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

INTRODUCTION ROOT-LOCUS ANALYSIS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

11.1 11.1 11.10 11.11 11.14 11.25

NONLINEAR SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12.1 12.1 12.2 12.3

12.4 12.5

INTRODUCTION SOURCES OF NONLINEARITY 12.2.1 Non-Linear Relationships NON-LINEAR ELEMENTS 12.3.1 Time Variant 12.3.2 Switching 12.3.3 Deadband 12.3.4 Saturation and Clipping 12.3.5 Hysteresis and Slip 12.3.6 Delays and Lags SUMMARY PRACTICE PROBLEMS

12.1 12.1 12.1 12.2 12.3 12.3 12.4 12.7 12.7 12.8 12.9 12.9

page 5

12.6 12.7

13.

12.9 12.9

ANALOG INPUTS AND OUTPUTS . . . . . . . . . . . . . . . . . . . . 13.1 13.1 13.2 13.3 13.4

13.5 13.6 13.7 13.8 13.9

14.

PRACTICE PROBLEM SOLUTIONS ASIGNMENT PROBLEMS

INTRODUCTION ANALOG INPUTS ANALOG OUTPUTS NOISE REDUCTION 13.4.1 Shielding 13.4.2 Grounding CASE STUDY SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

13.1 13.3 13.10 13.12 13.12 13.14 13.15 13.15 13.15 13.15 13.16

CONTINUOUS SENSORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14.1 14.1 14.2

INTRODUCTION 14.1 INDUSTRIAL SENSORS 14.2 14.2.1 Angular Displacement 14.3 Potentiometers 14.3 14.2.2 Encoders 14.4 Tachometers 14.8 14.2.3 Linear Position 14.8 Potentiometers 14.8 Linear Variable Differential Transformers (LVDT)14.9 Moire Fringes 14.11 Accelerometers 14.12 14.2.4 Forces and Moments 14.15 Strain Gages 14.15 Piezoelectric 14.18 14.2.5 Liquids and Gases 14.20 Pressure 14.21 Venturi Valves 14.22 Coriolis Flow Meter 14.23 Magnetic Flow Meter 14.24 Ultrasonic Flow Meter 14.24 Vortex Flow Meter 14.24 Positive Displacement Meters 14.25 Pitot Tubes 14.25 14.2.6 Temperature 14.25 Resistive Temperature Detectors (RTDs) 14.26 Thermocouples 14.26 Thermistors 14.28 Other Sensors 14.30

page 6

14.2.7

14.3 14.4 14.5 14.6 14.7 14.8 14.9

15.

Light Dependant Resistors (LDR) 14.2.8 Chemical pH Conductivity 14.2.9 Others INPUT ISSUES SENSOR GLOSSARY SUMMARY REFERENCES PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

14.30 14.30 14.31 14.31 14.31 14.32 14.32 14.37 14.38 14.39 14.39 14.40 14.42

CONTINUOUS ACTUATORS . . . . . . . . . . . . . . . . . . . . . . . . . 15.1 15.1 15.2

15.3 15.4 15.5 15.6 15.7 15.8

16.

Light

INTRODUCTION ELECTRIC MOTORS 15.2.1 Basic Brushed DC Motors 15.2.2 AC Motors 15.2.3 Brushless DC Motors 15.2.4 Stepper Motors 15.2.5 Wound Field Motors HYDRAULICS OTHER SYSTEMS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

15.1 15.1 15.3 15.7 15.15 15.17 15.19 15.23 15.24 15.25 15.25 15.26 15.26

MOTION CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16.1 16.1 16.2

16.3

16.4 16.5 16.6 16.7 16.8 16.9

INTRODUCTION MOTION PROFILES 16.2.1 Velocity Profiles 16.2.2 Position Profiles MULTI AXIS MOTION 16.3.1 Slew Motion Interpolated Motion 16.3.2 Motion Scheduling PATH PLANNING CASE STUDIES SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

16.1 16.2 16.2 16.11 16.14 16.15 16.16 16.17 16.19 16.21 16.23 16.23 16.24 16.25

page 7

17.

LAPLACE TRANSFORMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17.1 17.1 17.2 17.3 17.4 17.5 17.6

17.7

17.8 17.9 17.10 17.11 17.12 17.13

18.

INTRODUCTION APPLYING LAPLACE TRANSFORMS 17.2.1 A Few Transform Tables MODELING TRANSFER FUNCTIONS IN THE s-DOMAIN FINDING OUTPUT EQUATIONS INVERSE TRANSFORMS AND PARTIAL FRACTIONS EXAMPLES 17.6.1 Mass-Spring-Damper Vibration 17.6.2 Circuits ADVANCED TOPICS 17.7.1 Input Functions 17.7.2 Initial and Final Value Theorems A MAP OF TECHNIQUES FOR LAPLACE ANALYSIS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS REFERENCES

17.1 17.3 17.4 17.9 17.11 17.14 17.21 17.21 17.23 17.25 17.25 17.26 17.27 17.28 17.28 17.31 17.35 17.37

CONTROL SYSTEM ANALYSIS . . . . . . . . . . . . . . . . . . . . . . 18.1 18.1 18.2

INTRODUCTION 18.1 CONTROL SYSTEMS 18.1 18.2.1 PID Control Systems 18.3 18.2.2 Analysis of PID Controlled Systems With Laplace Transforms

18.5

18.3 18.4 18.5 18.6 18.7 18.8

19.

18.2.3 Finding The System Response To An Input 18.2.4 Controller Transfer Functions ROOT-LOCUS PLOTS 18.3.1 Approximate Plotting Techniques DESIGN OF CONTINUOUS CONTROLLERS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

18.8 18.13 18.13 18.17 18.21 18.21 18.22 18.27 18.27

CONVOLUTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19.1 19.1 19.2 19.3 19.4 19.5 19.6

INTRODUCTION UNIT IMPULSE FUNCTIONS IMPULSE RESPONSE CONVOLUTION NUMERICAL CONVOLUTION LAPLACE IMPULSE FUNCTIONS

19.1 19.1 19.3 19.5 19.6 19.9

page 8

19.7 19.8 19.9 19.10

20.

21.9 21.10 21.11 21.12 21.13 21.14

20.1 20.13 20.15 20.18 20.18 20.19 20.19 20.19 20.19

INTRODUCTION 21.1 FULL STATE FEEDBACK 21.2 OBSERVERS 21.5 SUPPLEMENTAL OBSERVERS 21.11 REGULATED CONTROL WITH OBSERVERS 21.11 LQR 21.22 LINEAR QUADRATIC GAUSSIAN (LQG) COMPENSATORS 21.24 VERIFYING CONTROL SYSTEM STABILITY 21.24 21.8.1 Stability 21.25 21.8.2 Bounded Gain 21.26 ADAPTIVE CONTROLLERS 21.28 OTHER METHODS 21.31 21.10.1 Kalman Filtering 21.32 SUMMARY 21.32 PRACTICE PROBLEMS 21.33 PRACTICE PROBLEM SOLUTIONS 21.33 ASSIGNMENT PROBLEMS 21.33

SYSTEM IDENTIFICATION . . . . . . . . . . . . . . . . . . . . . . . . . . 22.1 22.1 22.2 22.3 22.4 22.5

23.

INTRODUCTION OBSERVABILITY CONTROLLABILITY OBSERVERS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS BIBLIOGRAPHY

STATE SPACE CONTROLLERS . . . . . . . . . . . . . . . . . . . . . . . 21.1 21.1 21.2 21.3 21.4 21.5 21.6 21.7 21.8

22.

19.10 19.10 19.10 19.10

STATE SPACE ANALYSIS . . . . . . . . . . . . . . . . . . . . . . . . . . . 20.1 20.1 20.2 20.3 20.4 20.5 20.6 20.7 20.8 20.9

21.

SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

INTRODUCTION SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

22.1 22.10 22.10 22.10 22.10

ELECTROMECHANICAL SYSTEMS . . . . . . . . . . . . . . . . . . . 23.1

page 9

23.1 23.2 23.3 23.4 23.5 23.6 23.7

24.

24.3 24.4 24.5 24.6 24.7

SUMMARY MATHEMATICAL PROPERTIES 24.2.1 Resistance 24.2.2 Capacitance 24.2.3 Power Sources EXAMPLE SYSTEMS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEMS SOLUTIONS ASSIGNMENT PROBLEMS

24.1 24.1 24.2 24.4 24.6 24.8 24.10 24.10 24.10 24.10

THERMAL SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25.1 25.1 25.2

25.3 25.4 25.5 25.6 25.7

26.

23.1 23.1 23.1 23.9 23.16 23.16 23.16 23.16

FLUID SYSTEMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24.1 24.1 24.2

25.

INTRODUCTION MATHEMATICAL PROPERTIES 23.2.1 Induction EXAMPLE SYSTEMS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

INTRODUCTION MATHEMATICAL PROPERTIES 25.2.1 Resistance 25.2.2 Capacitance 25.2.3 Sources EXAMPLE SYSTEMS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

25.1 25.1 25.1 25.3 25.4 25.4 25.7 25.7 25.7 25.7

OPTIMIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26.1 26.1 26.2 26.3 26.4

26.5 26.6 26.7

INTRODUCTION OBJECTIVES AND CONSTRAINTS SEARCHING FOR THE OPTIMUM OPTIMIZATION ALGORITHMS 26.4.1 Random Walk 26.4.2 Gradient Decent 26.4.3 Simplex SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS

26.1 26.2 26.6 26.9 26.9 26.10 26.10 26.10 26.10 26.10

page 10

26.8

27.

INTRODUCTION COMMERCIAL CONTROLLERS REFERENCES SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

28.1 28.7 28.7 28.7 28.8 28.8 28.8

SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS REFERENCES

29.9 29.10 29.10 29.10 29.10

EMBEDDED CONTROL SYSTEM . . . . . . . . . . . . . . . . . . . . . 30.1 30.1 30.2 30.3 30.4 30.5 30.6

31.

27.1 27.2 27.4 27.12 27.13 27.13 27.13 27.13

NEURAL NETWORKS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29.1 29.1 29.2 29.3 29.4 29.5

30.

INTRODUCTION FINITE ELEMENT MODELS FINITE ELEMENT MODELS SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS BIBLIOGRAPHY

FUZZY LOGIC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28.1 28.1 28.2 28.3 28.4 28.5 28.6 28.7

29.

26.10

FINITE ELEMENT ANALYSIS (FEA) . . . . . . . . . . . . . . . . . . . 27.1 27.1 27.2 27.3 27.4 27.5 27.6 27.7 27.8

28.

ASSIGNMENT PROBLEMS

INTRODUCTION CASE STUDY SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSIGNMENT PROBLEMS

30.1 30.3 30.3 30.3 30.3 30.3

WRITING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1 31.1 31.2 31.3 31.4 31.5

FORGET WHAT YOU WERE TAUGHT BEFORE WHY WRITE REPORTS? THE TECHNICAL DEPTH OF THE REPORT TYPES OF REPORTS LABORATORY REPORTS An Example First Draft of a Report

31.1 31.2 31.3 31.3 31.3 31.5

page 11

31.6 31.7 31.8 31.9

31.10 31.11

31.12 31.13 31.14 31.15 31.16

32.

An Example Final Draft of a Report RESEARCH DRAFT REPORTS PROJECT REPORT OTHER REPORT TYPES 31.9.1 Executive 31.9.2 Consulting 31.9.3 Memo(randum) 31.9.4 Interim 31.9.5 Poster 31.9.6 Progress Report 31.9.7 Oral 31.9.8 Patent LAB BOOKS REPORT ELEMENTS 31.11.1 Figures 31.11.2 Graphs 31.11.3 Tables 31.11.4 Equations 31.11.5 Experimental Data 31.11.6 Result Summary 31.11.7 References 31.11.8 Acknowledgments 31.11.9 Abstracts 31.11.10 Appendices 31.11.11 Page Numbering 31.11.12 Numbers and Units 31.11.13 Engineering Drawings 31.11.14 Discussions 31.11.15 Conclusions 31.11.16 Recomendations 31.11.17 Appendices 31.11.18 Units GENERAL WRITING ISSUES WRITERS BLOCK TECHNICAL ENGLISH EVALUATION FORMS PATENTS

31.11 31.11 31.11 31.12 31.13 31.13 31.13 31.13 31.14 31.14 31.14 31.15 31.15 31.16 31.16 31.17 31.18 31.19 31.19 31.20 31.21 31.21 31.21 31.22 31.22 31.23 31.23 31.23 31.24 31.24 31.24 31.25 31.25 31.25 31.26 31.26 31.29 31.31

PROJECTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.1 32.1 32.2 32.3

OVERVIEW 32.2.1 The Objectives and Constraints MANAGEMENT 32.3.1 Timeline - Tentative

32.1 32.1 32.2 32.3 32.3

page 12

32.4

32.5

32.6

33.

32.4 32.5 32.5 32.5 32.6 32.6 32.7 32.8 32.8 32.9 32.9 32.10 32.10 32.10 32.18 32.19

ENGINEERING PROBLEM SOLVING . . . . . . . . . . . . . . . . . . 33.1 33.1 33.2 33.3

33.4 33.5

34.

32.3.2 Teams DELIVERABLES 32.4.1 Conceptual Design 32.4.2 EGR 345/101 Contract 32.4.3 Progress Reports 32.4.4 Design Proposal 32.4.5 The Final Report REPORT ELEMENTS 32.5.1 Gantt Charts 32.5.2 Drawings 32.5.3 Budgets and Bills of Material 32.5.4 Calculations APPENDICES 32.6.1 Appendix A - Sample System 32.6.2 Appendix B - EGR 345/101 Contract 32.6.3 Appendix C - Forms

BASIC RULES OF STYLE EXPECTED ELEMENTS SEPCIAL ELEMENTS 33.3.1 Graphs 33.3.2 EGR 345 Specific SCILAB TERMINOLOGY

33.1 33.1 33.2 33.2 33.2 33.2 33.3

MATHEMATICAL TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34.1 34.1

34.2

34.3

INTRODUCTION 34.1.1 Constants and Other Stuff 34.1.2 Basic Operations Factorial 34.1.3 Exponents and Logarithms 34.1.4 Polynomial Expansions 34.1.5 Practice Problems FUNCTIONS 34.2.1 Discrete and Continuous Probability Distributions 34.2.2 Basic Polynomials 34.2.3 Partial Fractions 34.2.4 Summation and Series 34.2.5 Practice Problems SPATIAL RELATIONSHIPS 34.3.1 Trigonometry 34.3.2 Hyperbolic Functions Practice Problems 34.3.3 Geometry

34.1 34.2 34.3 34.4 34.4 34.5 34.6 34.9 34.9 34.9 34.11 34.14 34.16 34.17 34.17 34.22 34.23 34.24

page 13

34.4

34.5

34.6

34.7

34.3.4 Planes, Lines, etc. 34.41 34.3.5 Practice Problems 34.43 COORDINATE SYSTEMS 34.45 34.4.1 Complex Numbers 34.45 34.4.2 Cylindrical Coordinates 34.48 34.4.3 Spherical Coordinates 34.49 34.4.4 Practice Problems 34.50 MATRICES AND VECTORS 34.51 34.5.1 Vectors 34.51 34.5.2 Dot (Scalar) Product 34.52 34.5.3 Cross Product 34.57 34.5.4 Triple Product 34.59 34.5.5 Matrices 34.59 34.5.6 Solving Linear Equations with Matrices 34.64 34.5.7 Practice Problems 34.65 CALCULUS 34.70 34.6.1 Single Variable Functions 34.70 Differentiation 34.70 Integration 34.73 34.6.2 Vector Calculus 34.77 34.6.3 Differential Equations 34.79 First-order Differential Equations 34.80 Guessing 34.81 Separable Equations 34.81 Homogeneous Equations and Substitution 34.82 Second-order Differential Equations 34.83 Linear Homogeneous 34.83 Nonhomogeneous Linear Equations 34.84 Higher Order Differential Equations 34.86 Partial Differential Equations 34.86 34.6.4 Other Calculus Stuff 34.87 34.6.5 Practice Problems 34.87 NUMERICAL METHODS 34.93 34.7.1 Approximation of Integrals and Derivatives from Sampled Data

34.93

34.8 34.9 34.10 34.11 34.12

34.7.2 Euler First-order Integration 34.7.3 Taylor Series Integration 34.7.4 Runge-Kutta Integration 34.7.5 Newton-Raphson to Find Roots LAPLACE TRANSFORMS 34.8.1 Laplace Transform Tables z-TRANSFORMS FOURIER SERIES TOPICS NOT COVERED (YET) REFERENCES/BIBLIOGRAPHY

34.94 34.94 34.95 34.95 34.96 34.96 34.99 34.102 34.102 34.103

page 14

35.

A BASIC INTRODUCTION TO ‘C’ . . . . . . . . . . . . . . . . . . . . . 35.1 35.1 35.2 35.3 35.4 35.5 35.6

35.7 35.8

35.9

36.

WHY USE ‘C’? BACKGROUND PROGRAM PARTS HOW A ‘C’ COMPILER WORKS STRUCTURED ‘C’ CODE ARCHITECTURE OF ‘C’ PROGRAMS (TOP-DOWN) 35.6.1 How? 35.6.2 Why? CREATING TOP DOWN PROGRAMS HOW THE BEAMCAD PROGRAM WAS DESIGNED 35.8.1 Objectives: 35.8.2 Problem Definition: 35.8.3 User Interface: Screen Layout (also see figure): Input: Output: Help: Error Checking: Miscellaneous: 35.8.4 Flow Program: 35.8.5 Expand Program: 35.8.6 Testing and Debugging: 35.8.7 Documentation Users Manual: Programmers Manual: 35.8.8 Listing of BeamCAD Program. PRACTICE PROBLEMS

35.1 35.2 35.2 35.11 35.13 35.14 35.14 35.15 35.16 35.17 35.18 35.18 35.18 35.18 35.19 35.20 35.20 35.20 35.21 35.22 35.22 35.24 35.25 35.25 35.26 35.26 35.26

UNITS AND CONVERSIONS . . . . . . . . . . . . . . . . . . . . . . . . . 36.1 36.1 36.2 36.3 36.4 36.5

HOW TO USE UNITS HOW TO USE SI UNITS THE TABLE ASCII, HEX, BINARY CONVERSION G-CODES

36.1 36.2 36.2 36.6 36.8

37.

ATOMIC MATERIAL DATA . . . . . . . . . . . . . . . . . . . . . . . . . . 37.1

37.

MECHANICAL MATERIAL PROPERTIES . . . . . . . . . . . . . . 37.1 37.1

38.

FORMULA SHEET

37.4

BIBLIOGRAPHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38.1 38.1

TEXTBOOKS 38.1.1 Slotine and Li

38.1 38.1

page 15

38.1.2

39.

VandeVegte

38.1

TOPICS IN DEVELOPMENT . . . . . . . . . . . . . . . . . . . . . . . . . . 39.1 39.1 39.2 39.3 39.4 39.5 39.6 39.7 39.8 39.9 39.10 39.11 39.12 39.13 39.14 39.15 39.16 39.17 39.18 39.19 39.20 39.21 39.22 39.23 39.24 39.25 39.26

UPDATED DC MOTOR MODEL ANOTHER DC MOTOR MODEL BLOCK DIAGRAMS AND UNITS SIGNAL FLOW GRAPHS ZERO ORDER HOLD TORSIONAL DAMPERS MISC Nyquist Plot NICHOLS CHART BESSEL POLYNOMIALS ITAE ROOT LOCUS LYAPUNOV’S LINEARIZATION METHOD XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX XXXXX SUMMARY PRACTICE PROBLEMS PRACTICE PROBLEM SOLUTIONS ASSGINMENT PROBLEMS REFERENCES BIBLIOGRAPHY

39.1 39.4 39.8 39.9 39.9 39.9 39.10 39.10 39.12 39.14 39.15 39.16 39.16 39.17 39.18 39.18 39.18 39.18 39.18 39.18 39.18 39.18 39.19 39.19 39.19 39.19

introduction - 1.1

1. INTRODUCTION

Topics:

Objectives:

1.1 BASIC TERMINOLOGY • Modeling • Explicit solutions • Numerical solutions • Empirical data • Simulation • Lumped parameter (masses and springs) • Distributed parameters (stress in a solid) • Continuous vs. Discrete • Linear vs. Non-linear

introduction - 1.2

• linearity and superposition • reversibility • through and across variables • Analog vs. Digital • process vs. controllers • Basic system categories below,

Static Dynamic

Stochastic Deterministic

Figure 1.1

Distributed Lumped

Model Classifications

Non-linear Linear Continuous Discrete

introduction - 1.3

• control system types: servo vs. regulating/process control • open loop vs. closed loop • disturbances • component variations • system error • analysis vs. design • mechatronics • embedded systems • real-time systems •

1.2 EXAMPLE SYSTEM • Servo control systems • Robot

1.3 SUMMARY •

1.4 PRACTICE PROBLEMS 1.

translation - 2.1

2. TRANSLATION

Topics: • Basic laws of motion • Gravity, inertia, springs, dampers, cables and pulleys, drag, friction, FBDs • System analysis techniques • Design case Objectives: • To be able to develop differential equations that describe translating systems.

2.1 INTRODUCTION If the velocity and acceleration of a body are both zero then the body will be static. If the applied forces are balanced, and cancel each other out, the body will not accelerate. If the forces are unbalanced then the body will accelerate. If all of the forces act through the center of mass then the body will only translate. Forces that do not act through the center of mass will also cause rotation to occur. This chapter will focus only on translational systems. The equations of motion for translating bodies are shown in Figure 2.1. These state simply that velocity is the first derivative of position, and velocity is the first derivative of acceleration. Conversely the acceleration can be integrated to find velocity, and the velocity can be integrated to find position. Therefore, if we know the acceleration of a body, we can determine the velocity and position. Finally, when a force is applied to a mass, an acceleration can be found by dividing the net force by the mass.

translation - 2.2

x,v,a

F

equations of motion d v ( t ) =  ----- x ( t )  dt d 2 d a ( t ) =  ----- x ( t ) =  ----- v ( t ) dt dt OR x ( t ) = ∫ v ( t ) dt = ∫ ∫ a ( t ) dt v(t) =

∫ a ( t ) dt

(1) (2) (3) (4)

( t )(5) a(t) = F --------M where, x, v, a = position, velocity and acceleration M = mass of the body F = an applied force

Figure 2.1

Velocity and acceleration of a translating mass

An example application of these fundamental laws is shown in Figure 2.2. The initial conditions of the system are supplied (and are normally required to solve this type of problem). These are then used to find the state of the system after a period of time. The solution begins by integrating the acceleration, and using the initial velocity value for the integration constant. So at t=0 the velocity will be equal to the initial velocity. This is then integrated once more to provide the position of the object. As before, the initial position is used for the integration constant. This equation is then used to calculate the position after a period of time. Notice that the units are used throughout the calculations, this is a good practice for any engineer.

translation - 2.3

Given an initial (t=0) state of x=5m, v=2m/s, a=3ms-2, find the system state 5 seconds later assuming constant acceleration. The initial conditions for the system at time t=0 are, x 0 = 5m Note: units are very important and should nor–1 v 0 = 2ms mally be carried through all calculations. –2 a 0 = 3ms The constant acceleration can be integrated to find the velocity as a function of time. Note: v ( t ) = ∫ a 0 dt = a 0 t + C = a 0 t + v 0 (6) v ( t ) = a0 t + C v0 = a0 ( 0 ) + C v0 = C

Next, the velocity can be integrated to find the position as a function of time. a 2 (7) x ( t ) = ∫ v ( t ) dt = ∫ ( a 0 t + v 0 ) dt = -----0- t + v 0 t + x 0 2 This can then be used to calculate the position of the mass after 5 seconds. a 2 x ( 5 ) = -----0- t + v 0 t + x 0 2 –2 2 –1 3ms = ---------------- ( 5s ) + 2ms ( 5s ) + 5m 2 = 37.5m + 10m + 5m = 52.5m

Figure 2.2

Sample calculation for a translating mass, with initial conditions

2.2 MODELING When modeling translational systems it is common to break the system into parts. These parts are then described with Free Body Diagrams (FBDs). Common components that must be considered when constructing FBDs are listed below, and are discussed in following sections. • gravity and other fields - apply non-contact forces • inertia - opposes acceleration and deceleration • springs - resist deflection • dampers and drag - resist motion • friction - opposes relative motion between bodies in contact

translation - 2.4

• cables and pulleys - redirect forces • contact points/joints - transmit forces through up to 3 degrees of freedom

2.2.1 Free Body Diagrams Free Body Diagrams (FBDs) allow us to reduce a complex mechanical system into smaller, more manageable pieces. The forces applied to the FBD can then be summed to provide an equation for the piece. These equations can then be used later to do an analysis of system behavior. These are required elements for any engineering problem involving rigid bodies. An example of FBD construction is shown in Figure 2.3. In this case there is a mass sitting atop a spring. An FBD can be drawn for the mass. In total there are two obvious forces applied to the mass, gravity pulling the mass downward, and a spring pushing the mass upwards. The FBD for the spring has two forces applied at either end. Notice that the spring force, FR1, acting on the mass, and on the spring have an equal magnitude, but opposite direction.

M = 10 kg

FBD Spring:

FBD Mass:

K = 20 N/m

FR1 FR1

Mg FR2

Figure 2.3

Free body diagram example

2.2.2 Mass and Inertia In a static system the sum of forces is zero and nothing is in motion. In a dynamic system the sum of forces is not zero and the masses accelerate. The resulting imbalance in forces acts on the mass causing it to accelerate. For the purposes of calculation we create a virtual reaction force, called the inertial force. This force is also known as D’Alembert’s (pronounced as daa-lamb-bears) force. It can be included in calculations in one of two ways. The first is to add the inertial force to the FBD and then add it into the sum of

translation - 2.5

forces, which will equal zero. The second method is known as D’Alembert’s equation where all of the forces are summed and set equal to the inertial force, as shown in Figure 2.4. The acceleration is proportional to the inertial force and inversely proportional to the mass.

∑ F = Ma ∑ F – Ma = Figure 2.4

0

(Newton’s)

(11)

(D’Alembert’s)

(12)

D’Alembert’s and Newton’s equations

An application of Newton’s equation to FBDs can be seen in Figure 2.5. In the first case an inertial force is added to the FBD. This force should be in an opposite direction (left here) to the positive direction of the mass (right). When the sum of forces equation is used then the force is added in as a normal force component. In the second case Newton’s equation is used so the force is left off the FBD, but added to the final equation. In this case the sign of the inertial force is positive if the assumed positive direction of the mass matches the positive direction for the summation.

translation - 2.6

x

D’Alemberts’s form: d 2 Ma = M  ----- x dt

d- 2  ---F = F – M ∑ x  dt x = 0 or d- 2  ---+ F = – F + M ∑ x  dt x = 0 +

F

M

Note: If using an inertial force then the direction of the force should be opposite to the positive motion direction for the mass. x

Newton’s form:

M

d- 2  ---F = F = M + ∑ x  dt x

F or

+

d- 2  ---F = – F = – M ∑ x  dt x

Note: If using Newton’s form the sign of the inertial force should be positive if the positive direction for the summation and the mass are the same, otherwise if they are opposite then the sign should be negative.

Figure 2.5

Free body diagram and inertial forces

An example of the application of Newton’s equation is shown in Figure 2.6. In this example there are two unbalanced forces applied to a mass. These forces are summed and set equal to the inertial force. Solving the resulting equation results in acceleration values in the ’x’ and ’y’ directions. In this example the forces and calculations are done in vector form for convenience and brevity.

translation - 2.7

5 F 1 = –4 N 0 If both forces shown act through the center of mass, what is the acceleration of the ball?

∑F

–7 F2 = –3 N 0

M=10kg

= F 1 + F 2 = Ma

5 –7 N + –4 – 3 N = ( 10Kg )a 0 0 –2 – 0.2 – 0.2 1 Kgm 1 m     - ------- = – 0.7 ---∴a =  ------------- – 7 N = – 0.7  ----------2 2  10Kg Kg s s 0 0 0

Figure 2.6

Sample acceleration calculation

// A program to sum forces and calculate the acceleration // define the given forces and mass F1 = [5, -4, 0]; F2 = [-7, -3, 0]; M = 10; function foo=Sum() // The sum of the applied forces foo = F1 + F2; endfunction A = Sum() / M; printf("The acceleration is ( %f, %f, %f) m/s^2 \n", A(1), A(2), A(3)); printf("The magnitude is |A| = %f m/s^2 \n", norm(A));

Figure 2.7

A Scilab calculation example

translation - 2.8

2.2.3 Gravity and Other Fields Gravity is a weak force of attraction between masses. In our situation we are in the proximity of a large mass (the earth) which produces a large force of attraction. When analyzing forces acting on rigid bodies we add this force to our FBDs. The magnitude of the force is proportional to the mass of the object, with a direction toward the center of the earth (down). The relationship between mass and force is clear in the metric system with mass having the units Kilograms (kg), and force the units Newtons (N). The relationship between these is the gravitational constant 9.81N/kg, which will vary slightly over the surface of the earth. The Imperial units for force and mass are both the pound (lb.) which often causes confusion. To reduce this confusion the unit for force is normally modified to be, lbf. An example calculation including gravitational acceleration is shown in Figure 2.8. The 5kg mass is pulled by two forces, gravity and the arbitrary force ’F’. These forces are described in vector form, with the positive ’z’ axis pointing upwards. To find the equations of motion the forces are summed. To eliminate the second derivative on the inertia term the equation is integrated twice. The result is a set of three vector equations that describe the x, y and z components of the motion. Notice that the units have been carried through these calculations.

translation - 2.9

Assume we have a mass that is acted upon by gravity and a second constant force vector. To find the position of the mass as a function of time we first define the gravity vector and position components for the system.

0 0 N- = g = -----0 Kg 0 – 9.81 – 9.81

m---2 s

x(t) X( t) = y(t) z( t)

F

M = 5Kg Fg

g

fx F = f y fz

F g = Mg

Next, sum the forces and set them equal to inertial resistance. d- 2  ---F = Mg + F = M ∑  dt X ( t ) fx 0 x(t) d 2 m5Kg 0 ---+ f = 5Kg  ----- y ( t ) y dt 2 – 9.81 s z(t) fz fx 0 x( t) –1 d- 2 m  ---fy =   y ( t ) 0 ----2- + 0.2Kg dt z(t) – 9.81 s fz Integrate twice to find the position components. Note: When an engineer solves a problem they vx fx 0 will always be looking 0 x(t) –1 d m at the equations and   f y t + v y =  ----- y ( t ) 0 ----2- + 0.2Kg dt unknowns. In this case 0 – 9.81 s z ( t ) there are three equafz vz tions, and there are 9 0 vx constants/givens fx, fy, fx x0 0 0 x ( t ) fz, vx0, vy0, xz0, x0, y0 2 1--m- + 0.2Kg – 1 ---fy t + vy t + y0 = y ( t ) 0 and z0. There are 4 2 2 0 s variables/unknowns x, – 9.81 z(t) fz z0 vz y, z and t. Therefore 2 0.1f x t + v x t + x 0 0 with 3 equations and 4 0 unknowns only one x(t) 2 value (4-3) is required m 0.1f y t + v y t + y 0 y(t) = to find all of the 0 z(t ) unknown values. 9.81- + 0.1f  t 2 + v t + z  –-----------z z0 0  2 Figure 2.8

Gravity vector calculations

translation - 2.10

Like gravity, magnetic and electrostatic fields can also apply forces to objects. Magnetic forces are commonly found in motors and other electrical actuators. Electrostatic forces are less common, but may need to be considered for highly charged systems.

Given, 3 F1 = 4 N 0

0 Ng = – 9.81 -----Kg 0

FBD: M = 2Kg

Find the acceleration.

F1

M

g

ans. 1.5 a = – 7.81 m ---s 0

Figure 2.9

Drill problem: find the acceleration of the FBD

2.2.4 Springs Springs are typically constructed with elastic materials such as metals and plastics, that will provide an opposing force when deformed. The properties of the spring are determined by the Young’s modulus (E) of the material and the geometry of the spring. A primitive spring is shown in Figure 2.10. In this case the spring is a solid member. The relationship between force and displacement is determined by the basic mechanics of materials relationship. In practice springs are more complex, but the parameters (E, A and L) are combined into a more convenient form. This form is known as Hooke’s Law.

translation - 2.11

L δ =  ------- F EA

F

EA F =  ------- δ  L F = Kδ

Figure 2.10

δ

L

(Hooke’s law)

A solid member as a spring

Hooke’s law does have some limitations that engineers must consider. The basic equation is linear, but as a spring is deformed the material approaches plastic deformation, and the modulus of elasticity will change. In addition the geometry of the object changes, also changing the effective stiffness. Springs are normally assumed to be massless. This allows the inertial effects to be ignored, such as a force propagation delay. In applications with fast rates of change the spring mass may become significant, and they will no longer act as an ideal device. The cases for tension and compression are shown in Figure 2.11. In the case of compression the spring length has been made shorter than its’ normal length. This requires that a compression force be applied. For tension, both the displacement from neutral and the required force reverse direction. It is advisable when solving problems to assume a spring is either in tension or compression, and then select the displacement and force directions accordingly.

translation - 2.12

∆ x = deformed length

compression as positive:

ASIDE: a spring has a natural or undeformed length. When at this length it is neither in tension or compression

∆x

Fc

Ks

∆x

Fc

Ks

F c = –K s ∆ x

∆x

Fc

Ks tension as positive:

Fc = Ks ∆ x

F c = –K s ∆ x

Ks

Ft

Ft = Ks ∆ x

∆x Ks

Ft

Ft = –Ks ∆ x

∆x Ks

Ft

∆x

Ft = –Ks ∆ x

NOTE: the symbols for springs, resistors and inductors are quite often the same or similar. You will need to remember this when dealing with complex systems - and especially in this book where we deal with both types of components.

Figure 2.11

Sign conventions for spring forces and displacements

Previous examples have shown springs with displacements at one end only. In Figure 2.12, springs are shown that have movement at both ends. In these cases the sign of the force applied to the spring is selected with reference to the assumed compression or tension. The primary difference is that care is required to correctly construct the expressions for the tension or compression forces. In all cases the forces on the springs must be assumed and drawn as either tensile or compressive. In the first example the displacement and forces are tensile. The displacement at the left is tensile, so it will be positive, but on the right hand side the displacement is compressive so it is negative. In the second exam-

translation - 2.13

ple the force and both displacements are shown as tensile, so the terms are both positive. In the third example the force is shown as compressive, while the displacements are both shown as tensile, so both terms are negative.

F

F

F

∆x1

∆x1

∆x1

Ks

Ks

Ks

∆ x2

∆ x2

∆ x2

F

F = Ks ( ∆ x1 – ∆ x 2 )

F

F = Ks ( ∆ x 1 + ∆ x 2 )

F

F = Ks ( – ∆ x1 – ∆ x2 )

Aside: it is useful to assume that the spring is either in tension or compression, and then make all decisions based on that assumption.

Figure 2.12

Examples of forces when both sides of a spring can move

The example in Figure 2.13 shows two masses separated by a spring. In the first example the spring is assumed to be in tension. When x1 becomes positive it will put the spring in compression, so it is made negative, however a positive x2 will put the spring in tension, so it remains positive. In the second case the spring is assumed to be in compression and this time x2 will put it in tension so it is made negative.

translation - 2.14

Consider the two masses below separated by a spring. Ks M1

M2 x1

x2

The system can be reduced to free body diagrams assuming the spring is tension.

Ks ( – x1 + x2 )

M1

M2

x1

x2

Note: In this example the spring is assumed to be in tension and the signs of the magnitude are made negative for terms that result in compression for positive changes. The system can be reduced to free body diagrams assuming the spring is in compression.

Ks ( x1 – x2 )

M1 x1

Figure 2.13

M2 x2

Drawing FBDs with interconnecting springs

Sometimes the true length of a spring is important, and the deformation alone is insufficient. In these cases the deformation can be defined as a deformed and undeformed length, as shown in Figure 2.14.

translation - 2.15

∆ x = l1 – l 0 where,

∆ x = deformation l 0 = the length when undeformed l 1 = the length when deformed

Figure 2.14

Using the actual spring length

In addition to providing forces, springs may be used as energy storage devices. Figure 2.15 shows the equation for energy stored in a spring.

2

K ( ∆x ) E P = -----------------2

Figure 2.15

Energy stored in a spring

translation - 2.16

Given, Ks

NK s = 10 --m

Ks

∆ x = 0.1m

F

∆x Find F assuming the springs are normally 4m long when unloaded

10m

Aside: it can help to draw a FBD of the pin.

ans. F=2N

Figure 2.16

Drill problem: Deformation of a two spring system

translation - 2.17

Draw the FBDs and the equations of motion for the masses F

Ks M1

M2 x1

x2

ans. ·· x1 ( M1 ) + x1 ( Ks ) + x2 ( –Ks ) = F ·· x 1 ( K s ) + x2 ( –M2 ) + x2 ( – K s ) = F

Figure 2.17

Drill problem: Draw the FBDs for the masses

translation - 2.18

2.2.5 Damping and Drag A damper is a component that resists motion. The resistive force is relative to the rate of displacement. As mentioned before, springs store energy in a system but dampers dissipate energy. Dampers and springs are often used to compliment each other in designs. Damping can occur naturally in a system, or can be added by design. The physical damper pictured in Figure 2.18 uses a cylinder that contains a fluid. There is a moving rod and piston that can slide within the cylinder. As the piston moves, fluid is forced through a small orifice. When moved slowly the fluid moves easily, but when moved quickly the pressure required to force the fluid through the orifice rises. This rise in pressure results in a higher force of resistance. In ideal terms any motion would result in an opposing force. In reality there is also a break-away force that needs to be applied before motion begins. Other manufacturing variations could also lead to other small differences between dampers. Normally these cause negligible effects.

orifice motion fluid

Figure 2.18

piston

fluid

A physical damper

The basic equation for an ideal damper in compression is shown in Figure 2.19. In this case the force and displacement are both compressive. The force is calculated by multiplying the damping coefficient by the velocity, or first derivative of position. Aside from the use of the first derivative of position, the analysis of dampers in systems is similar to that of springs.

translation - 2.19

x Kd

d F = K d  ----- x dt

F

(15)

Aside: The symbol shown is typically used for dampers. It is based on an old damper design called a dashpot. It was constructed using a small piston inside a larger pot filled with oil.

Figure 2.19

An ideal damper

Damping can also occur when there is relative motion between two objects. If the objects are lubricated with a viscous fluid (e.g., oil) then there will be a damping effect. In the example in Figure 2.20 two objects are shown with viscous friction (damping) between them. When the system is broken into free body diagrams the forces are shown to be a function of the relative velocities between the blocks.

x1

· · Fd = Kd ( x1 – x2 ) Kd

· · Fd = Kd ( x1 – x2 )

x2

Aside: Fluids, such as oils, have a significant viscosity. When these materials are put in shear they resist the motion. The higher the shear rate, the greater the resistance to flow. Normally these forces are small, except at high velocities.

Figure 2.20

Viscous damping between two bodies with relative motion

A damping force is proportional to the first derivative of position (velocity). Aerodynamic drag is proportional to the velocity squared. The equation for drag is shown in

translation - 2.20

Figure 2.21 in vector and scalar forms. The drag force increases as the square of velocity. Normally, the magnitude of the drag force coefficient ’D’ is approximated theoretically and/or measured experimentally. The drag coefficient is a function of material type, surface properties, object size and object geometry.

v F

Figure 2.21

F = –D v v

Aerodynamic drag

The force is acting on the cylinder, resulting in the velocities given below. What is the applied force? d- x = 0.1 m ------dt 1 s

d- x = – 0.3 m ------dt 2 s

F

F

k d = 0.1 Ns -----m

ans. F = – 0.02N

Figure 2.22

Drill problem: Find the required forces on the damper

translation - 2.21

2.2.6 Cables And Pulleys Cables are useful when transmitting tensile forces or displacements. The centerline of the cable becomes the centerline for the force. And, if the force becomes compressive, the cable becomes limp, and will not transmit force. A cable by itself can be represented as a force vector. When used in combination with pulleys, a cable can redirect a force vector or multiply a force. Typically we assume that a pulley is massless and frictionless (in the rotation chapter we will assume they are not). If this is the case then the tension in the cable on both sides of the pulley are equal, as shown in Figure 2.23.

T1 for a massless frictionless pulley T1 = T2 T2

Figure 2.23

Tension in a cable over a massless frictionless pulley

If we have a pulley that is fixed and cannot rotate, the cable must slide over the surface of the pulley. In this case we can use the coefficient of friction to determine the relative ratio of forces between the sides of the pulley, as shown in Figure 2.24.

T1

T2

Figure 2.24

∆θ

Friction of a belt over a fixed drum

T2 µ ( ∆θ ) ----- = e k T1

translation - 2.22

Given,

µ s = 0.35

µ k = 0.2

M = 1Kg Find F to start the mass moving up and down, and then the force required to maintain a low velocity motion.

M F

ans. F up = 9.81e

π 0.2  --- 2

N

9.81N F down = --------------e

Figure 2.25

π 0.2  ---  2

Drill problem: Friction forces for belts on drums

Although the discussion in this section has focused on cables and pulleys, the theory also applies to belts over drums.

translation - 2.23

2.2.7 Friction Viscous friction was discussed before, where a lubricant would provide a damping effect between two moving objects. In cases where there is no lubricant, and the touching surfaces are dry, dry coulomb friction may result. In this case the surfaces will stick in place until a maximum force is overcome. After that the object will begin to slide and a constant friction force will result. Figure 2.26 shows the classic model for (dry Coulomb) friction. The force on the horizontal axis is the force applied to the friction surfaces while the vertical axis is the resulting friction force. Beneath the slip force the object will stay in place. When the slip force is exceeded the object will begin to move, and the resulting kinetic friction force will be relatively constant. (Note: If the object begins to travel much faster then the kinetic friction force will decrease.) It is common to forget that friction forces are bidirectional, but it always opposes the applied force or motion. The friction force is a function of the coefficient of friction and the normal force across the contact surfaces. The coefficient of friction is a function of the materials, surface texture and surface shape.

F result

Block begins to slip and the applied force exceeds the resultant and acceleration begins.

Fs Fk

Fapplied

Fs

Fg N

F

Fk = µk N F k, F s

Fs ≤ µs N

Note: When solving problems with friction remember that the friction force will always equal the applied force (not the maximum force) until slip occurs. After that the friction is approximately constant. In addition, the friction forces direction opposes applied forces, and motion.

Figure 2.26

Dry friction

translation - 2.24

Many systems use kinetic friction to dissipate energy from a system as heat, sound and vibration.

Find the acceleration of the block for both angles indicated.

µ s = 0.3 µ k = 0.2

10 kg

θ

ans.

Figure 2.27

Drill problem: find the accelerations

θ1 = 5 °

θ 2 = 35 °

translation - 2.25

2.2.8 Contact Points And Joints A system is built by connecting components together. These connections can be rigid or moving. In solid connections all forces and moments are transmitted and the two pieces act as a single rigid body. In moving connections there is at least one degree of freedom. If we limit this to translation only, there are up to three degrees of freedom, x, y and z. In any direction there is a degree of freedom, a force or moment cannot be transmitted. When constructing FBDs for a system we must break all of the components into individual rigid bodies. Where the mechanism has been broken the contact forces must be added to both of the separated pieces. Consider the example in Figure 2.28. At joint A the forces are written as two components in the x and y directions. For joint B the force components with equal magnitudes but opposite directions are added to both FBDs.

F Ay

F By F Ax

A

F Bx

M1 B M1 g

M2 g

M2 F Bx F By

Figure 2.28

Note: Don’t forget that forces on connected FBDs should have equal magnitudes, but opposite directions.

FBDs for systems with connected members

2.3 SYSTEM EXAMPLES An orderly approach to system analysis can simplify the process of analyzing large systems. The list of steps below is based on general observations of good problem solving techniques.

translation - 2.26

1. Assign letters/numbers to designate force components (if not already done) this will allow you to refer to components in your calculations. 2. Define positions and directions for any moving masses. This should include the selection of reference points. 3. Draw free body diagrams for each component, and add forces (inertia is optional). 4. Write equations for each component by summing forces. 5.(next chapter) Combine the equations by eliminating unwanted variables. 6.(next chapter) Develop a final equation that relates input (forcing functions) to outputs (results).

Note: When deriving differential equations, the final value can be checked for errors using unit analysis. This method involves replacing variables with their unit equivalents. All the units should match. ·· · e.g., x 2 ( M 2 ) + x 2 ( B ) + x 2 ( K s2 ) + x 1 ( – K s2 ) = F m m Ns N N ∴----2 ( Kg ) + ----  ------ + m  ---- + m  – ---- = N s m m m s ∴N + ( N ) + ( N ) + ( – N ) = N

coefficient

units

F

KgmN = ----------2 s

Ks

N--m

Kd

Ns -----m

M

Kg

The units match, so there are no obvious problems.

Consider the cart in Figure 2.29. On the left is a force, it is opposed by a spring and damper on the right. The basic problem definition already contains all of the needed definitions, so no others are required. The FBD for the mass shows the applied force and the reaction forces from the spring and damper. When the forces are summed the inertia is on the right side of the equation in Newton’s form. This equation is then rearranged to a second-order non-homogeneous differential equation.

translation - 2.27

x

Given the system diagram;

Kd F M1

The FBD for the cart is

K d x·

F M 1 x··

Ks

M1

Ksx

The forces for the cart are in a single direction and can be summed as, + ∑ Fx = – F – Kd x· – Ks x = M1 x·· This equation can be rearranged to a second-order non-homogeneous diff. eqn. Kd K Fx·· + ------- x· + -------s- x = ------M1 M1 M1 Aside: later on we will solve the differential equations, or use other methods to determine how the system will behave. It is useful to have all of the ’output’ variables for the system on the left hand side, and everything else on the other.

Figure 2.29

A simple translational system example

translation - 2.28

Develop the equation relating the input force to the motion (in terms of x) of the lefthand cart for the problem below. x1 x2 K d1

K d2

F M1

Figure 2.30

K s1

M2

K s2

Drill problem: Find the differential equations

A simplified model of an elevator (M1) and a passenger (M2) are shown in Figure 2.31. In this example many of the required variables need to be defined. These are added to the FBDs. Care is also taken to ensure that all forces between bodies are equal in magnitude, but opposite in direction. The wall forces are ignored because they are statically indeterminate, and x-axis force components are irrelevant to the forces in the y-axis.

translation - 2.29

M1

M2 Kd K S2

K S1

Assign required quantities and draw the FBDs M2 g · · FD = Kd ( y2 – y1 ) ·· M1 y1

y2

M1 g F S2 = K s2 ( y 1 – y 2 ) FD

·· M2 y2 F S2

F S1 = – K s1 y 1

y1

Figure 2.31

A multi-body translating system (an elevator with a passenger)

The forces on the FBDs are summed and the equations are expanded in Figure 2.32.

translation - 2.30

Now, sum the forces in vector form, and substitute relationships,

∑ FM ∑ FM

1

2

= F S1 + F S2 + M 1 g + F D = M 1 a 1 = – F S2 + M 2 g – F D = M 2 a 2

At this point the equations are expanded d K S1 ( – y 1 ) + K S2 ( y 2 – y 1 ) + M 1 ( – 9.81 ) + K d ----- ( y 2 – y 1 ) = M 1 a y dt d – K S2 ( y 2 – y 1 ) + M 2 ( – 9.81 ) – K d ----- ( y 2 – y 1 ) = M 2 a y dt Figure 2.32

Equations for the elevator

translation - 2.31

Write the differential equations for the system below. Assume it is in motion

A

B

M2

µ k1 M1

K S1

µ k2

ans.

Figure 2.33

Drill problem: A more complex translational systems

Consider the springs shown in Figure 2.34. When two springs are combined in this manner they can be replaced with a single equivalent spring. In the parallel spring combination the overall stiffness of the spring would increase. In the series spring combination the overall stiffness would decrease.

translation - 2.32

Parallel K S1

Series

K S2 K S1

M

K S2

M

Figure 2.34

Springs in parallel and series (kinematically)

Figure 2.35 shows the calculations required to find a spring coefficient equivalent to the two springs in series. The first step is to draw a FBD for the mass at the bottom, and for a point between the two springs, P. The forces for both of these are then summed. The next process is to combine the two equations to eliminate the height variable created for point P. After this, the equation is rearranged into Hooke’s law, and the equivalent spring coefficient is found.

translation - 2.33

First, draw FBDs for P and M and sum the forces assuming the system is static. K S1 y 2

P

+ ∑ F y = K S1 y 2 – K S2 ( y 1 – y 2 ) = 0 (1) K S2 ( y 1 – y 2 )

K S1

K S2 ( y 1 – y 2 )

K S2

M +

∑ Fy

P

= K S2 ( y 1 – y 2 ) – F g = 0 (2)

Fg

M y1

Next, rearrange the equations to eliminate y2 and simplify. (1) becomes

K S2 ( y 1 – y 2 ) – Fg = 0 Fg y 1 – y 2 = --------K S2 Fg y 2 = y 1 – ---------K S2

(2) becomes

(3)

K S1 y 2 – K S2 ( y 1 – y 2 ) = 0

(4) y 2 ( K S1 + K S2 ) = y 1 K S2 Fg   sub (3) into (4)  y – --------- ( K + K ) = y K S2 1 S2  1 K S2 S1 Fg K S2 y 1 – ---------- = y 1 ---------------------------K S2 K S1 + K S2 K S2   F g = y 1  1 – ---------------------------- K S2 K S1 + K S2   K S1 + K S2 – K S2 F g = y 1  -------------------------------------------- K S2  K S1 + K S2   K S1 K S2  F g = y 1  ----------------------------  K S1 + K S2 Finally, consider the basic spring equation to find the equivalent spring coefficient. K S1 K S2 K equiv· = ---------------------------K S1 + K S2 Figure 2.35

Calculation of an equivalent spring coefficient for springs in series

y2

translation - 2.34

K S1

K S2

F

ans.

Figure 2.36

Drill problem: Find an equivalent spring for the springs in parallel

Consider the drill problem. When an object has no mass, the force applied to one side of the spring will also be applied to the other. The only factor that changes is displacement.

translation - 2.35

Show that a force applied to one side of a massless spring is the reaction force at the other side.

ans.

Figure 2.37

Drill problem: Prove that the force on both sides is equal

2.4 OTHER TOPICS Designing a system in terms of energy content can allow insights not easily obtained by the methods already discussed. Consider the equations in Figure 2.38. These equations show that the total energy in the system is the sum of kinetic and potential energy. Kinetic energy is half the product of mass times velocity squared. Potential energy in translating systems is a force magnitude multiplied by a distance (that force was applied over). In addition, the power, or energy transfer rate is the force applied multiplied by the velocity.

translation - 2.36

E = EP + EK 2 Mv E K = ----------2

(7)

E P = Fd = Mgd

(9)

d- E P = Fv = ---dt

(10)

Figure 2.38

(8)

Energy and power equations for translating masses

2.5 SUMMARY • FBDs are useful for reducing complex systems to simpler parts. • Equations for translation and rotation can be written for FBDs. • The equations can be integrated for dynamic cases, or solved algebraically for static cases.

2.6 PRACTICE PROBLEMS 1. If a spring has a deflection of 6 cm when exposed to a static load of 200N, what is the spring constant?

translation - 2.37

2. Derive the effective damping coefficients for the pairs below from basic principles, a)

Kd1

Kd2

b)

Kd1

Kd2

3. Write a differential equation for the mass pictured below. x

M

F

B

4. Write the differential equations for the translating system below. F

Ks M1

M2

translation - 2.38

5. Write the differential equations for the system below. x1

x2

K d1 K s1

M1

K s2

F

M2 B

6. Write the differential equations for the system given below. Kd

Ks M1

F

M2

B1

B2

7. Write the differential equations for the system below. x1

x2

K d1 K s1

M1

K s2

F

M2 B

8. Write the differential equations for the system below. x1

x2

K d1 K s1

K d2 M1

K s2

K d3 M2

F

K s3

translation - 2.39

9. Write the differential equations for the system below. x2

K s2 M2 K d1

F B x1

K s1

M1

10. Write the differential equations for the system below. x2

K s2 M2

F µ s, µ k

K d1 K s1

M1

x1

11. Write the differential equations for the system below. F x1

M1

K s1

K d1

x2

M2

K s2

K d2

translation - 2.40

12. Write the differential equations for the system below. Assume that the pulley is massless and frictionless and that the system begins undeflected. x K s1

R

M B

K s2

13. Write the differential equations for the system below. In this system the upper mass, M1, is between a spring and a cable and there is viscous damping between the mass and the floor. The suspended mass, M2, is between the cable and a damper. The cable runs over a massless, frictionless pulley. x1 Ks

R

M1 B

x2

M2

Kd

translation - 2.41

14. Write the differential equations for the system below. x1

K s1 M1

µ s, µ k

x2

M2

K s2

2.7 PRACTICE PROBLEM SOLUTIONS 1. Ks = 33.3 N/cm = 3333 N/m 2. a)

K eq = K d1 + K d2

3. F ·· · B x + x  ----- = – ----M M 4. Ks –Ks ·· F x 1 + x 1  ------- + x 2  --------- = ------M1 M1 M1 Ks –Ks ·· x 2 + x 2  ------- + x 1  --------- = 0  M 2  M2 

b)

K d1 K d2 K eq = -----------------------K d1 + K d2

translation - 2.42

5. K s1 + K s2 – K s2 ·· · K d1 x 1 + x 1  --------- + x 1  ----------------------- + x 2  ----------- = 0 M1 M1 M1 K s2 – K s2 ·· · B F x 2 + x 2  ------- + x 2  -------- + x 1  ----------- = ------M2 M2 M2 M2 6. Ks –K s ·· · Kd + B1 x 1 + x 1  ------------------- + x 1  ------- + x 2  --------- = 0  M1   M 1  M1  Ks –K s ·· · B2 –F x 2 + x 2  ------- + x 2  ------- + x 1  --------- = ------M2 M2 M2 M2 7. K s1 – K s2 ·· · K d1 x 1 + x 1  --------- + x 1  -------- + x 2  ----------- = 0  M1   M1   M1  Ks F ·· · B ·· · B x 1 + x 1  ------- + x 2 + x 2  ------- + x 2  ------- = ------M2 M2 M2 M2

translation - 2.43

8. ·· M 1 x1

FBDs: · – K d1 x 1

M1

– K s1 x 1 For M1:

+

· · K d2 ( x 1 – x 2 ) K s2 ( x 1 – x 2 )

· K d3 x 2 M2

F · · · ·· ∑ F = – Kd1 x1 – Ks1 x1 – Kd2 ( x1 – x2 ) – Ks2 ( x1 – x 2 ) = M1 x1

K s3 x 2 ·· M2 x2

·· · · x 1 ( M 1 ) + x 1 ( K d1 + K d2 ) + x 1 ( K s1 + K s2 ) + x 2 ( – K d2 ) + x 2 ( – K s2 ) = 0 K s1 + K s2 – K s2 ·· · K d1 + K d2 · – K d2 x 1 + x 1  ------------------------ + x 1  ----------------------- + x 2  ------------ + x 2  ----------- = 0   M1   M1   M1  M1  For M2: +

∑F

· · · · = K d2 ( x 1 – x 2 ) + K s2 ( x 1 – x 2 ) + F – K d3 x 2 – K s3 x 2 = M 2 x 2 ·· · · x 2 ( M 2 ) + x 2 ( K d2 + K d3 ) + x 2 ( K s2 + K s3 ) + x 1 ( – K d2 ) + x 1 ( – K s2 ) = F K s2 + K s3 – K s2 ·· · K d2 + K d3 · – K d2 x 2 + x 2  ------------------------ + x 2  ----------------------- + x 1  ------------ + x 1  ----------- = F M2 M2 M2 M2

9. ·· · · x 1 ( M 1 ) + x 1 ( K d1 + B ) + x 1 ( K s1 ) + x 2 ( – B ) = 0 K s1 ·  – B  ·· · K d1 + B- - + x 2 ------- = 0 + x 1  ------x 1 + x 1  ----------------- M1   M1   M 1 ·· · · x 2 ( M 2 ) + x 2 ( B ) + x 2 ( K s2 ) + x 1 ( – B ) = F K s2 ·· · B · –B F x 2 + x 2  ------- + x 2  -------- + x 1  ------- = ------ M 2  M2   M 2 M2

translation - 2.44

10. ·· · x 1 ( M 1 ) + x 1 ( K d1 ) + x 1 ( K s1 ) = FF K s1 FF ·· · K d1 x 1 + x 1  --------- + x 1  -------- = ------ M1   M1  M1 ·· x 2 ( M 2 ) + x 2 ( K s2 ) = F – F F K s2 F – FF ·· x 2 + x 2  -------- = ---------------M2 M2 where,

FF ≤ µs M2 g

if

· · x1 = x2

· ·  x1 – x2  F F = µ k M 2 g  -----------------· · -  x1 – x2 

if

· · x1 ≠ x2

11. (assuming no gravity ·· · · x 1 ( M 1 ) + x 1 ( K d1 ) + x 1 ( K s1 ) + x 2 ( – K d1 ) + x 2 ( – K s1 ) = F K s1 – K s1 ·· · K d1 · – K d1 F x 1 + x 1  --------- + x 1  -------- + x 2  ------------ + x 2  ----------- = ------ M1   M1   M1   M1  M1 ·· · · x 2 ( M 2 ) + x 2 ( K d1 + K d2 ) + x 2 ( K s1 + K s2 ) + x 1 ( – K d1 ) + x 1 ( – K s1 ) = 0 K s1 + K s2 – K s1 ·· · K d1 + K d2 · – K d1 x 2 + x 2  ------------------------ + x 2  ----------------------- + x 1  ------------ + x 1  ----------- = 0 M2 M2 M2 M2 12. if ( x ≥ 0 )

T = 0

if ( x < 0 )

T = –K s2 x

K s1 T ·· · B x + x  ------- + x  -------- = ------M1 M1 M1

translation - 2.45

13. Ks x 1

FBDs:

M1

· Bx 1

For M1:

+

For M2: +

For T:

·· M1 x1

· ·· ∑ F = – Ks x1 – Bx 1 + T = M1 x1 ·· · x1 ( M1 ) + x1 ( B ) + x1 ( Ks ) = T Ks ·· · B T x 1 + x 1  ------- + x 1  ------- = ------ M 1  M 1 M1

∑F

T

T

· ·· = T + Kd x2 – M2 g = –M2 x2 ·· · x2 ( – M2 ) + x2 ( –K d ) = T – M 2 g T – M2 g ·· · Kd x 2 + x 2  ------- = ------------------- M 2 –M2

if T 0 x1 = x2

14. if ( ( x 2 – x 1 ) < 0 )

T = 0

· if ( x 1 = 0 )

F F ≤ M 1 gµ s

· if ( x 1 ≠ 0 )

· x1 F F = M 1 gµ k ------·x1

T – FF K s1 ·· x 1 + x 1  -------- = --------------M1 M1 K s2 ·· –T x 2 + x 2  -------- = ------- – g  M2  M2

2.8 ASSIGNMENT PROBLEMS

M2 M2 g

·· M2 x2 · Kd x2

differential equations - 3.1

3. ANALYSIS OF DIFFERENTIAL EQUATIONS

Topics: • First and second-order homogeneous differential equations • Non-homogeneous differential equations • First and second-order responses • Non-linear system elements • Design case Objectives: • To develop explicit equations that describe a system response. • To recognize first and second-order equation forms.

3.1 INTRODUCTION In the previous chapter we derived differential equations of motion for translating systems. These equations can be used to analyze the behavior of the system and make design decisions. The most basic method is to select a standard input type (a forcing function) and initial conditions, and then solve the differential equation. It is also possible to estimate the system response without solving the differential equation as will be discussed later. Figure 3.1 shows an abstract description of a system. The basic concept is that the system changes the inputs to outputs. Say, for example, that the system to be analyzed is an elevator. Inputs to the system would be the mass of human riders and desired elevator height. The output response of the system would be the actual height of the elevator. For analysis, the system model could be developed using differential equations for the motor, elastic lift cable, mass of the car, etc. A basic test would involve assuming that the elevator starts at the ground floor and must travel to the top floor. Using assumed initial values and input functions the differential equation could be solved to get an explicit equation for elevator height. This output response can then be used as a guide to modify design choices (parameters). In practice, many of the assumptions and tests are mandated by law or by groups such as Underwriters Laboratories (UL), Canadian Standards Association (CSA) and the European Commission (CE).

differential equations - 3.2

inputs

system

forcing function

differential equations

Figure 3.1

outputs response function

Note: By convention inputs are on the left, and outputs are on the right.

A system with and input and output response

There are several standard input types used to test a system. These are listed below in order of relative popularity with brief explanations. • step - a sudden change of input, such as very rapidly changing a desired speed from 0Hz to 50Hz. • ramp - a continuously increasing input, such as a motor speed that increases constantly at 10Hz per minute. • sinusoidal - a cyclic input that varies continuously, such as wave height that is continually oscillating at 1Hz. • parabolic - an exponentially increasing input, such as a motor speed that is 2Hz at 1 second, 4rad/s at 2 seconds, 8rad/s at 3 seconds, etc. After the system has been modeled, an input type has been chosen, and the initial conditions have been selected, the system can be analyzed to determine its behavior. The most fundamental technique is to integrate the differential equation(s) for the system.

3.2 EXPLICIT SOLUTIONS Solving a differential equation results in an explicit solution. This equation provides the general response as a function of time, but it can also be used to find frequencies and other characteristics of interest. This section will review techniques used to integrate first and second-order homogenous differential equations. These equations correspond to systems without inputs, also called unforced systems. Non-homogeneous differential equations will also be reviewed. The basic types of differential equations are shown in Figure 3.2. Each of these equations is linear. On the left hand side is the integration variable ’x’. If the right hand side is zero, then the equation is homogeneous. Each of these equations is linear because each of the terms on the left hand side is simply multiplied by a linear coefficient.

differential equations - 3.3

· Ax + Bx = 0 · Ax + Bx = Cf ( t ) ·· · Ax + Bx + Cx = 0 ·· · Ax + Bx + Cx = Df ( t )

Figure 3.2

first-order homogeneous first-order non-homogeneous second-order homogeneous second-order non-homogeneous

Standard equation forms

A general solution for a first-order homogeneous differential equation is given in Figure 3.3. The solution begins with the solution of the homogeneous equation where a general form is ’guessed’. Substitution leads to finding the value of the coefficient ’Y’. Following this, the initial conditions for the equation are used to find the value of the coefficient ’X’. Notice that the final equation will begin at the initial displacement, but approach zero as time goes to infinity. The e-to-the-x behavior is characteristic for a firstorder response.

differential equations - 3.4

Given the general form of a first-order homogeneous equation, x ( 0 ) = x0 and Ax· + Bx = 0 Guess a solution form and solve. – Yt – Yt x = Xe x· = – YX e A ( – YX e

– Yt

) + B ( Xe

– Yt

) = 0

A ( –Y ) + B = 0 Y = B --A Therefore the general form is, –B ---t A x h = Xe

initial condition

Note: The general form below is useful for finding almost all homogeneous equations x h ( t ) = Xe

Next, use the initial conditions to find the remaining unknowns. –B ---t A x h = Xe –B ---0 A x 0 = Xe x0 = X Therefore the final equation is, x ( t ) = x0 e

Figure 3.3

B – --- t A

General solution of a first-order homogeneous equation

– Yt

differential equations - 3.5

Solve the following differential equation given the initial condition. x(0) = 3 x· + 2x = 0

ans.

Figure 3.4

x ( t ) = 3e

– 2t

Drill Problem: First order homogeneous differential equation

The general solution to a second-order homogeneous equation is shown in Figure 3.5. The solution begins with a guess of the homogeneous solution, and the solution of a quadratic equation. There are three possible cases that result from the solution of the quadratic equation: different but real roots; two identical real roots; or two complex roots. The three cases result in three different forms of solutions, as shown. The complex result is the most notable because it results in sinusoidal oscillations. It is not shown, but after the homogeneous solution has been found, the initial conditions need to be used to find the remaining coefficient values.

differential equations - 3.6

Given, Ax·· + Bx· + Cx = 0

x ( 0 ) = x0

and

x· ( 0 ) = v 0

Guess a general equation form and substitute it into the differential equation, 2 Yt Yt Yt x··h = Y Xe x h = Xe x· h = YXe 2 Yt Yt Yt A ( Y Xe ) + B ( YXe ) + C ( Xe ) = 0 2 A(Y ) + B( Y) + C = 0 2 2 – B ± ( B ) – 4 ( AC ) – B ± B – 4AC Y = ---------------------------------------------------- = -----------------------------------------2A 2A Note: There are three possible outcomes of finding the roots of the equations: two different real roots, two identical real roots, or two complex roots. Therefore there are three fundamentally different results. If the values for Y are both real, but different, the general form is, R1 t R2 t xh = X1 e + X2 e Note: The initial conditions are then used to find the values for X1 and X2.

Y = R 1, R 2

If the values for Y are both real, and identical, the general form is, R1t R1 t xh = X1 e + X 2 te The initial conditions are then used to find the values for X1 and X2.

Y = R 1, R 1

If the values for Y are complex, the general form is,

σt x h = X 3 e cos ( ω t + X 4 ) The initial conditions are then used to find the values of X3 and X4.

Y = σ ± ωj

Figure 3.5

Solution of a second-order homogeneous equation

As mentioned above, a complex solution when solving the homogeneous equation results in a sinusoidal oscillation, as proven in Figure 3.6. The most notable part of the solution is that there is both a frequency of oscillation and a phase shift. This form is very useful for analyzing the frequency response of a system, as will be seen in a later chapter.

differential equations - 3.7

Consider the situation where the results of a homogeneous solution are the complex conjugate pair. Y = R ± Cj This gives the general result, as shown below: ( R + C j )t ( R – Cj )t x = X1 e + X2e Rt Cjt Rt – Cjt x = X1 e e + X2 e e Rt Cjt – Cjt x = e  X1 e + X2 e   Rt x = e ( X 1 ( cos ( Ct ) + j sin ( Ct ) ) + X 2 ( cos ( – C t ) + j sin ( – C t ) ) ) Rt x = e ( X 1 ( cos ( Ct ) + j sin ( Ct ) ) + X 2 ( cos ( ( Ct ) – j sin ( Ct ) ) ) ) Rt x = e ( ( X1 + X 2 ) cos ( Ct ) + j ( X 1 – X 2 ) sin ( Ct ) ) Rt x = e ( ( X1 + X 2 ) cos ( Ct ) + j ( X 1 – X 2 ) sin ( Ct ) ) 2 2 2 Rt ( X 1 + X 2 ) + j ( X 1 – X 2 ) x = e ------------------------------------------------------------------------- ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 – X2 ) sin ( Ct ) ) 2 2 2 ( X1 + X2 ) + j ( X1 – X2 ) 2 2 2 2 X 1 + 2X 1 X 2 + X 2 –  X 1 + – 2 X 1 X 2 + X 2 Rt x = e ------------------------------------------------------------------------------------------------------------- ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 – X 2 ) sin ( C 2 2 2 2 X 1 + 2X 1 X 2 + X 2 –  X 1 + – 2 X 1 X 2 + X 2 Rt 4X 1 X 2 --------------------- ( ( X 1 + X 2 ) cos ( Ct ) + j ( X 1 – X 2 ) sin ( Ct ) ) 4X 1 X 2 ( X1 – X2 )  ( X1 + X2 )  Rt x = e 4X 1 X2  ------------------------ cos ( Ct ) + j ----------------------- sin ( Ct )  4X X  4X 1 X 2 1 2   ( X1 – X2 )   Rt x = e 4X 1 X 2 cos  Ct + atan  -------------------------    ( X1 + X 2 )  x = e

x = e

Rt

X3 cos ( Ct + X 4 )

frequency

Figure 3.6

phase shift

where, X = 3

4X 1 X 2  ( X1 – X2 )  X 4 = atan  -------------------------  ( X 1 + X 2 )

Phase shift solution for a second-order homogeneous differential equation

differential equations - 3.8

Note: Occasionally a problem solution might consist of both a sine and cosine term with the same frequency. These should normally be combined to a single term with a phase shift as shown below. Recall the double angle formula, sin ( ωt + θ ) = sin ωt cos θ + sin θ cos ωt This can be written in a more common form, A ( sin ωt cos θ + sin θ cos ωt ) = A sin ( ωt + θ ) A cos θ sin ωt + A sin θ cos ωt = A sin ( ωt + θ ) B sin ωt + C cos ωt = A sin ( ωt + θ ) where, B C A = ------------ = ----------cos θ sin θ sin θC ----------= ---cos θ B

A =

B = A cos θ C = A sin θ

C θ = atan  ----  B

2

B +C

2

Consider the example, 3 sin 5t + 4 cos 5t =

Figure 3.7

4 2 2 3 + 4 sin  5t + atan  ---  = 5 sin ( 5t + 0.927 ) 3

Phase shift solution form

differential equations - 3.9

Solve the following differential equation given the initial condition. · x( 0) = 1 x· ( 0 ) = 2 x·· + 2x + x = 0

–t

ans.

Figure 3.8

x ( t ) = e + 3te

–t

Drill Problem: Second order homogeneous differential equation

The methods for solving non-homogeneous differential equations builds upon the methods used for the solution of homogeneous equations. This process adds a step to find the particular solution of the equation. An example of the solution of a first-order nonhomogeneous equation is shown in Figure 3.9. To find the homogeneous solution the nonhomogeneous part of the equation is set to zero. To find the particular solution the final

differential equations - 3.10

form must be guessed. This is then substituted into the equation, and the values of the coefficients are found. Finally the homogeneous and particular solutions are added to get the final equation. The overall response of the system can be obtained by adding the homogeneous and particular parts. This is acceptable because the equations are linear, and the principle of superposition applies. The homogeneous equation deals with the response to initial conditions, and the particular solution deals with the response to forced inputs.

Generally, Ax· + Bx = Cf ( t ) x ( 0 ) = x0 First, find the homogeneous solution as before, in Figure 3.3. –B ---t A xh = x0 e Next, guess the particular solution by looking at the form of ’f(t)’. This step is highly subjective, and if an incorrect guess is made, it will be unsolvable. When this happens, just make another guess and repeat the process. An example is given below. In the case below the guess should be similar to the exponential forcing function. For example, if we are given 4t 6x· + 2x = 5e A reasonable guess for the particular solution is, 4t 4t xp = C1 e \x· p = 4C 1 e Substitute these into the differential equation and solve for A. 4t 4t 4t 6  4C 1 e  + 2  C 1 e  = 5e 524C 1 + 2C 1 = 5 ∴C 1 = ----26 Combine the particular and homogeneous solutions. – 6--- t 5- e 4t + x e 2 x = x p + x h = ----0 26 Figure 3.9

Solution of a first-order non-homogeneous equation

The method for finding a particular solution for a second-order non-homogeneous differential equation is shown in Figure 3.10. In this example the forcing function is sinusoidal, so the particular result should also be sinusoidal. The final result is converted into a phase shift form.

differential equations - 3.11

Generally, Ax·· + Bx· + Cx = Df ( t )

x( 0 ) = x0 and x· ( 0 ) = v 0 1. Find the homogeneous solution as before. σt x h = X 3 e cos ( ω t + X4 ) or σt σt x h = X 1 e + X 2 te or σ1 t σ2 t + X2 e xh = X1 e 2. Guess the particular solution by looking at the form of ’f(t)’. This step is highly subjective, and if an incorrect guess is made it will be unsolvable. When this happens, just make another guess and repeat the process. For the purpose of illustration an example is given below. In the case below it should be similar to the sine function. For example, if we are given 2x·· + 6x· + 2x = 2 sin ( 3t + 4 ) A reasonable guess is, x p = A sin ( 3t ) + B cos ( 3t ) x· p = 3A cos ( 3t ) – 3B sin ( 3t ) x··p = – 9A sin ( 3t ) – 9B cos ( 3t ) Substitute these into the differential equation ans solve for A and B. 2 ( – 9 A sin ( 3t ) – 9B cos ( 3t ) ) + 6 ( 3A cos ( 3t ) – 3B sin ( 3t ) ) + 2 ( A sin ( 3t ) + B cos ( 3t ) ) = 2 sin ( 3t + 4 ) ( – 18 A – 18B + 2A ) sin ( 3t ) + ( – 18 B + 18A + 2B ) cos ( 3t ) = 2 sin ( 3t + 4 ) ( – 16A – 18B ) sin ( 3t ) + ( 18A – 16B ) cos ( 3t ) = 2 ( sin 3t cos 4 + cos 3t sin 4 ) ( – 16A – 18B ) sin ( 3t ) + ( 18A – 16B ) cos ( 3t ) = ( 2 cos 4 ) sin ( 3t ) + ( 2 sin 4 ) cos ( 3t ) 18A – 16B = 2 sin 4 – 16A – 18B = 2 cos 4 – 16 – 18 A = 2 cos 4 A = – 16 –18 18 – 16 B 2 sin 4 B 18 –16

–1

– 1.307 = – 0.0109 – 1.514 0.0823

Next, rearrange the equation to phase shift form. x p = – 0.0109 sin ( 3t ) + 0.0823 cos ( 3t )

0.0823 π 2 2 – 0.0109 + 0.0823 sin  3t + atan  ------------------- + --- –0.0109 2 3. Use the initial conditions to determine the coefficients in the homogeneous solution. xp =

Figure 3.10

Solution of a second-order non-homogeneous equation

differential equations - 3.12

When guessing particular solutions, the forms in Figure 3.11 can be helpful.

Forcing Function

Guess

A

C

Ax + B Ax e

Cx + D Ax or Ax Ce Cxe

B sin ( Ax )

Figure 3.11

or B cos ( Ax )

C sin ( Ax ) + D cos ( Ax ) or Cx sin ( Ax ) + xD cos ( Ax )

General forms for particular solutions

differential equations - 3.13

Solve the following differential equation given the initial condition. x· ( 0 ) = 0 x( 0) = 0 x·· + 2x· + x = 1

ans.

Figure 3.12

–t

–t

x ( t ) = – e – te + 1

Drill Problem: Second order non-homogeneous differential equation

An example of a second-order system is shown in Figure 3.13. As expected, it begins with a FBD and summation of forces. This is followed with the general solution of

differential equations - 3.14

the homogeneous equation. Real roots are assumed thus allowing the problem solution to continue in Figure 3.14.

M Assume the system illustrated to the right starts from rest at a height ’h’. At time ’t=0’ the system is released and allowed to move.

Fg Ks

y Kd

Mg My·· + K d y·

Ksy

∑ Fy

= – Mg + K s y + K d y· = – M y··

My·· + K d y· + K s y = Mg

Find the homogeneous solution. At At 2 At yh = e y· h = Ae y··h = A e My·· + K d y· + K s y = 0 2 At At At M  A e  + K d ( Ae ) + K s ( e ) = 0 2 MA + K d A + K s = 0 2 – K d ± K d – 4MK s A = -------------------------------------------------2M Let us assume that the values of M, Kd and Ks lead to the case of two different positive roots. This would occur if the damper value was much larger than the spring and mass values. Thus, A = R 1, R 2 R1 t R2 t y h = C1 e + C2 e Figure 3.13

Second-order system example

The solution continues by assuming a particular solution and calculating values for the coefficients using the initial conditions in Figure 3.14. The final result is a secondorder system that is overdamped, with no oscillation.

differential equations - 3.15

Next, find the particular solution. · yp = C yh = 0

·· yh = 0

M ( 0 ) + K d ( 0 ) + K s ( C ) = Mg Mg C = -------Ks Now, add the homogeneous and particular solutions and solve for the unknowns using the initial conditions. R t R t Mg y ( t ) = y p + y h = -------- + C 1 e 1 + C 2 e 2 Ks y(0) = h

y' ( 0 ) = 0

Mg 0 0 h = -------- + C 1 e + C 2 e Ks Mg C 1 + C 2 = h – -------Ks y' ( t ) = R 1 C 1 e

R1t

+ R2 C2 e

0

0 = R1 C1 e + R2 C2 e

R2 t

0

0 = R1 C 1 + R2 C2

–R2 C 1 = --------- C 2 R1

R2 Mg – ------ C 2 + C 2 = h – -------R1 Ks K s h – Mg –R1 C 2 =  -----------------------  ------------------  K s   R 1 – R 2

– R2 K s h – Mg –R1 C 1 = ---------  -----------------------  ------------------ R1 Ks R1 – R2

Now, combine the solutions and solve for the unknowns using the initial conditions. K s h – Mg –R1 – R1 R t – R 2 K s h – Mg R t Mg y ( t ) = -------- +  -----------------------  ------------------ e 1 + ---------  -----------------------  ------------------ e 2         Ks R1 – R2 R1 Ks R1 – R 2 Ks K s h – Mg K s h – Mg –R1 R2 R1 t R2 t Mg y ( t ) = -------- +  -----------------------  ------------------ e +  -----------------------  ------------------ e         Ks R1 – R2 Ks R1 – R 2 Ks

Figure 3.14

Second-order system example (continued)

differential equations - 3.16

Given,

A sin ( ω t + θ )

(the desired final form)

A ( cos ω t sin θ + sin ω t cos θ ) ( A sin θ ) cos ω t + ( A cos θ ) sin ω t B cos ω t + C sin ω t where, B = A sin θ C = A cos θ

(the form we start with)

To find theta, B- = --------------A sin θ- = tan θ --C A cos θ

θ = atan  ---- C B

To find A, (method #1) B CA = ---------- = ----------sin θ cos θ To find A, (method #2) 2 2 A = B +C For example, 3 cos 5t + 4 sin 5t 2 2 3 + 4 sin  5t + atan 4--- 3 5 sin ( 5t + 0.9273 )

Figure 3.15

Proof for conversion to phase form

3.3 RESPONSES Solving differential equations tends to yield one of two basic equation forms. The e-to-the-negative-t forms are the first-order responses and slowly decay over time. They never naturally oscillate, and only oscillate if forced to do so. The second-order forms may

differential equations - 3.17

include natural oscillation.

3.3.1 First-order A first-order system is described with a first-order differential equation. The response function for these systems is natural decay or growth as shown in Figure 3.16. The time constant for the system can be found directly from the differential equation. It is a measure of how quickly the system responds to a change. When an input to a system has changed, the system output will be approximately 63% of the way to its final value when the elapsed time equals the time constant. The initial and final values of the function can be determined algebraically to find the first-order response with little effort. If we have experimental results for a system, we can calculate the time constant, initial and final values. The time constant can be found two ways, one by extending the slope of the first part of the curve until it intersects the final value line. That time at the intersection is the time constant. The other method is to look for the time when the output value has shifted 63.2% of the way from the initial to final values for the system. Assuming the change started at t=0, the time at this point corresponds to the time constant.

differential equations - 3.18

y t –-

y0

y ( t ) = y 1 + ( y 0 – y 1 )e

y· + --1- y = f ( t )

τ

τ

time constant

y1

τ OR

t

y y1

y ( τ ) = y 1 + ( y 0 – y 1 )e

y0

τ

Figure 3.16

Note: The time will be equal to the time constant when the value is 63.2% of the way to the final value, as shown below. – -t τ y ( τ ) = y 1 + ( y 0 – y 1 )e

t

–1

y ( τ ) = y 1 + ( y 0 – y 1 )0.368 y ( τ ) = 1 + ( 0 – 1 )0.368 y ( τ ) = 0.632

Typical first-order responses

The example in Figure 3.17 calculates the coefficients for a first-order differential equation given a graphical output response to an input. The differential equation is for a permanent magnet DC motor, and will be examined in a later chapter. If we consider the steady state when the speed is steady at 1400RPM, the first derivative will be zero. This simplifies the equation and allows us to calculate a value for the parameter K in the differential equation. The time constant can be found by drawing a line asymptotic to the start of the motor curve, and finding the point where it intercepts the steady-state value. This gives an approximate time constant of 0.8 s. This can then be used to calculate the remaining coefficient. Some additional numerical calculation leads to the final differential equation as shown.

differential equations - 3.19

For the motor, use the differential equation and the speed curve when Vs=10V is applied:  K 2 d- K-  --- ---------- dt ω +  JR  ω =  JR V s

1400 RPM

1s

2s

3s

For steady-state –1 d-  ---ω = 1400RPM = 146.6rads  dt ω = 0  K 2 K 0 +  ------- 146.6 =  ------ 10 JR  JR  K = 0.0682 1400 RPM

τ ª 0.8s 1s  K 2 1  ------- = ---------0.8s  JR  K 10.0682  ------ = -------- JR 0.8s K- = 18.328 ----JR 1ω· + -----ω = 18.328Vs 0.8

Figure 3.17

Finding an equation using experimental data

differential equations - 3.20

Find the differential equation when a step input of Vs=12V is applied: 2

1800 RPM

d- K  K-  --- ---- ---- dt ω +  JR ω =  JR V s 0.2s

0.4s

0.6s

ans.

Figure 3.18

d- 1 1800  ---ω + ---------- ω = --------------------- V s  dt 0.15 12 ( 0.15 )

Drill problem: Find the constants for the equation

A simple mechanical example is given in Figure 3.19. The modeling starts with a FBD and a sum of forces. After this, the homogenous solution is found by setting the nonhomogeneous part to zero and solving. Next, the particular solution is found, and the two solutions are combined. The initial conditions are used to find the remaining unknown coefficients.

differential equations - 3.21

Find the response to the applied force if the force is applied at t=0s. Assume the system is initially deflected a height of h.

F

F y  d- y = 0 + ∑ F y = – F + K s y + K d  ---dt d K d  ----- y Ks y  dt K d y· + K s y = F Find the homogeneous solution. Bt Bt y h = Ae y· h = ABe Bt Bt K d ( ABe ) + K s ( Ae ) = 0 Kd B + K s = 0 –K B = ---------s Kd Next, find the particular solution. y· p = 0

yp = C

F∴C = ----Ks Combine the solutions, and find the remaining unknown. –Ks ---------t Kd Fy ( t ) = y p + y h = Ae + ----Ks y(0) = h 0 F F h = Ae + ----∴A = h – -----K Ks s Kd ( 0 ) + K s ( C ) = F

The final solution is, F y ( t ) =  h – ----- e Ks

Figure 3.19

–Ks --------- t Kd

F + ----Ks

First-order system analysis example

Ks

Kd

differential equations - 3.22

Use the general form given below to solve the problem in Figure 3.19 without solving the differential equation. Assume the system starts at y=-20. · y + 10y = 5

y ( t ) = y 1 + ( y 0 – y 1 )e

ans.

Figure 3.20

t – -τ

y ( t ) = 0.5 – 19.5e

– 10t

Drill problem: Developing the final equation using the first-order model form

A first-order system tends to be passive, meaning it doesn’t deliver energy or power. A first-order system will not oscillate unless the input forcing function is also oscillating. The output response lags the input and the delay is determined by the system’s time constant.

differential equations - 3.23

3.3.2 Second-order A second-order system response typically contains two first-order responses, or a first-order response and a sinusoidal component. A typical sinusoidal second-order response is shown in Figure 3.21. Notice that the coefficients of the differential equation include a damping coefficient and a natural frequency. These can be used to develop the final response, given the initial conditions and forcing function. Notice that the damped frequency of oscillation is the actual frequency of oscillation. The damped frequency will be lower than the natural frequency when the damping coefficient is between 0 and 1. If the damping coefficient is greater than one the damped frequency becomes negative, and the system will not oscillate because it is overdamped.

A second-order system, and a typical response to a stepped input. 2 y·· + 2 ζω n y· + ω n y = f ( t )

σ = ζω n

y ( t ) = y ss + ( y 0 – y ss )e

–σ t

ωd = ωn 1 – ζ

2

cos ( ω d t )

y ss

y0

ωn ξ

ωd

Figure 3.21

Natural frequency of system - Approximate frequency of control system oscillations. Damping factor of system - If < 1 underdamped, and system will oscillate. If =1 critically damped. If > 1 overdamped, and never any oscillation (more like a first-order system). As damping factor approaches 0, the first peak becomes infinite in height. The actual frequency of oscillation - It is below the natural frequency because of the damping.

The general form for a second-order system

When only the damping coefficient is increased, the frequency of oscillation, and overall response time will slow, as seen in Figure 3.22. When the damping coefficient is 0 the system will oscillate indefinitely. Critical damping occurs when the damping coeffi-

differential equations - 3.24

cient is 1. At this point both roots of the differential equation are equal. The system will not oscillate if the damping coefficient is greater than or equal to 1.

ξ = 0

ξ = 0.5 (underdamped)

1- = 0.707 ξ = -----2

ξ = 1 (critical) (overdamped)

ξ»1

Figure 3.22

The effect of the damping coefficient

When observing second-order systems it is more common to use more direct measurements of the response. Some of these measures are shown in Figure 3.23. The rise

differential equations - 3.25

time is the time it takes to go from 10% to 90% of the total displacement, and is comparable to a first order time constant. The settling time indicates how long it takes for the system to pass within a tolerance band around the final value. The permissible zone shown is 2%, but if it were larger the system would have a shorter settling time. The period of oscillation can be measured directly as the time between peaks of the oscillation, the inverse is the damping frequency. (Note: don’t forget to convert to radians.) The damped frequency can also be found using the time to the first peak, as half the period. The overshoot is the height of the first peak. Using the time to the first peak, and the overshoot the damping coefficient can be found.

tp

Note: This figure is not to scale to make details near the steady-state value easier to see. f d = --1T

T e ss

0.02 ∆ x

b

0.02 ∆ x 0.9 ∆ x

tr

where, t r = rise time (from 10% to 90%) t s = settling time (to within 2-5% typ.) ∆ x = total displacement T, f d = period and frequency - damped

ts

∆x 0.5 ∆ x

b = overshoot 0.1 ∆ x

t p = time to first peak e ss = steady state error x = ∆ xe

–σ t

cos ( ω d t )

π ω d ≈ ---tp

(1)

σ = ξω n –σ tp

(2)

b- = e ----∆x 1 ξ = ----------------------------π - 2  ------ t p σ + 1 Figure 3.23

Characterizing a second-order response (not to scale)

(3) (4)

differential equations - 3.26

Note: We can calculate these relationships using the complex homogenous form, and the generic second order equation form.

2

2

A + 2ξω n A + ω n = 0 2

2

2

– 2ξω n ± 4ξ ω n – 4ω n A = ----------------------------------------------------------= σ ± jω d 2 σ ω n = -----–ξ

– 2ξωn ---------------- = σ = – ξω n 2 2

2

(1)

2

4ξ ω n – 4ω n ----------------------------------= jω d 2 2

2

2

2

4ξ ω n – 4ω n = 4 ( – 1 )ω d 2

2

2

2

ωn – ξ ωn = ωd 2

2

ωn 1 – ξ = ωd

(2)

2

σ ------ – ξ 2 σ ------ = ω 2d 2 2 ξ ξ 1 ξ = -------------------2 ωd ------ + 1 2 σ

2

ωd 1--------- + 1 = 2 2 ξ σ

(3)

The time to the first peak can be used to find the approximate decay constant x ( t ) = C1e

– σt

π ω d = ---tp b ≈ ∆xe

(4)

– σt p

(1) b ln  ------  ∆x σ = – -----------------tp

Figure 3.24

cos ( ω d t + C 2 )

(5)

Second order relationships between damped and natural frequency

differential equations - 3.27

2.2 y(t) 2.0

t 0

5.0 4.0 Write a function of time for the graph. (Note: measure, using a ruler, to get values.) Find the natural frequency and damping coefficient to develop the differential equation. Using the dashed lines determine the settling time.

Figure 3.25

ans. t 0 m ------dt 2 s

F F = µ k N = 98.1N Figure 3.39

Friction forces for the mass

The analysis of the system begins by assuming the system starts at rest and undeflected. In this case the cable/spring will be undeflected with no force, and the mass will be experiencing static friction. Therefore the block will stay in place until the cable stretches enough to overcome the static friction. ·· x2 = 0 x2 = 0 F F = 294.3N FF –2 ·· m x 2 + 10s x 2 = 1 ----- t – --------------3 100kg s –2 m-t – 294.3N ----------------0 + 10s 0 = 1 ---100kg 3 s m- t = 294.3kgm -----------------------1 ---3 2 s 100kgs t = 2.943s Therefore the system is static from 0 to 2.943s Figure 3.40

Analysis of the object before motion begins

differential equations - 3.44

After motion begins the object will only experience kinetic friction, and continue to accelerate until the cable/spring becomes loose in compression. This stage of motion requires the solution of a differential equation. –2 ·· 98.1Nm- t – -------------x 2 + 10s x 2 = 1 ---3 100kg s For the homogeneous, –2 ·· x 2 + 10s x 2 = 0 –2 A + 10s = 0 x h = C 1 sin ( 3.16t + C 2 )

A = ± 3.16js

–1

For the particular, x p = At + B

· xp = A

·· xp = 0

–2

98.1Nm- t – -------------( At + B ) = 1 ---3 100kg s –2 m10s A = 1 ---3 s –2 98.1N 10s B = – --------------100kg

0 + 10s

Figure 3.41

Analysis of the object after motion begins

A = 0.1 m ---s B = – 0.0981m

differential equations - 3.45

For the initial conditions, x ( 2.943s ) = 0m

d- x ( 2.943s ) = 0 m ------dt s

x ( t ) = C 1 sin ( 3.16t + C 2 ) + 0.1 m ---- t – 0.0981m s 0 = C 1 sin ( 3.16 ( 2.943s ) + C 2 ) + 0.1 m ---- ( 2.943s ) – 0.0981m s C 1 sin ( 9.29988 + C2 ) = – 0.1962 d- x ( t ) = 3.16C cos ( 3.16t + C ) + 0.1 m ------1 2 dt s 0 = 3.16C 1 cos ( 3.16 ( 2.943 ) + C 2 ) + 0.1 m ---s C 1 cos ( 9.29988 + C 2 ) = – 0.0316 C 1 sin ( 9.29988 + C 2 ) 0.1962------------------------------------------------------ = –-----------------C 1 cos ( 9.29988 + C 2 ) – 0.0316 tan ( 9.29988 + C 2 ) = 6.209

C 2 = ( – 7.889 + π n )rad

– 0.1962 C 1 = --------------------------------------------------= –0.199m sin ( 9.29988 – 7.889 ) x ( t ) = – 0.199 m sin ( 3.16t – 7.889rad ) + 0.1 m ---- t – 0.0981m s d ----- x ( t ) = – 0.199 ( 3.16 )m cos ( 3.16t – 7.889rad ) + 0.1 m ---dt s Figure 3.42

Analysis of the object after motion begins

nŒI

differential equations - 3.46

The equation of motion changes after the cable becomes slack. This point in time can be determined when the displacement of the block equals the displacement of the cable/spring end. m m 0.1 ---- t = – 0.199 m sin ( 3.16t – 7.889rad ) + 0.1 ---- t – 0.0981m s s – 0.199 m sin ( 3.16t – 7.889rad ) = 0.0981m t = 3.328s 3.16t – 7.889 + π n = – 0.51549413 x ( 3.328 ) = 0.137m

dm ---x ( 2.333 ) = 0.648 ---dt s

After this the differential equation without the cable/spring is used. m 98.1N x 2'' = – --------------- = – 0.981 ---2100kg s · m x 2 =  – 0.981 ----2 t + C 1 s m m 0.648 ---- =  – 0.981 ----2 ( 3.328s ) + C 1 s s m C 1 = 3.913 ---s 0.981 m m 2   x 2 = – ------------- ----2 t + 3.913 ---- t + C 2  2 s  s 0.981 m m 2 0.137m =  – ------------- ---2- ( 3.328s ) + 3.913 ---- ( 3.328s ) + C 2  2  s s C 2 = – 7.453m 0.981 m 2 m x 2 ( t ) =  – ------------- ----2 t + 3.913 ---- t – 7.453m  2 s  s This motion continues until the block stops moving. m m 0 =  –0.981 ----2 t + 3.913 ---  s s t = 3.989s The solution can continue, considering when to switch the analysis conditions.

Figure 3.43

Determining when the cable become slack

differential equations - 3.47

3.6 CASE STUDY A typical vibration control system design is described in Figure 3.44.

F

M

y

Figure 3.44

The model to the left describes a piece of reciprocating industrial equipment. The mass of the equipment is 10000kg. The equipment operates such that a force of 1000N with a frequency of 2Hz is exerted on the mass. We have been asked to design a vibration isolation mounting system. The criteria we are given is that the mounts should be 30cm high when unloaded, and 25cm when loaded with the mass. In addition, the oscillations while the machine is running cannot be more than 2cm total. In total there will be four mounts mounted around the machine. Each isolator will be composed of a spring and a damper.

A vibration control system

There are a number of elements to the design and analysis of this system, but as usual the best place to begin is by developing a free body diagram, and a differential equation. This is done in Figure 3.45.

differential equations - 3.48

+

∑ Fy

F

= F – 4K s y – 4K d y· + Mg = My··

y

M

My'· + 4K d y· + 4K s y = F + Mg

4K d y· 4K s y F- + g ··y + ------------ + ------------ = ---4K s y 4K d y· M M M 4K d y· 4K s y 1000N - sin ( 2 ( 2 π )t ) + 9.81ms – 2 y·· + --------------------- + --------------------- = --------------------10000Kg 10000Kg 10000Kg

Mg

–1 –1 –2 –2 y·· + 0.0004Kg K d y· + 0.0004Kg K s y = 0.1ms sin ( 4 π t ) + 9.81ms

Figure 3.45

FBD and derivation of equation

Using the differential equation, the spring values can be found by assuming the machine is at rest. This is done in Figure 3.46.

When the system is at rest the equation is simplified; the acceleration and velocity terms both become zero. In addition, we will assume that the cyclic force is not applied for the unloaded/loaded case. This simplifies the differential equation by eliminating several terms. –1

0.0004Kg K s y = 9.81ms

–2

Now we can consider that when unloaded the spring is 0.30m long, and after loading the spring is 0.25m long. This will result in a downward compression of 0.05m, in the positive y direction. –1

0.0004Kg K s ( 0.05m ) = 9.81ms 9.81 –2 –1 K s = -------------------------------- Kgms m 0.0004 ( 0.05 )

∴K s = 491KNm Figure 3.46

–2

–1

Calculation of the spring coefficient

The remaining unknown is the damping coefficient. At this point we have determined the range of motion of the mass. This can be done by developing the particular

differential equations - 3.49

solution of the differential equation, as it will contain the steady-state oscillations caused by the forces as shown in Figure 3.47.

–1 –1 –1 –2 –2 ·· · y + 0.0004Kg K d y + 0.0004Kg ( 491KNm )y = 0.1ms sin ( 4 π t ) + 9.81ms –1 –2 –2 –2 ·· · y + 0.0004Kg K d y + 196s y = 0.1ms sin ( 4 π t ) + 9.81ms

The particular solution can now be found by guessing a value, and solving for the coefficients. (Note: The units in the expression are uniform (i.e., the same in each term) and will be omitted for brevity.) y = A sin ( 4 π t ) + B cos ( 4 π t ) + C y' = 4 π A cos ( 4 π t ) – 4 π B sin ( 4 π t ) 2

2

y'' = – 16 π A sin ( 4 π t ) – 16 π B cos ( 4 π t ) 2

2

∴( –16 π A sin ( 4 π t ) – 16 π B cos ( 4 π t ) ) + 0.0004K d ( 4 π A cos ( 4 π t ) – 4 π B sin ( 4 π t ) ) + 196 ( A sin ( 4 π t ) + B cos ( 4 π t ) + C ) = 0.1 sin ( 4 π t ) + 9.81 2

– 16 π B + 0.0004K d 4 π A + 196A = 0 –6 B = A ( 31.8 × 10 K d + 1.24 ) 2 – 16 π A + 0.0004K d ( – 4 π B ) + 196A = 0.1 2

–3

2

–6

A ( –16 π + 196 ) + B ( – 5.0 × 10 K d ) = 0.1 –3

A ( – 16 π + 196 ) + A ( 31.8 × 10 K d + 1.24 ) ( – 5.0 × 10 K d ) = 0.1 0.1 A = -------------------------------------------------------------------------------------------------------------------------------------2 –6 –3 – 16 π + 196 + ( 31.8 × 10 K d + 1.24 ) ( – 5.0 × 10 K d ) 0.1 A = -------------------------------------------------------------------------------------------------------2 –9 –3 K d ( – 159 × 10 ) + K d ( – 6.2 × 10 ) + 38.1 –6

3.18 × 10 K d – 0.124 B = -------------------------------------------------------------------------------------------------------2 –9 –3 K d ( – 159 × 10 ) + K d ( –6.2 × 10 ) + 38.1 C = 9.81ms

Figure 3.47

–2

Particular solution of the differential equation

The particular solution can be used to find a damping coefficient that will give an overall oscillation of 0.02m, as shown in Figure 3.48. In this case Mathcad was used to find the solution, although it could have also been found by factoring out the algebra, and finding the roots of the resulting polynomial.

differential equations - 3.50

In the previous particular solution the values were split into cosine and sine components. The magnitude of oscillation can be calculated with the Pythagorean formula. 2 2 A +B 2 2 –6 ( 0.1 ) +  ( 3.18 ⋅ 10 )K d – 0.124 magnitude = --------------------------------------------------------------------------------------------------------------2 –9 –3 K d ( – 159 ⋅ 10 ) + K d ( – ( 6.2 ⋅ 10 ) ) + 38.1 The design requirements call for a maximum oscillation of 0.02m, or a magnitude of 0.01m. 2 2 –6 ( 0.1 ) +  ( 3.18 ⋅ 10 )K d – 0.124   0.01 = --------------------------------------------------------------------------------------------------------------2 –9 –3 K d ( – 159 ⋅ 10 ) + K d ( – ( 6.2 ⋅ 10 ) ) + 38.1 A given-find block was used in Mathcad to obtain a damper value of, magnitude =

K d = 3411N ---sm

Figure 3.48

Aside: the Mathcad solution

Determining the damping coefficient

The values of the spring and damping coefficients can be used to select actual components. Some companies will design and build their own components. Components can also be acquired by searching catalogs, or requesting custom designs from other companies.

differential equations - 3.51

3.7 SUMMARY • First and second-order differential equations were analyzed explicitly. • First and second-order responses were examined. • The topic of analysis was discussed. • A case study looked at a second-order system. • Non-linear systems can be analyzed by making them linear.

3.8 PRACTICE PROBLEMS 1. The mass, M, illustrated below starts at rest. It can slide across a surface, but the motion is opposed by viscous friction (damping) with the coefficient B. Initially the system starts at rest, when a constant force, F, is applied. Write the differential equation for the mass, and solve the differential equation. Leave the results in variable form. x

M

F

B

2. The following differential equation was derived for a mass suspended with a spring. At time 0s the system is released and allowed to drop. It then oscillates. Solve the differential equation to find the motion as a function of time. + N K s = 100 ---m y

M = 1Kg

Ks y

FBD: M

Mg

∑ Fy

·· = K s y – Mg = – My

N- N ··  100 --y – ( 1Kg )  9.81 ------- = ( – 1Kg )y   m Kg N  1 Nm -------- y·· +  100 ---- y = 9.81N  2   m s KgmKgm- ·· y = 9.81 ----------( 1Kg )y +  100 ----------2 2   s ms –2 –2 ·· y + ( 100s )y = 9.81ms –1 · y 0 = 0ms y = 0m 0

3. Solve the following differential equation with the three given cases. All of the systems have a

differential equations - 3.52

step input ’y’ and start undeflected and at rest. 2 ·· · x + 2ξωn x + ω n x = y

initial conditions

case 1:

ξ = 0.5

ω n = 10

case 2:

ξ = 1

ω n = 10

case 3:

ξ = 2

ω n = 10

· x = 0 x = 0 y = 1

4. Solve the following differential equation with the given initial conditions and draw a sketch of the first 5 seconds. The input is a step function that turns on at t=0. ·· · 0.5V o + 0.6V o + 2.1V o = 3V i + 2 initial conditions V i = 5 Vo = 0 · Vo = 0 5. Solve the following differential equation with the given initial conditions and draw a sketch of the first 5 seconds. The input is a step function that turns on at t=0. ·· · 0.5V o + 0.6V o + 2.1V o = 3V i + 2 initial conditions V i = 5 Vo = 0 · Vo = 1 6. a) Write the differential equations for the system below. Solve the equations for x assuming that

differential equations - 3.53

the system is at rest and undeflected before t=0. Also assume that gravity is present.

Kd1 = 1 Ns/m Ks1 = 1 N/m

Kd = 1 Ns/m

M = 1 kg

x1 Kd2 = 1Ns/m Ks2 = 1 N/m F=1N

x2

x

Ks = 1 N/m

F=1N b) State whether each system is first or second-order. If the system if first-order find the time constant. If it is second-order find the natural frequency and damping ratio. 7. Solve the following differential equation with the three given cases. All of the systems have a sinusoidal input ’y’ and start undeflected and at rest. · 2 ·· · initial conditions x = 0 x + 2ξωn x + ω n x = y x = 0 y = sin ( t ) ξ = 0.5 ω n = 10 case 1: case 2:

ξ = 1

ω n = 10

case 3:

ξ = 2

ω n = 10

8. A spring damper system supports a mass of 34N. If it has a spring constant of 20.6N/cm, what is the systems natural frequency? 9. Using a standard lumped parameter model the weight is 36N, stiffness is 2.06*103 N/m and damping is 100Ns/m. What are the natural frequency (Hz) and damping ratio?

differential equations - 3.54

10. What is the differential equation for a second-order system that responds to a step input with an overshoot of 20%, with a delay of 0.4 seconds to the first peak? 11. A system is to be approximated with a mass-spring-damper model using the following parameters: weight 28N, viscous damping 6Ns/m, and stiffness 36N/m. Calculate the undamped natural frequency (Hz) of the system, the damping ratio and describe the type of response you would expect if the mass were displaced and released. What additional damping would be required to make the system critically damped? · ·· Mx + K d x + K s x = F 12. Solve the differential equation below using homogeneous and particular solutions. Assume the system starts undeflected and at rest. ··· ·· · θ + 40θ + 20θ + 2θ = 4 13. What would the displacement amplitude after 100ms for a system having a natural frequency of 13 rads/sec and a damping ratio of 0.20. Assume an initial displacement of 50mm, and a steady state displacement of 0mm. (Hint: Find the response as a function of time.) 14. Determine the first order differential equation given the graphical response shown below. Assume the input is a step function. x 4

t(s) 0

1

2

3

4

15. Explain with graphs how to develop first and second-order equations using experimental data. 16. The second order response below was obtained experimentally. Determine the parameters of

differential equations - 3.55

the differential equation that resulted in the response assuming the input was a step function. 0.5s 1s

2

10

0

t(s)

17. Develop equations (function of time) for the first and second order responses shown below. x (m) 5m

0m 0.1s

0.2s

0.3s

0.4s

0.5s

0.6s

0.7s

0.8s

t (s)

x (m) 5m 0m 1s

-10m

3s

t (s)

differential equations - 3.56

3.9 PRACTICE PROBLEM SOLUTIONS 1. B -----

FM– FM- – M t F e x ( t ) = ----------– --- t + -------2 2 B B B 2. homogeneous:

guess

yh = e

· At y h = Ae

At

2 At

–2

A e + ( 100s )e 2

At

·· 2 At yh = A e

= 0

–2

A = –100s A = ± 10 js y h = C 1 cos ( 10t + C 2 ) particular:

guess

· yp = 0

yp = A –2

( 0 ) + ( 100s )A = 9.81ms –2 –2 ( 100s )A = 9.81ms –2 9.81ms = 0.0981m A = --------------------–2 100s y p = 0.0981m initial conditions:

–1

·· yp = 0 –2

y = y h + y p = C 1 cos ( 10t + C 2 ) + 0.0981m y' = – 10C 1 sin ( 10t + C 2 ) for d/dt y0 = 0m: 0 = – 10C 1 sin ( 10 ( 0 ) + C 2 ) for y0 = 0m:

C2 = 0

0 = C 1 cos ( 10 ( 0 ) + ( 0 ) ) + 0.0981m – 0.0981m = C 1 cos ( 0 ) y ( t ) = ( – 0.0981m ) cos ( 10t ) + 0.0981m

C 1 = – 0.0981m

differential equations - 3.57

3. – 5t

case 1:

x ( t ) = – 0.0115e

case 2:

x ( t ) = – 0.010e

case 3:

x ( t ) = 775 ⋅ 10 e

– 10t

cos ( 8.66t – 0.524 ) + 0.010 – 0.10te

– 6 – 37.32t

– 10t

+ 0.010

– 0.0108e

– 2.679t

+ 0.010

4.

or

V o ( t ) = – 8.465e

– 0.6t

sin ( 1.960t + 1.274 ) + 8.095

V o ( t ) = – 8.465e

– 0.6t

cos ( 1.960t – 0.2971 ) + 8.095

V 0 ( t ) = – 8.331e

– 0.6t

cos ( 1.96t – 0.238 ) + 8.095

5.

6. a)

b) –t

x1 ( t ) = e – 1

x ( t ) = – 12.485e

–t

x 2 ( t ) = 2e – 2

ζ = 0.5

τ = 1

– 0.5t

cos ( 0.866t – 0.524 ) + 10.81

ωn = 1

7. – 5t

case 1:

x ( t ) = – 0.00117e

case 2:

x ( t ) = ( 1.96 ⋅ 10 )e

case 3:

x ( t ) = ( 3.5 ⋅ 10 )e

–3

8. 24.37 rad/sec 9. fn=3.77Hz, damp.=.575

–3

sin ( 8.66t – 1.061 ) + 0.0101 sin ( t – 0.101 ) – 10t

–3

– 10t

–6

– 37.32t

+ ( 9.9 ⋅ 10 )te

– 2.679t

– ( 18 ⋅ 10 )e

–3

+ ( 9.9 ⋅ 10 ) sin ( t + 0.20 ) –3

+ ( 9.4 ⋅ 10 ) sin ( t + 0.382 )

differential equations - 3.58

10. ·· · x + 8.048x + 77.88x = F ( t ) 11. Given

s K d = 6N ---m

N K s = 36 ---m

28N M = ----------------- = 2.85kg N 9.81 -----kg The typical transfer function for a mass-spring-damper systems is, Ks F ·· · K d x + x  ------ + x  ----- = ---- M  M M The second order parameters can be calculated from this. 2 ·· · x + x ( 2ζω n ) + x ( ω n ) = y ( t )

ωn =

Ks ----- = M

N 36 ---m = ---------------2.85kg

kgm 36 ---------2ms - = ---------------2.85kg

12.63s

–2

rad = 3.55 --------- = 0.6Hz s

K d s  ----6N --- M m ξ = ------------ = --------------------------------------------- = 0.296 2ω n rad 2 ( 3.55 ) --------- 2.85kg s 2 rad ω d = ω n 1 – ξ = 3.39 --------s If pulled and released the system would have a decaying oscillation about 0.52Hz A critically damped system would require a damping coefficient of.... K -----d- Kd  M ξ = ------------ = --------------------------------------------- = 1.00 2ω n rad 2 ( 3.55 ) --------- 2.85kg s

Ns K d = 20.2 -----m

12. – 6 – 39.50t

θ ( t ) = – 66 ⋅ 10 e

– 3.216e

0.1383t

+ 1.216e

– 0.3368t

+ 2.00

differential equations - 3.59

13. y ( t ) = 0.05e

– 2.6t

cos ( 12.74t ) = 0.05e

– 2.6t

π sin  12.74t + --- 2

14. x 4

t(s) 0

1 2 τ = 1 Given the equation form, · 1 x + --- x = A τ The values at steady state will be · x = 0 x = 4 So the unknown ‘A’ can be calculated. 1 A = 4 0 + --- 4 = A 1 · 1 x + --- x = 4 1 · x+x = 4 15. Key points: First-order: find initial final values find time constant with 63% or by slope use these in standard equation Second-order: find damped frequency from graph find time to first peak use these in cosine equation

3

4

differential equations - 3.60

16. For the first peak: – σt b----= e p ∆x

π ω d ≈ ---tp

2– σ0.5 ----= e 10 2 ln  ------ = – σ0.5  10 2 σ = – 2 ln  ------ = 3.219  10 For the damped frequency:

1 ξ = ----------------------------π - 2  ------+1  t p σ

2π ω d = ------ = 2π 1s

These values can be used to find the damping coefficient and natural frequency σ = ξω n

3.219 ω n = ------------ξ

ωd = ωn 1 – ξ

2

3.219 2 2π = ------------- 1 – ξ ξ 2 2π - 2 1 – ξ -----------= ------------2  3.219 ξ 2π - 2 1  -----------+ 1 = ----2 3.219 ξ

ξ =

1 ------------------------------ = 0.4560 2π - 2  ----------- 3.219 + 1

3.219 3.219 ω n = ------------- = ---------------- = 7.059 ξ 0.4560 This leads to the final equation using the steady state value of 10 2 ·· · x + 2ξωn x + ω n x = F 2 ·· · x + 2 ( 0.4560 ) ( 7.059 )x + ( 7.059 ) x = F ·· · x + 6.438x + 49.83x = F ( 0 ) + 6.438 ( 0 ) + 49.83 ( 10 ) = F ·· · x + 6.438x + 49.83x = 498.3

F = 498.3

differential equations - 3.61

17. –t

----------  0.18 x(t) = 51 – e   

x ( t ) = – 10e

– 0.693 t

cos ( πt )

3.10 ASSIGNMENT PROBLEMS 1. A mass-spring-damper system has a mass of 10Kg and a spring coefficient of 1KN/m. Select a damping coefficient so that the system will have an overshoot of 20% for a step input.

numerical methods - 4.1

4. NUMERICAL ANALYSIS

Topics: • State variable form for differential equations • Numerical integration with software and calculators • Numerical integration theory: first-order, Taylor series and Runge-Kutta • Using tabular data • A design case Objectives: • To be able to solve systems of differential equations using numerical methods.

4.1 INTRODUCTION For engineering analysis it is always preferable to develop explicit equations that include symbols, but this is not always practical. In cases where the equations are too costly to develop, numerical methods can be used. As their name suggests, numerical methods use numerical calculations (i.e., numbers not symbols) to develop a unique solution to a differential equation. The solution is often in the form of a set of numbers, or a graph. This can then be used to analyze a particular design case. The solution is often returned quickly so that trial and error design techniques may be used. But, without a symbolic equation the system can be harder to understand and manipulate. This chapter focuses on techniques that can be used for numerically integrating systems of differential equations.

4.2 THE GENERAL METHOD The general process of analyzing systems of differential equations involves first putting the equations into standard form, and then integrating these with one of a number of techniques. State variable equations are the most common standard equation form. In this form all of the equations are reduced to first-order differential equations. These firstorder equations are then easily integrated to provide a solution for the system of equations.

numerical methods - 4.2

4.2.1 State Variable Form At any time a system can be said to have a state. Consider a car for example, the state of the car is described by its position and velocity. Factors that are useful when identifying state variables are: • The variables should describe energy storing elements (potential or kinetic). • The variables must be independent. • They should fully describe the system elements. After the state variables of a system have been identified, they can be used to write first-order state variable equations. The general form of state variable equations is shown in Figure 4.1. Notice that the state variable equation is linear, and the value of x is used to calculate the derivative. The output equation is not always required, but it can be used to calculate new output values.

d-  --- dt x = Ax + Bu y = Cx + Du

state variable equation output equation

where, x = state/output vector (variables such as position) u = input vector (variables such as input forces) A = transition matrix relating outputs/states B = matrix relating inputs to outputs/states y = non-state value that can be found directly (i.e. no integration) C = transition matrix relating outputs/states D = matrix relating inputs to outputs/states

Figure 4.1

The general state variable form

An example of a state variable equation is shown in Figure 4.2. As always, the FBD is used to develop the differential equation. The resulting differential equation is second-order, but this must be reduced to first-order. Using the velocity variable, ’v’ the second-order differential equation can be reduced to a first-order equation. An equation is also required to define the velocity as the first derivative of the position, ’x’. In the example the two state equations are manipulated into a matrix form. This form can be useful, and may be required for determining a solution. For example, HP calculators require the matrix form, while TI calculators use the equation forms. Software such as Mathcad can use either form. The main disadvantage of the matrix form is that it will only work for lin-

numerical methods - 4.3

ear differential equations.

Given the FBD shown below, the differential equation for the system is, F

K d x·

M

x Mx··

+

Ksx

∑ Fx

= – F – K d x· – K s x = Mx··

– F – K d x· – K s x = Mx··

The equation is second-order, so two state variables will be needed. One obvious choice for a state variable in this equation is ’x’. The other choice can be the velocity, ’v’. Equation (1) defines the velocity variable. The velocity variable can then be substituted into the differential equation for the system to reduce it to first-order. x· = v (1) Mx·· = – F – K d x· – K s x Mv· = – F – K d v – K s x –Ks –Kd –F v· = x  --------- + v  ---------- +  ------ M M M

(2)

Equations (1) and (2) can also be put into a matrix form similar to that given in Figure 4.1. 0 1 0 d x = – K – K x + –F ----dt v -------------s- ---------d- v M M M Note: To have a set of differential equations that is solvable, there must be the same number of state equations as variables. If there are too few equations, then an additional equation must be developed using an unexploited relationship. If there are too many equations, a redundancy or over constraint must be eliminated.

Figure 4.2

A state variable equation example

numerical methods - 4.4

Put the equation into state variable and matrix form.

2

d- x ∑ F = F = M  ---dt

ans. x· = v

F · v = ----M

0 d- x 0 1 x ---= + F dt v ----0 0 v M

Figure 4.3

Drill problem: Put the equation in state variable form

Consider the two cart problem in Figure 4.4. The carts are separated from each other and the wall by springs, and a force is applied to the left hand side. Free body diagrams are developed for each of the carts, and differential equations developed. For each cart a velocity state variable is created. The equations are then manipulated to convert the second-order differential equations to first-order state equations. The four resulting equations are then put into the state variable matrix form.

numerical methods - 4.5

x1

x2

F

K s1

K s2

M1

K s1 ( x 1 – x 2 )

F M1

K s1 ( x 1 – x 2 )

M2

·· M1 x1

M2

K s2 ( x 2 ) ·· M2 x2

+

∑ Fx

·· = F – K s1 ( x 1 – x 2 ) = M 1 x 1

·· M 1 x 1 + K s1 x 1 – K s1 x 2 = F · x1 = v1 · M 1 v 1 + K s1 x 1 – K s1 x 2 = F · F- – K s1 + K s1 v 1 = ---------------x ---------x 1 M1 M1 M1 2 +

∑ Fx

(2)

·· = K s1 ( x 1 – x 2 ) – K s2 ( x 2 ) = M 2 x 2

·· M 2 x 2 + ( K s1 + K s2 )x 2 – K s1 x 1 = 0 · x2 = v2 (3) · M 2 v 2 + ( K s1 + K s2 )x 2 – K s1 x 1 = 0 K s1  K s1 + K s2 · v 2 = ---------x –  -------------------------- x 2 (4) M2 M2 1  

The state equations can now be combined in a matrix form. 0 1 0 0 x1 x1 0 – K s1 K s1 ------------- 0 --------0 Fv1 v1 M1 M1 ------d = + M1 ----dt x x 0 0 0 1 2 2 0 K – K – K v2 v2 s1 s1 s2 0 --------- 0 ----------------------------- 0 M2 M2

Figure 4.4

(1)

Two cart state equation example

numerical methods - 4.6

x Kd M

Ks

ans. · x = v Ks Kd · v = v  ------ + x  ----- M M

Figure 4.5

Drill problem: Develop the state equations in matrix form

numerical methods - 4.7

x1

x2 K d1

F M1

K s1

K s2 M2

ans. x· = v 1 1 · x2 = v2 – K d1 – K s1 K d1 K s1 · F v 1 = v 1  ------------ + x 1  ----------- + v 2  --------- + x 2  -------- + ------M1 M1 M1 M1 M1 – K d1 – K s1 – K s2 K d1 K s1 · v 2 = v 2  ------------ + x 2  --------------------------- + v 1  --------- + x 1  --------  M2     M2   M2  M2

Figure 4.6

Drill problem: Convert the system to state equations

numerical methods - 4.8

In some cases we will develop differential equations that cannot be directly reduced because they have more than one term at the highest order. For example, if a second-order differential equation has two second derivatives it cannot be converted to a state equation in the normal manner. In this case the two high order derivatives can be replaced with a dummy variable. In mechanical systems this often happens when masses are neglected. Consider the example problem in Figure 4.7, both ’y’ and ’u’ are first derivatives. To solve this problem, the highest order terms (’y’ and ’u’) are moved to the left of the equation. A dummy variable, ’q’, is then created to replace these two variables with a single variable. This also creates an output equation as shown in Figure 4.1.

Given the equation, 3y· + 2y = 5u· Step 1: put both the first-order derivatives on the left hand side, 3y· – 5u· = – 2y Step 2: replace the left hand side with a dummy variable, q = 3y – 5u

q· = – 2y

Step 3: solve the equation using the dummy variable, then solve for y as an output eqn. q + 5u q· = – 2y y = --------------3

Figure 4.7

Using dummy variables for multiple high order terms

At other times it is possible to eliminate redundant terms through algebraic manipulation, as shown in Figure 4.8. In this case the force on both sides of the damper is the same, so it is substituted into the equation for the cart. But, the effects on the damper must also be integrated, so a dummy variable is created for the integration. An output equation was created to calculate the value for x1.

numerical methods - 4.9

x1 F

x2

Kd M

The FBDs and equations are; · · Kd ( x1 – x2 )

F

+

∑ Fx

· · = F – Kd ( x1 – x2 ) = 0

· · Kd ( x 1 – x 2 ) = F

(1)

q = x1 – x2 Kd ( q ) = F

· · Kd ( x1 – x2 ) ·· Mx 2

Fq· = -----Kd x1 = x2 + q M

+

(2) (3)

· · ·· = K d ( x 1 – x 2 ) = Mx2 ·· F = Mx 2 · x2 = v2

∑ Fx

· Fv 2 = ---M

(4) (5)

The state equations (2, 4, 5) can be put in matrix form. The output equation (2) can also be put in matrix form. F-----q q Kd 0 0 0 d x x ----- 2 = 0 0 1 2 + 0 dt v2 0 0 0 v2 F---M

Figure 4.8

A dummy variable example

q x1 = 1 1 0 x2 + 0 v2

numerical methods - 4.10

4.3 NUMERICAL INTEGRATION Repetitive calculations can be used to develop an approximate solution to a set of differential equations. Starting from given initial conditions, the equation is solved with small time steps. Smaller time steps result in a higher level of accuracy, while larger time steps give a faster solution.

4.3.1 Numerical Integration With Tools Numerical solutions can be developed with hand calculations, but this is a very time consuming task. In this section we will explore some common tools for solving state variable equations. The analysis process follows the basic steps listed below. 1. Generate the differential equations to model the process. 2. Select the state variables. 3. Rearrange the equations to state variable form. 4. Add additional equations as required. 5. Enter the equations into a computer or calculator and solve. An example in Figure 4.9 shows the first four steps for a mass-spring-damper combination. The FBD is used to develop the differential equations for the system. The state variables are then selected, in this case the position, y, and velocity, v, of the block. The equations are then rearranged into state equations. The state equations are also put into matrix form, although this is not always necessary. At this point the equations are ready for solution.

numerical methods - 4.11

Step 1: Develop equations KS

K d y·

Ks y

Kd

M y M

My··

F

d- d- 2  --- ---F = – F – K y – K y = M ∑ y d  dt s  dt y d d 2 F + K d  ----- y + K s y + M  ----- y = 0  dt  dt

F Step 2: We need to identify state variables. In this case the height is clearly a defining variable. We will also need to use the vertical velocity, because the acceleration is a second derivative (we can only have first derivatives). Using the height, y, and velocity, v, as state variables we may now proceed to rewriting the equations. (Note: this is just an algebraic trick, but essential when setting up these matrices.) Step 3:

d-  ---y = v  dt – F – Kd v – K s y d-  ---v = -------------------------------------- dt M

Step 4: We put the equations into a state variable matrix form. d-  --- dt y

0 1 F= – K – K y + 0 ---S –1 M ---------- ---------d- v d-  ---v M M  dt

Figure 4.9

Dynamic system example

Figure 4.10 shows the method for solving state equations on a TI-86 graphing calculator. (Note: this also works on other TI-8x calculators with minor modifications.) In the example a sinusoidal input force, F, is used to make the solution more interesting. The next step is to put the equation in the form expected by the calculator. When solving with the TI calculator the state variables must be replaced with the predefined names Q1, Q2, etc. The steps that follow describe the button sequences required to enter and analyze the equations. The result is a graph that shows the solution of the equation. Points can then be taken from the graph using the cursors. (Note: large solutions can sometimes take a few minutes to solve.)

numerical methods - 4.12

First, we select some parameter values for the equations of Figure 4.9. The input force will be a decaying sine wave. d-  ---y = vy  dt – F – Kd vy – Ks y d- – 0.5t  ---v y = ---------------------------------------- = – 4e sin ( t ) – 2v y – 5y  dt M Next, the calculator requires that the state variables be Q1, Q2, ..., Q9, so we replace y with Q1 and v with Q2. Q1' = Q2 Q2' = – 4e

– 0.5t

sin ( t ) – 2Q2 – 5Q1

Now, we enter the equations into the calculator and solve. To do this roughly follow the steps below. Look at the calculator manual for additional details. 1. Put the calculator in differential equation mode [2nd][MODE][DifEq][ENTER] 2. Go to graph mode and enter the equations above [GRAPH][F1] 3. Set up the axis for the graph [GRAPH][F2] so that time and the xaxis is from 0 to 10 with a time step of 0.5, and the y height is from +3 to -3. 4. Enter the initial conditions for the system [GRAPH][F3] as Q1=0, Q2=0 5. Set the axis [GRAPH][F4] as x=t and y=Q 6. (TI-86 only) Set up the format [GRAPH][MORE][F1][FldOff][ENTER] 7. Draw the graph [GRAPH][F5] 8. Find points on the graph [GRAPH][MORE][F4]. Move the left/right cursor to move along the trace, use the up/down cursor to move between traces. Figure 4.10

Solving state equations with a TI-85 calculator

numerical methods - 4.13

First, we select some parameter values for the equations of Figure 4.9. The input force will be a decaying sine wave. d-  ---y = vy  dt – F – Kd vy – Ks y – 0.5t d-  ---v y = -----------------------------------------= – 4e sin ( t ) – 2v y – 5y  dt M Next, the calculator requires that the state variables be Q1, Q2, ..., Q9, so we replace y with Q1 and v with Q2. Q1' = Q2 Q2' = – 4e

– 0.5t

sin ( t ) – 2Q2 – 5Q1

Now, we enter the equations into the calculator and solve. To do this roughly follow the steps below. Look at the calculator manual for additional details. 1. Put the calculator in differential equation mode [2nd][MODE][DifEq][ENTER] 2. Go to graph mode and enter the equations above [GRAPH][F1] 3. Set up the axis for the graph [GRAPH][F2] so that time and the xaxis is from 0 to 10 with a time step of 0.5, and the y height is from +3 to -3. 4. Enter the initial conditions for the system [GRAPH][F3] as Q1=0, Q2=0 5. Set the axis [GRAPH][F4] as x=t and y=Q 6. (TI-86 only) Set up the format [GRAPH][MORE][F1][FldOff][ENTER] 7. Draw the graph [GRAPH][F5] 8. Find points on the graph [GRAPH][MORE][F4]. Move the left/right cursor to move along the trace, use the up/down cursor to move between traces.

UPDATE FOR TI-89

Figure 4.11

Solving state equations with a TI-89 calculator

State equations can also be solved in Mathcad using built-in functions, as shown in Figure 4.12. The first step is to enter the state equations as a function, ’D(t, Q)’, where ’t’ is the time and ’Q’ is the state variable vector. (Note: the equations are in a vector, but it is not the matrix form.) The state variables in the vector ’Q’ replace the original state variables in the equations. The ’rkfixed’ function is then used to obtain a solution. The arguments for the function, in sequence are; the state vector, the start time, the end time, the number of steps, and the state equation function. In this case the 10 second time interval is divided into 100 parts each 0.1s in duration. This time is chosen because of the general

numerical methods - 4.14

response time for the system. If the time step is too large the solution may become unstable and go to infinity. A time step that is too small will increase the computation time marginally. When in doubt, run the calculator again using a smaller time step.

Figure 4.12

Solving state variable equations with Mathcad

Note: Notice that for the TI calculators the variables start at Q1, while in Mathcad the arrays start at Q0. Many students encounter problems because they forget this.

numerical methods - 4.15

4.3.2 Numerical Integration The simplest form of numerical integration is Euler’s first-order method. Given the current value of a function and the first derivative, we can estimate the function value a short time later, as shown in Figure 4.13. (Note: Recall that the state equations allow us to calculate first-order derivatives.) The equation shown is known as Euler’s equation. Basically, using a known position and first derivative we can calculate an approximate value a short time, h, later. Notice that the function being integrated curves downward, creating an error between the actual and estimated values at time ’t+h’. If the time step, h, were smaller, the error would decrease.

y(t + h)

d y ( t + h ) ≈ y ( t ) + h ----- y ( t ) dt

d---y( t) dt

y(t)

t Figure 4.13

t+h

Note: here the h value is the time step between integrations points. A smaller time step will increase the accuracy.

First-order numerical integration

The example in Figure 4.14 shows the solution of Newton’s equation using Euler’s method. In this example we are determining velocity by integrating the acceleration caused by a force. The acceleration is put directly into Euler’s equation. This is then used to calculate values iteratively in the table. Notice that the values start before zero so that initial conditions can be used. If the system was second-order we would need two previous values for the calculations.

numerical methods - 4.16

Given the differential equation, d F = M  ----- v dt we can create difference equations using simple methods. d- F --- dt v = ---M

first rearrange equation

d v ( t + h ) = v ( t ) + h  ----- v ( t )  dt

put this in the Euler equation

F(t) v ( t + h ) = v ( t ) + h  ----------  M 

finally substitute in known terms

We can now use the equation to estimate the system response. We will assume that the system is initially at rest and that a force of 1N will be applied to the 1kg mass for 4 seconds. After this time the force will rise to 2N. A time step of 2 seconds will be used. i

t (sec)

F (N) d/dt vi

vi

-1 0 1 2 3 4 5 6 7 8

-2 0 2 4 6 8 10 12 14 16

0 1 1 2 2 2 2 2 2 2

0 0 2 4 8 12 16 20 etc

Figure 4.14

0 1 1 2 2 2 2 2 etc

First order numerical integration example

numerical methods - 4.17

Use first-order integration to solve the differential equation from 0 to 10 seconds with time steps of 1 second.

· x + 0.1x = 5

ans. x ( t + h ) = x ( t ) + h ( – 0.1x ( t ) + 5 ) x ( 10 ) =

Figure 4.15

Drill problem: Numerically integrate the differential equation

An example of solving the previous example with a traditional programming language is shown in Figure 4.16. In this example the results will be written to a text file ’out.txt’. The solution iteratively integrates from 0 to 10 seconds with time steps of 0.1s. The force value is varied over the time period with ’if’ statements. The integration is done with a separate function.

numerical methods - 4.18

double step(double, double, double); int main(){ double

h = 0.1, M = 1.0, F;

FILE *fp; double v, t; if( ( fp = fopen("out.txt", "w")) != NULL){ v = 0.0; for( t = 0.0; t < 10.0; t += h ){ if((t >= 0.0) && (t < 4.0)) F = 1.0; if(t > 4.0) F = 2.0; v = step(v, h, F/M); fprintf(fp, "%f, %f, %f\n", t, v, F, M); } } fclose(fp); } double step(double v, double h, double slope){ double v_new; v_new = v + h * slope; return v_new; }

Figure 4.16

Solving state variable equations with a C program

numerical methods - 4.19

double step(double, double, double); public class Integrate extends Object public void main() { double h = 0.1, M = 1.0, F; FileOut fp = new FileOut("out.txt"); if(fp.writeStatus != fp.IO_EXCEPTION){ double v = 0.0; for( double t = 0.0; t < 10.0; t += h ){ if((t >= 0.0) && (t < 4.0)) F = 1.0; if(t > 4.0) F = 2.0; v = step(v, h, F/M); fp.printf(fp, "%f, %f, %f\n", t, v, F, M); } fp.close(); } fclose(fp); } public double step(double v, double h, double slope){ double v_new; v_new = v + h * slope; return v_new; } }

Figure 4.17

Solving state variable equations with a Java program

The program below is for Scilab (a Matlab clone). The state variable function is defined first. This is followed by a definition of the parameters to be used for the numerical integration. Finally the function is integrated with rectangular, trapezoidal and Simpson’s rule forms.

numerical methods - 4.20

// // // // // // // // //

first_order.sce A first order integration of an accelerating mass To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 16, 2002

// System component values mass = 10; force = 100; x0 = 8; v0 = 12; X=[x0, v0];

// initial conditions

// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), force/mass]; // d/dt x = v, d/dt v = F/M endfunction

// Set the time length and step size for the integration steps = 100; t_start = 1; t_end = 100; h = (t_end - t_start) / steps;

Figure 4.18

First order integration with Scilab

numerical methods - 4.21

// // Loop for integration // for i=1:steps, X = [X ; X($,:) + h*f(X, i*h)]; end printf("The value at the end of first order integration is (x, v) = (%f, %f)\n", ... X($,1), ... X($,2));

// // Explicit equation // function x=position(x0, v0, a0, t) x = (0.5 * a0 * t^2) + (v0 * t) + x0; endfunction function v=velocity(v0, a0, t) v = (a0 * t) + v0; endfunction printf("The value with integration is (x, v) = (%f, %f)\n", ... position(x0, v0, force/mass, t_end), ... velocity(v0, force/mass, t_end));

// // // // // // // // // //

The results should be first order integration = (49710, 1002) explicit = (51208, 1012) The difference is 1498 for position and 10 for velocity. This is relatively small, but shows a clear case of the innacuracy of the numerical solutions. Note: increasing the number of steps increases the accuracy

Figure 4.19

First order integration with Scilab (continued)

4.3.3 Taylor Series First-order integration works well with smooth functions. But, when a highly curved function is encountered we can use a higher order integration equation. The Taylor series equation shown in Figure 4.20 for approximating a function. Notice that the first part of the equation is identical to Euler’s equation, but the higher order terms add accuracy.

numerical methods - 4.22

d 1 2 d 2 1 3 d 3 1 4 d 4 x ( t + h ) = x ( t ) + h  ----- x ( t ) + ----- h  ----- x ( t ) + ----- h  ----- x ( t ) + ----- h  ----- x ( t ) + … dt 2! dt 3! dt 4! dt Figure 4.20

The Taylor series

An example of the application of the Taylor series is shown in Figure 4.21. Given the differential equation, we must first determine the derivatives and substitute these into Taylor’s equation. The resulting equation is then used to iteratively calculate values.

– 20t 3 x· – x = 1 + e +t

Given

– 20t 3 d +t +x We can write,  ----- x = 1 + e dt – 20t 2 d- 2  ---+ 3t  dt x = – e – 20t d- 3  ---x = e + 6t  dt In the Taylor series this becomes, x(t + h) = x( t) + h(1 + e Thus

– 20t

3 1- h 2 ( – e – t + 3t 2 ) + ---1- h 3 ( e – t + 6t + t + x ) + ---2! 3!

x0 = 0

t (s)

x(t)

h = 0.1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

0 0

e.g., for t=0.1 1- ( 0.1 ) 2 ( – 1 ) + ---1- ( 0.1 ) 3 ( 1 ) = x ( 0 + 0.1 ) = 0 + 0.1 ( 2 ) + ---2! 3!

Figure 4.21

Integration using the Taylor series method

numerical methods - 4.23

Recall that the state variable equations are first-order equations. But, to obtain accuracy the Taylor method also requires higher order derivatives, thus making is unsuitable for use with state variable equations.

4.3.4 Runge-Kutta Integration First-order integration provides reasonable solutions to differential equations. That accuracy can be improved by using higher order derivatives to compensate for function curvature. The Runge-Kutta technique uses first-order differential equations (such as state equations) to estimate the higher order derivatives, thus providing higher accuracy without requiring other than first-order differential equations. The equations in Figure 4.22 are for fourth order Runge-Kutta integration. The function ’f()’ is the state equation or state equation vector. For each time step the values ’F1’ to ’F4’ are calculated in sequence and then used in the final equation to find the next value. The ’F1’ to ’F4’ values are calculated at different time steps, and values from previous time steps are used to ’tweak’ the estimates of the later states. The final summation equation has a remote similarity to the first order integration equation. Notice that the two central values in time are more heavily weighted.

F 1 = hf ( t, x ) F F 2 = hf  t + h---, x + ------1 2 2 F F 3 = hf  t + h---, x + ------2 2 2

Note: in this case the state equation function f(t, x) includes the state variables, x, and time, t. However, in simpler systems the state equations may not include time and it could be replaced with f(x).

F 4 = hf ( t + h, x + F 3 ) x ( t + h ) = x ( t ) + 1--- ( F1 + 2F 2 + 2F 3 + F 4 ) 6 where, x = the state variables f = the differential function or (d/dt) x t = current point in time h = the time step to the next integration point

Figure 4.22

Fourth order Runge-Kutta integration

numerical methods - 4.24

An example of a Runge-Kutta integration calculation is shown in Figure 4.23. The solution begins by putting the state equations in matrix form and defining initial conditions. After this, the four integrating factors are calculated. Finally, these are combined to get the final value after one time step. The number of calculations for a single time step should make obvious the necessity of computers and calculators.

d- x = v ---dt

y = 2 (assumed input)

d- v = 3 + 4v + 5y ---dt d- x = 0 1 x + 0 0 y ---dt v 0 4 v 5 3 1

v0 = 1 x0 = 3 h = 0.1

For the first time step,     F 1 = 0.1  0 1 3 + 0 0 2  = 0.1  1 + 0  = 0.1  0 4 1  4 5 3 1 13  1.7     3 + 0.1 ------0 1 2 0 0 2   = 0.185 F 2 = 0.1 +   5 3 1 2.04  0 4 1 + 1.7 ------  2     3 + 0.185 ------------0 1 2 0 0 2   = 0.202 F 3 = 0.1  +  5 3 1 2.108  0 4 1 + 2.04 ---------  2   F 4 = 0.1  0 1 3 + 0.202 + 0 0 2  = 0.3108  0 4 1 + 2.108 5 3 1 2.5432 xi + 1 vi + 1

=

xi

+ 1--- ( F1 + 2F 2 + 2F 3 + F 4 ) 6 vi

  = 3 + 1---  0.1 + 2 0.185 + 2 0.202 + 0.3108  = 3.1974667 6  1.7 vi + 1 1 2.04 2.108 2.5432  3.0898667 xi + 1

Figure 4.23

Runge-Kutta integration example

numerical methods - 4.25

d 2 F = M  ----- x dt

Figure 4.24

use,

Drill problem: Integrate the acceleration function

x(0) = 1 v(0) = 2 h = 0.5 s F = 10 M=1

numerical methods - 4.26

Leave the solution in variable form, and then change values to see how the system response changes.

Kd

y

M

–1 K d = 10Nsm –1 K s = 10Nm M = 1kg

Ks

Figure 4.25

y 0 = 1m

· y 0 = 0m

Drill problem: Integrate to find the system response

The program in Figure 4.26 and Figure 4.28 is used to perform a Runge-Kutta integration of a mass-spring-damper system. The ’main’ program loops through the time steps and writes the value to a file. The ’step’ function performs one timestep integration for a

numerical methods - 4.27

second order Runge-Kutta integration. It uses the functions ’add’ and ’multiply’ to manipulate the state matrix. The ’derivative’ function updates the state matrix with the new derivative values.

/* A program to do Runge Kutta integration of a mass spring damper system */ #include void void void void

multiply(double, double[], double[]); add(double[], double[], double[]); step(double, double, double[]); derivative(double, double[], double[]);

#define #define #define #define #define

SIZE Ks Kd Mass Force

int main(){ FILE

2 /* the length of the state vector */ 1000 /* the spring coefficient */ 10000 /* the damping coefficient */ 10 /* the mass coefficient */ 100 /* the applied force */

*fp;

double h = 0.001; double t; int j = 0; double X[SIZE];// create state variable list X[0] = 0;// set initial condition for x X[1] = 0;// set initial condition for v if( ( fp = fopen("out.txt", "w")) != NULL){ fprintf(fp, " t(s) x v \n\n"); for( t = 0.0; t < 50.0; t += h ){ step(t, h, X); if(j == 0) fprintf(fp, "%9.5f %9.5f %9.5f\n", t, X[0], X[1]); j++; if(j >= 10) j = 0; } } fclose(fp); }

Figure 4.26

Runge-Kutta integration C program

numerical methods - 4.28

/* First order integration done here (could be replaced with runge kutta)*/ void step(double t, double h, double X[]){ double tmp[SIZE], dX[SIZE], F1[SIZE], F2[SIZE], F3[SIZE], F4[SIZE]; /* Calculate F1 */ derivative(t, X, dX); multiply(h, dX, F1); /* Calculate F2 */ multiply(0.5, F1, tmp); add(X, tmp, tmp); derivative(t+h/2.0, tmp, dX); multiply(h, dX, F2); /* Calculate F3 */ multiply(0.5, F2, tmp); add(X, tmp, tmp); derivative(t+h/2.0, tmp, dX); multiply(h, dX, F3); /* Calculate F4 */ add(X, F3, tmp); derivative(t+h, tmp, dX); multiply(h, dX, F4); /* Calculate the weighted sum */ add(F2, F3, tmp); multiply(2.0, tmp, tmp); add(F1, tmp, tmp); add(F4, tmp, tmp); multiply(1.0/6.0, tmp, tmp); add(tmp, X, X); } /* State Equations Calculated Here */ void derivative(double t, double X[], double dX[]){ dX[0] = X[1]; dX[1] = (-Ks/Mass)*X[0] + (-Kd/Mass)*X[1] + (Force/Mass); } /* A subroutine to add vectors to simplify other equations */ void add(double X1[], double X2[], double R[]){ for(int i = 0; i < SIZE; i++) R[i] = X1[i] + X2[i]; } /* A subroutine to multiply a vector by a scalar to simplify other equations*/ void multiply(double X, double V[], double R[]){ for(int i = 0; i < SIZE; i++) R[i] = X*V[i]; }

Figure 4.27

Runge-Kutta integration C program (cont’d)

A Scilab program is given in Figure 4.28 to perform a Runge Kutta integration.

numerical methods - 4.29

// // // //

runge_kutta.sce A first order integration of an accelerating mass To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 15, 2003

// System component values mass = 10; force = 100; x0 = 8; v0 = 12; X=[x0, v0];

// initial conditions

// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), force/mass]; // d/dt x = v, d/dt v = F/M endfunction // Set the time length and step size for the integration steps = 1000; t_start = 0; t_end = 100; h = (t_end - t_start) / steps; t = [t_start]; // Loop for integration for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // print some results to compare printf("The value at the end of first order integration is (x, v) = (%f, %f)\n", ... X($,1), ... X($,2)); printf("The position (using an equation) should be %f\n", 0.5*force/mass*(t_endt_start)^2.0 + v0*(t_end - t_start) + x0); // Graph the values plot2d(t, X, [-2, -5], leg="position@velocity"); // leg - the legend titles // style - draw lines with marks // nax - grid lines for the graph xtitle('Time (s)');

Figure 4.28

Runge-Kutta integration Scilab program

4.4 SYSTEM RESPONSE In most cases the result of numerical analysis is graphical or tabular. In both cases

numerical methods - 4.30

details such as time constants and damped frequencies can be obtained by the same methods used for experimental analysis. In addition to these methods there is a technique that can determine the steady-state response of the system.

4.4.1 Steady-State Response The state equations can be used to determine the steady-state response of a system by setting the derivatives to zero, and then solving the equations. Consider the example in Figure 4.29. The solution begins with a state variable matrix. (Note: this can also be done without the matrix also.) The derivatives on the left hand side are set to zero, and the equations are rearranged and solved with Cramer’s rule.

Given the state variable form:

Set the derivatives to zero

Solve for x and v

0 1 0 d x x + ----= Ks K d Fdt v ---– ------ – ------- v M M M 0 1 0 0 = x + Ks Kd F---0 – ------ – ------- v M M M 0 1 0 x = Ks Kd F – ----– ------ – ------- v M M M

0

1 F Kd F-  ---– ----- – ------ M M M Fx = ------------------------------ = ------------ = -----K KS 0 1  -----s-  M Ks Kd – ------ – ------M M

Figure 4.29

0 0 Ks F – ------ – ----M M 0 - = 0 v = ------------------------------ = ----------K 0 1  -----s-  M Ks Kd – ------ – ------M M

Finding the steady-state response

numerical methods - 4.31

4.5 DIFFERENTIATION AND INTEGRATION OF EXPERIMENTAL DATA When doing experiments, data is often collected in the form of individual data points (not as complete functions). It is often necessary to integrate or differentiate these values. The basic equations for integrating and differentiating are shown in Figure 4.30. Given data points, y, collected at given times, t, we can integrate and differentiate using the given equations. The integral is basically the average height of the two points multiplied by the width to give an area, or integral. The first derivative is basically the slope between two points. The second derivative is the change in slope values for three points. In a computer based system the time points are often equally spaced in time, so the difference in time can be replaced with a sample period, T. Ideally the time steps would be as small as possible to increase the accuracy of the estimates.

y(t) yi + 1 yi yi – 1

ti – 1

T

ti

T

ti + 1

ti

yi + yi – 1 T  ------------------------ ( t – t ≈ y ( t ) d t ∫t i   i i – 1 ) = --2- ( y i + y i – 1 ) 2 i–1  y i – y i – 1  y i + 1 – y i d---y ( t i ) ≈  ------------------------ =  ------------------------- = --1- ( y i – y i – 1 ) = --1- ( y i + 1 – y i ) dt T T  ti – t i – 1   ti + 1 – ti  --1- ( y i + 1 – y i ) – --1- ( y i – y i – 1 ) –2 yi + yi – 1 + yi + 1 2 d- T T  --------------------------------------------------------------------------≈ = ----------------------------------------------------y ( t ) i  dt T 2 T Figure 4.30

Integration and differentiation using data points

numerical methods - 4.32

An example of numerical integration using Scilab is given in Figure 4.31 and Figure 4.32. // // // // // // // // //

integrate.sce A simple program to integrate a function To run this in Scilab use 'File' then 'Exec'. by: H. Jack Sept., 9, 2002

// define the function function foo=f(x) foo = 5 * x + 2 * log(sin(x) / x + 2); endfunction // Set the time length and step size steps = 10; x_start = 1; x_end = 10; x_delta = (x_end - x_start) / steps;

// // Loop for rectangular integration // total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; total = total + f(x); end total = total * x_delta; printf("Rectangular integration value %f\n", total);

Figure 4.31

Integration with a Scilab program

numerical methods - 4.33

// Loop for trapezoidal integration // total = 0; // set the initial sum to zero for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else total = total + 2 * f(x); end end total = total * x_delta / 2; printf("Trapezoidal integration value %f\n", total);

// // Loop for Simpson's rule integration // total = 0; // set the initial sum to zero even = 0; for i=0:steps, x = x_start + i * x_delta; if i == 0 then total = total + f(x); elseif i == steps then total = total + f(x); else even = even + 1; if even > 1 then total = total + 4 * f(x); even = 0; else total = total + 2 * f(x); end end end total = total * x_delta / 3; printf("Simpsons rule integration value %f\n", total);

Figure 4.32

Integration with a Scilab Program (cont’d)

4.6 ADVANCED TOPICS

4.6.1 Switching Functions When analyzing a system, we may need to choose an input that is more complex than inputs such as steps, ramps, sinusoids and parabolae. The easiest way to do this is to use switching functions. Switching functions turn on (have a value of 1) when their argu-

numerical methods - 4.34

ments are greater than or equal to zero, or off (a value of 0) when the argument is negative. Examples of the use of switching functions are shown in Figure 4.33. By changing the values of the arguments we can change when a function turns on or off.

u(t) 1 t u ( –t ) 1 t u(t – 1) 1 t 1 u(t + 1) 1

t

-1 u(t + 1) – u(t – 1) 1 -1 Figure 4.33

t 1

Switching function examples

These switching functions can be multiplied with other functions to create a complex function by turning parts of the function on or off. An example of a curve created with switching functions is shown in Figure 4.34.

numerical methods - 4.35

f(t) 5

t seconds 0

1

3

4

f ( t ) = 5t ( u ( t ) – ( t – 1 ) ) + 5 ( u ( t – 1 ) – u ( t – 3 ) ) + ( 20 – 5t ) ( u ( t – 3 ) – u ( t – 4 ) ) or f ( t ) = 5tu ( t ) – 5 ( t – 1 )u ( t – 1 ) – 5 ( t – 3 )u ( t – 3 ) + 5 ( t – 4 )u ( t – 4 ) Figure 4.34

Switching functions to create a non-smooth function

The unit step switching function is available in Mathcad and makes creation of complex functions relatively trivial. Step functions are also easy to implement when writing computer programs, as shown in Figure 4.35.

For the function f ( t ) = 5tu ( t ) – 5 ( t – 1 )u ( t – 1 ) – 5 ( t – 3 )u ( t – 3 ) + 5 ( t – 4 )u ( t – 4 ) double u(double t){ if(t >= 0) return 1.0; return 0.0; } double function(double t){ double f; f =

5.0 * - 5.0 - 5.0 + 5.0

t * * *

* u(t) (t - 1.0) * u(t - 1.0) (t - 3.0) * u(t - 3.0) (t - 4.0) * u(t - 4.0);

return f; }

Figure 4.35

A subroutine implementing the example in Figure 4.34

numerical methods - 4.36

4.6.2 Interpolating Tabular Data In some cases we are given tables of numbers instead of equations for a system component. These can still be used to do numerical integration by calculating coefficient values as required, in place of an equation. Tabular data consists of separate data points as seen in Figure 4.36. But, we may need values between the datapoints. A simple method for finding intermediate values is to interpolate with the "lever law". (Note: it is called this because of its’ similarity to the equation for a lever.) The table in the example only gives flow rates for a valve at 10 degree intervals, but we want flow rates at 46 and 23 degrees. A simple application of the lever law gives approximate values for the flow rates.

valve angle (deg.)

flow rate (gpm)

0 10 20 30 40 50 60 70 80 90

0 0.1 0.4 1.2 2.0 2.3 2.4 2.4 2.4 2.4

Figure 4.36

Given a valve angle of 46 degrees the flow rate is, 46 – 40 Q = 2.0 + ( 2.3 – 2.0 )  ------------------ = 2.18 50 – 40 Given a valve angle of 23 degrees the flow rate is, 23 – 20 Q = 0.4 + ( 1.2 – 0.4 )  ------------------ = 0.64 30 – 20

Using tables of values to interpolate numerical values using the lever law

The subroutine in Figure 4.37 was written to return the numerical value for the data table in Figure 4.36. In the subroutine the tabular data is examined to find the interval that the flow rate value falls inside. Once this is found the valve angle is calculated as the ratio between the two known values.

numerical methods - 4.37

#define double

SIZE 10; data[SIZE][2] = {{0.0, {10.0, {20.0, {30.0, {40.0, {50.0, {60.0, {70.0, {80.0, {90.0,

0.0}, 0.1}, 0.4}, 1.2}, 2.0}, 2.3}, 2.4}, 2.4}, 2.4}, 2.4}};

double angle(double rate){ int i; for(i = 0; i < SIZE-1; i++){ if((rate >= data[i][0]) && (rate 1 then total = total + 4 * f(x); even = 0; else total = total + 2 * f(x); end end end total = total * x_delta / 3; printf("Simpsons rule integration value %f\n", total);

numerical methods - 4.54

8. #include int main(){ int

steps = 100, i; double theta, omega, step_t, theta_last, omega_last; theta = 0.0; omega = 0.0; step_t = 1.0; for(i = 0; i < steps; i++){ theta_last = theta; omega_last = omega; theta = theta_last + step_t * omega_last; omega = omega_last + step_t*(-3 * omega_last - 9 * theta_last + 10); printf("%f %f %f \n", i+step_t, theta, omega); }

}

numerical methods - 4.55

9. a) b)

V o ( t ) = – 8.331e · Vo = Yo

– 0.6t

cos ( 1.960t – 0.238 ) + 8.095

· Y o = – 1.2Y o – 4.2V o + 34 // assign4_1.sce // by: H. Jack Sept., 23, 2003 v0 = 0; y0 = 1; X=[v0, y0];

// initial conditions

// define the state matrix function // the values returned are [x, v] function foo=f(state,t) foo = [ state($, 2), -1.2*state($,2) - 4.2*state($,1) + 34]; endfunction

// Set the time length and step size for the integration steps = 1000; t_start = 0; t_end = 10; h = (t_end - t_start) / steps; t = [t_start];

// // Loop for integration // for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // // Graph the values // plot2d(t, X, [-2, -5], leg="position@velocity"); xtitle('Time (s)'); // // Generate points from the given function // XX = [v0]; for i=1:steps, tt = i * h; XX = [XX ; -8.331 * exp(-0.6 * tt) * cos( 1.960 * tt - 0.238) + 8.095]; end plot2d(t, XX, [-4], leg="explicit");

c) The two curves produced by the scilab program overlap, so the results agree.

numerical methods - 4.56

10. · Kd x

F M

Ks x x

· ·· = F – K d x – K s x = Mx ·· · Mx + K d x + K s x = F ·· · 10x + 10x + 10x = 10 ·· · x+x+x = 1

∑F

homogeneous: ·· · x+x+x = 0 2

A +A+1 = 0 – 1 ± 1 – 4( 1 )( 1 ) 3 A = ---------------------------------------------- = – 0.5 ± j ------2(1) 2 3 – 0.5t xh = C1 e cos  ------- t + C 2 2 particular:

xp = B 0+0+B = 1 xp = 1

initial conditions: x = xh + xp = C1e

– 0.5t

3 cos  ------- t + C 2 + 1 2

3 3 3 – 0.5t – 0.5t x' = – ------- C e sin  ------- t + C 2 – 0.5C 1 e cos  ------- t + C 2 2 2 2 1 3 x' ( 0 ) = – ------- C sin ( C 2 ) – 0.5C 1 cos ( C 2 ) = 0 2 1 3 – ------- sin ( C 2 ) = 0.5 cos ( C 2 ) 2 –1 tan ( C 2 ) = ------3

–1 C 2 = atan  ------- = – 0.5236 3

x ( 0 ) = C 1 cos ( – 0.5236 ) + 1 = 0 –1 C 1 = --------------------------------- = – 1.155 cos ( –0.5236 ) x = – 1.155 e

– 0.5t

3 sin  ------- t + 1.047 + 1 2

First peak is at x=1.219, t=3.63s on graph

numerical methods - 4.57

11. a) b)

c)

g)

Ks F ·· K d · x +  ------ x +  ----- x = ----M M M – 5t N x 1 ( t ) = – 0.115e cos ( 5 3t – 0.524 ) + 0.10 K d = 100 ---m – 0.1t – 5 – 999.9t N x 1 ( t ) = – 0.1e + 10 e + 0.10 K d = 10000 ---m 0 X0 d ----= –K dt X ---------s 1 M

1 0 X0 + –Kd F------------ X 1 M M

For 100N/m: all solutions are underdamped and overshoot at; b) 0.1163 at t = 0.363s d) 0.1166 at t = 0.361s e) 0.1163 at t = 0.363s f) 0.1163 at t = 0.360s For 10000N/m: all solutions are overdamped. The time to reach the time constant (at 0.06321) is, b) 0.06321 at t = 10.001s d) 0.06321 at t = 10.000s e) 0.06321 at t = 10.000s f) 0.06321 at t = 10.0s

h)

Ns K d = 200 -----m

(verify with numerical integration also)

numerical methods - 4.58

12. b)

· x1 = v1 – K s1 K s1 · F x 1 = x 1  ----------- + x 2  -------- +  ------- M1 M1 M1 · x2 = v2 K s1 – K s1 – K s2 · x 1 = x 1  -------- + x 2  --------------------------- M2 M2

c) x1 d- v 1 ---= dt x 2 v2

0 1 – K s1 ----------- 0 M1

0 K s1 -------M1

0 0

x1 v1

0 0 0 1 x2 K s1 – K s1 – K s2 ------- 0 -------------------------- 0 v2 M2 M2

0 F ------+ M1 0 0

numerical methods - 4.59

e), f), g)

// System component values Ks1 = 100; Ks2 = 100; M1 = 1; M2 = 1; F = 1; x0 = 0; // initial conditions v0 = 0; x1 = 0; v1 = 0; X=[x0, v0, x1, v1]; // define the state matrix function the values returned are [x, v] function foo=f(state,t) foo = [ state($,2), -Ks1/M1*state($,1)+Ks1/M1*state($,3)+F/M1, state($,4), Ks1/M2*state($,1)-(Ks1+Ks2)/M2*state($,3)]; endfunction // Set the time length and step size for the integration steps = 10000; t_start = 0; t_end = 10; h = (t_end - t_start) / steps; t = [t_start]; // Loop for integration for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); F2 = h * f(X($,:) + F1/2.0, t($,:) + h/2.0); F3 = h * f(X($,:) + F2/2.0, t($,:) + h/2.0); F4 = h * f(X($,:) + F3, t($,:) + h); X = [X ; X($,:) + (F1 + 2.0*F2 + 2.0*F3 + F4)/6.0]; end // Graph the values for part e) plot2d(t, X, [-2, -5, -7, -9], leg="position1@velocity1@position2@velocity2"); xtitle('Time (s)'); // printf the values for part f) printf("\n\nPart e output\n\n"); for time_count=0:20, i = (time_count/2) / h + 1; printf("Point at t=%f x1=%f, v1=%f, x2=%f, v2=%f \n", time_count/2, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end // First order integration for part h) X=[x0, v0, x1, v1]; t = [t_start]; for i=1:steps, t = [t ; t($,:) + h]; F1 = h * f(X($,:), t($,:)); X = [X ; X($,:) + F1 ]; end printf("\n\nPart g output \n\n"); for time_count=0:20, i = (time_count/2) / h + 1; printf("Point at t=%f x1=%f, v1=%f, x2=%f, v2=%f \n", time_count/2, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end

numerical methods - 4.60

The following subroutine is used in place of the subroutine in the program shown in Figure 4.26 and Figure 4.27.

h)

// // State Equations Calculated Here // void derivative(double t, double X[], double dX[]){ dX[0] = X[1]; dX[1] = -Ks1 / M1 * X[0] + Ks1 / M1 * X[2] + Force / M1; dX[2] = X[3]; dX[3] = Ks1 / M2 * X[0] - (Ks1 + Ks2) / M2 * X[2]; }

4.11 ASSIGNMENT PROBLEMS 1. Write a Scilab program to implement the following equation to calculate the value of x. i < 100

x =



5iu ( i – 20 )

i=0

where, u(t) = 0

when

t≤0

u(t) = 1

when

t>0

2. Write a Scilab program to implement the following equation to calculate the value of x. 10

v =

F( t)

- dt ∫ --------M

M = 10

0

where, F ( t ) = 10

when

t≤5

F(t) = 0

when

t>5

numerical methods - 4.61

3. Write a Scilab program to implement the following equation to calculate the value of x. 10

x =

∫ f ( t ) dt

f ( t ) = 5 ln ( t )

0

4. Write a Scilab program to integrate the area under the function below using a numerical method, such as Simpson’s rule. Find the area from 1 to 2. sin x f ( x ) = 5x + 2 ln  ---------- x

5. Numerically integrate one time step of the differential equation below using a) first order integration and b) Runge Kutta integration. ·· · θ + 3θ + 9θ = 10 6. Convert the third order differential equation below to state equation form. With a numerical method of your choice, find the state of the system 1 second later. Show all calculations. ··· ·· · x + 4x + 2x + 5x = 10

7. The differential equation below describes a first order system that starts with an initial value of k=20. Find the state at two milliseconds using a) explicit integration, b) first order numerical integration and c) Runge-Kutta integration. For the numerical methods use a timestep of h=0.001s. ----> The final results must be put in a table for easy comparison. · k + 10k = 5

k ( 0 ) = 20

8. For the mechanism shown in the figure below the values are Ks1=Ks2=100N/m, Kd1=10Nm/s, M1=M2=1kg, F=1N. Assume that the system starts at rest, and the springs are undeformed ini-

numerical methods - 4.62

tially. x1

x2 K d1

F M1

K s1

K s2 M2

a. Derive the differential equations for the system. b. Put the equations in state variable form. c. Put the equations in state variable matrices. d. Use a calculator or Scilab using first order integration to find values for x1 and x2 over the first 10 seconds. Provide the results in a table in 1 second intervals. e. Use Scilab to plot the values for the first 10 seconds using the values obtained in part d. f. Use a Scilab program and the Runge-Kutta method to produce a graph of the first 10 seconds. g. Use a C program to produce a list of points for the first 10 seconds. h. Compare the results found in steps d, f and g in a table. 9. Explicitly solve the following differential equation. Verify the result numerically. 2 · v + 20v = 200

rotation - 5.1

5. ROTATION

Topics: • Basic laws of motion • Inertia, springs, dampers, levers, gears and belts • Design cases Objectives: • To be able to develop and analyze differential equations for rotational systems.

5.1 INTRODUCTION The equations of motion for a rotating mass are shown in Figure 5.1. Given the angular position, the angular velocity can be found by differentiating once, the angular acceleration can be found by differentiating again. The angular acceleration can be integrated to find the angular velocity, the angular velocity can be integrated to find the angular position. The angular acceleration is proportional to an applied torque, but inversely proportional to the mass moment of inertia.

equations of motion

ω =  ----- θ dt d

θ T

(2)

θ ( t ) = ∫ ω ( t ) dt =

(3)

ω ( t ) = ∫ α ( t ) dt ( t )α( t) = T --------where,

d 2

α =  ----- ω =  ----- θ dt dt d

OR

(1)

∫ ∫ α ( t ) dt dt

(4) (5)

JM

θ, ω, α = position, velocity and acceleration J M = second mass moment of inertia of the body T = torque applied to body

Figure 5.1

Basic properties of rotation

rotation - 5.2

Note: A ’torque’ and ’moment’ are equivalent in terms of calculations. The main difference is that ’torque’ normally refers to a rotating moment.

Given the initial state of a rotating mass, find the state 5 seconds later.

θ 0 = 1rad

rad s

ω 0 = 2 ---------

rad

α = 3 -------2 s

ans.

Figure 5.2

θ ( 5 ) = 86rad rad ω ( 5 ) = 17 --------s

Drill problem: Find the position with the given conditions

5.2 MODELING Free Body Diagrams (FBDs) are required when analyzing rotational systems, as they were for translating systems. The force components normally considered in a rotational system include, • inertia - opposes acceleration and deceleration • springs - resist deflection • dampers - oppose velocity • levers - rotate small angles • gears and belts - change rotational speeds and torques

rotation - 5.3

5.2.1 Inertia When unbalanced torques are applied to a mass it will begin to accelerate, in rotation. The sum of applied torques is equal to the inertia forces shown in Figure 5.3.

θ, ω, α

J T

∑T

= JM α

J M = I xx + I yy 2 I xx = ∫ y dM 2 I yy = ∫ x dM

(6) (7) (8) (9)

Note: The ’mass’ moment of inertia will be used when dealing with acceleration of a mass. Later we will use the ’area’ moment of inertia for torsional springs.

Figure 5.3

Summing moments and angular inertia

The mass moment of inertia determines the resistance to acceleration. This can be calculated using integration, or found in tables. When dealing with rotational acceleration it is important to use the mass moment of inertia, not the area moment of inertia. The center of rotation for free body rotation will be the centroid. Moment of inertia values are typically calculated about the centroid. If the object is constrained to rotate about some point, other than the centroid, the moment of inertia value must be recalculated. The parallel axis theorem provides the method to shift a moment of inertia from a centroid to an arbitrary center of rotation, as shown in Figure 5.4.

rotation - 5.4

2 J M = J˜M + Mr

where, J M = mass moment about the new point ˜ = mass moment about the center of mass JM M = mass of the object r = distance from the centroid to the new point

Figure 5.4

Parallel axis theorem for shifting a mass moment of inertia

2 J A = J˜A + Ar

where, J A = area moment about the new point J˜A = area moment about the centroid A = mass of the object r = distance from the centroid to the new point

Figure 5.5

Parallel axis theorem for shifting a area moment of inertia

Aside: If forces do not pass through the center of an object, it will rotate. If the object is made of a homogeneous material, the area and volume centroids can be used as the center. If the object is made of different materials then the center of mass should be used for the center. If the gravity varies over the length of the (very long) object then the center of gravity should be used.

An example of calculating a mass moment of inertia is shown in Figure 5.6. In this problem the density of the material is calculated for use in the integrals. The integrals are then developed using slices for the integration element dM. The integrals for the moments about the x and y axes, are then added to give the polar moment of inertia. This is then shifted from the centroid to the new axis using the parallel axis theorem.

rotation - 5.5

The rectangular shape to the right is constrained to rotate about point A. The total mass of the object is 10kg. The given dimensions are in meters. Find the mass moment of inertia.

4 -5

First find the density and calculate the moments of inertia about the centroid.

I xx =

∫–4 y

2

4

dM =

∫–4 y

2

-4

–1 y

3 4

ρ2 ( 5m ) dy = 1.25Kgm ----3 3

5 -1

10Kg –2 ρ = -------------------------------- = 0.125Kgm 2 ( 5m )2 ( 4m ) 4

-2.5

–4

3

( – 4m ) – 1 ( 4m ) 2 ∴ = 1.25Kgm  --------------- – ------------------ = 53.33Kgm  3  3 5

I yy =

∫–5 x

2

5

dM =

∫–5 x

2

–1 x

3

ρ2 ( 4m ) dx = 1Kgm ----3

3

5

–5

3

( – 5m ) – 1 ( 5m ) 2 ∴ = 1Kgm  --------------- – ------------------ = 83.33Kgm 3 3 2

2

J M = I xx + I yy = 53.33Kgm + 83.33Kgm = 136.67Kgm

2

The centroid can now be shifted to the center of rotation using the parallel axis theorem. 2 2 2 2 2 J M = J˜M + Mr = 136.67Kgm + ( 10Kg ) ( ( – 2.5m ) + ( – 1m ) ) = 209.2Kgm

Figure 5.6

Mass moment of inertia example

rotation - 5.6

The rectangular shape to the right is constrained to rotate about point A. The total mass of the object is 10kg. The given dimensions are in meters. Find the mass moment of inertia WITHOUT using the parallel axis theorem. -5

4 -2.5

5 -1 -4

ans.

Figure 5.7

Drill problem: Mass moment of inertia calculation

2

I M x = 66.33Kgm 2 I M y = 145.8Kgm 2 J M = 209.2Kgm

rotation - 5.7

The 20cm diameter 10 kg cylinder to the left is sitting in a depression that is effectively frictionless. If a torque of 10 Nm is applied for 5 seconds, what will the angular velocity be?

ans. θ ( 5s ) = 312.5rad rad ω ( 5s ) = 125 --------s Figure 5.8

Drill problem: Find the velocity of the rotating shaft

5.2.2 Springs Twisting a rotational spring will produce an opposing torque. This torque increases as the deformation increases. A simple example of a solid rod torsional spring is shown in Figure 5.9. The angle of rotation is determined by the applied torque, T, the shear modulus, G, the area moment of inertia, JA, and the length, L, of the rod. The constant parameters can be lumped into a single spring coefficient similar to that used for translational springs.

rotation - 5.8

L θ

JAG T =  ---------- θ  L 

(8)

T = K S ( ∆θ )

(9)

T Note: Remember to use radians for these calculations. In fact you are advised to use radians for all calculations. Don’t forget to set your calculator to radians also. Note: This calculation uses the area moment of inertia.

Figure 5.9

A solid torsional spring

The spring constant for a torsional spring will be relatively constant, unless the material is deformed outside the linear elastic range, or the geometry of the spring changes significantly. When dealing with strength of material properties the area moment of inertia is required. The calculation for the area moment of inertia is similar to that for the mass moment of inertia. An example of calculating the area moment of inertia is shown in Figure 5.10, and based on the previous example in Figure 5.6. The calculations are similar to those for the mass moments of inertia, except for the formulation of the integration elements. Note the difference between the mass moment of inertia and area moment of inertia for the part. The area moment of inertia can be converted to a mass moment of inertia simply by multiplying by the density. Also note the units.

rotation - 5.9

4 -5

-2.5

First, the area moment of inertia is calculated about the centroid by integration. All dimensions are in m.

5 -1 -4

4m

 4m ) 3 ( – 4m ) 3 = 10m  (-------------- – ------------------- = 426.7 3  3  – 4m 5m 3  ( 5m ) 3 ( – 5m ) 3 4 5m 2 5m 2 x x 2 ( 4m ) dx = 8m ----= 8m  --------------- – ------------------- = 666.7m I yy = ∫ x dA = ∫ – 5m –5m 3  3  3 – 5m 4 4 J˜A = I xx + I yy = ( 426.7 + 666.7 )m = 1093.4m I xx =

3 4m 2 4m 2 y----= y 2 ( 5m ) d y = 10m y d A ∫–4m ∫–4m 3

Next, shift the area moment of inertia from the centroid to the other point of rotation. 2 J A = J˜A + Ar 4 2 2 ∴ = 1093.4m + ( ( 4m – ( – 4m ) ) ( 5m – ( – 5m ) ) ) ( ( – 1m ) + ( – 2.5m ) ) ∴ = 1673m

4

Note: The basic definitions for the area moment of inertia are shown to the right.

I xx = I yy =

2

∫ y dA 2 ∫ x dA

J A = I xx + I yy 2 J A = J˜A + Ar

(8) (9) (10) (11)

Note: You may notice that when the area moment of inertia is multiplied by the density of the material, the mass moment of inertia is the result. Therefore if you have a table of area moments of inertia, multiplying by density will yield the mass moment of inertia. Keep track of units when doing this.

Figure 5.10

Area moment of inertia

rotation - 5.10

For a 1/2" 1020 steel rod that is 1 yard long, find the torsional spring coefficient.

ans.

Figure 5.11

Nm K s = 215 --------rad

Drill problem: Find the torsional spring coefficient

An example problem with torsional springs is shown in Figure 5.12. There are three torsional springs between two rotating masses. The right hand spring is anchored solidly in a wall, and will not move. A torque is applied to the left hand spring. Because the torsional spring is considered massless the torque will be the same at the other end of the spring, at mass J1. FBDs are drawn for both of the masses, and forces are summed. (Note: the similarity in the methods used for torsional, and for translational springs.) These equations are then rearranged into state variable equations, and finally put in matrix form.

rotation - 5.11

τ

J M1

K s1

J M2

K s2

K s3

Model the system above assuming that the center shaft is a torsional spring, and that a torque is applied to the leftmost disk. Leave the results in state variable form. θ1

K s2 ( θ 1 – θ 2 )

+

∑M

·· = τ – K s2 ( θ 1 – θ 2 ) = J M1 θ 1

·· J M1 θ 1 = – K s2 θ 1 + K s2 θ 2 + τ · θ1 = ω1 – K s2 K s2 · ω 1 =  ----------- θ 1 +  -------- θ 2 + τ JM JM

J M1 τ

1

θ2

K s2 ( θ 2 – θ 1 )

+

∑M

·· = – K s2 ( θ 2 – θ 1 ) – K s3 θ 2 = J M2 θ 2

– K s3 – K s2 K s2 · ω 2 =  --------------------------- θ 2 +  -------- θ 1 JM JM

K s3 θ 2

2

θ1 d- ω 1 ---= dt θ 2

ω2

Figure 5.12

0 1 – K s2 ----------- 0 J M1

0 K s2 -------J M1

0 0

θ1 ω1

0 0 0 1 θ2 – K s3 – K s2 K s2 -------- 0 -------------------------- 0 ω2 J M2 J M2

0 + τ 0 0

A rotational spring example

(2)

1

– K s3 – K s2 K s2 ·· θ 2 =  --------------------------- θ 2 +  -------- θ 1    J M2 J M 2 · θ2 = ω2

J M2

(1)

2

(3) (4)

rotation - 5.12

5.2.3 Damping Rotational damping is normally caused by viscous fluids, such as oils, used for lubrication. It opposes angular velocity with the relationships shown in Figure 5.13. The first equation is used for a system with one rotating and one stationary part. The second equation is used for damping between two rotating parts.

T = Kd ω T = Kd ( ω1 – ω2 )

Figure 5.13

The rotational damping equation

If a wheel (JM=5kg m2) is turning at 150 rpm and the damping coefficient is 1Nms/rad, what is the deceleration?

ans. rad·· θ = – 3.141 -------2 s

Figure 5.14

Drill problem: Find the deceleration

The example in Figure 5.12 is extended to include damping in Figure 5.15. The primary addition from the previous example is the addition of the damping forces to the FBDs. In this case the damping coefficients are indicated with ’B’, but ’Kd’ could have also been used. The state equations were developed in matrix form. Visual comparison of the final matrices in this and the previous example reveal that the damping terms are the

rotation - 5.13

only addition.

τ

J M1

K s1

J M2

K s2

B1

K s3

B2

Model the system above assuming that the center shaft is a torsional spring, and that a torque is applied to the leftmost disk. Leave the results in state variable form. θ1

K s2 ( θ 1 – θ 2 )

+

· B1 θ1

θ2

· ·· + ∑ M = – K s2 ( θ 2 – θ 1 ) – B 2 θ 2 – K s3 θ2 = J M 2 θ 2

K s2 ( θ 2 – θ 1 )

– K s3 – K s2 K s2 –B2 · ·· θ 2 =  --------- θ 2 +  --------------------------- θ 2 +  -------- θ 1  JM     JM  J M2 2 2 · (3) θ2 = ω2

J M2 K s3 θ 2

θ1 d- ω 1 ---= dt θ 2 ω2

– B2 – K s3 – K s2 K s2 · ω 2 =  --------- ω 2 +  --------------------------- θ 2 +  -------- θ 1 J M2 J M2 J M2

· B2 θ2 0 – K s2 ----------JM1

1 –B1 --------J M1

0 K s2 -------JM2

0

Figure 5.15

· ·· = τ – K s2 ( θ 1 – θ 2 ) – B 1 θ 1 = J M1 θ 1

·· · J M1 θ 1 = – B 1 θ 1 – K s2 θ 1 + K s2 θ 2 + τ · (1) θ1 = ω1 –B – K s2 K s2 · τ- θ +  ------- θ + ------ω 1 =  --------1- ω 1 +  --------- JM   J M  1  J M  2 J M (2) 1 1 1 1

J M1 τ

∑M

0 K s2 -------J M1

0 – K s3 – K s2 0 --------------------------J M2

0 0

θ1 ω1

1 θ2 –B2 ω 2 --------J M2

A System Example

0 τ------+ J M1 0 0

(4)

rotation - 5.14

5.2.4 Levers The lever shown in Figure 5.16 can be used to amplify forces or motion. Although theoretically a lever arm could rotate fully, it typically has a limited range of motion. The amplification is determined by the ratio of arm lengths to the left and right of the center.

F2 d1

d2 δ2

F1 δ1

F δ d1 ----- = -----2- = ----1d2 F1 δ2

Note: As the lever rotates the length ratio will be maintained because of similar triangles. This allows the lever to work over a range of angles. The lever above would become ineffective if it was vertical.

Note: The tip deflection can be related to the angle of δ1 δ - = ----2rotation of the lever if the angle of rotation is small. θ = ---d1 d2

Figure 5.16

Force transmission with a level

Given a lever set to lift a 1000 kg rock - if the lever is 2m long and the distance from the fulcrum to the rock is 10cm, how much force is required to lift it?

ans. F = 516.3N

Figure 5.17

Drill problem: Find the required force

rotation - 5.15

5.2.5 Gears and Belts While levers amplify forces and motions over limited ranges of motion, gears can rotate indefinitely. Some of the basic gear forms are listed below. Spur - Round gears with teeth parallel to the rotational axis. Rack - A straight gear (used with a small round gear called a pinion). Helical - The teeth follow a helix around the rotational axis. Bevel - The gear has a conical shape, allowing forces to be transmitted at angles. Gear teeth are carefully designed so that they will mesh smoothly as the gears rotate. The forces on gears acts at a tangential distance from the center of rotation called the pitch diameter. The ratio of motions and forces through a pair of gears is proportional to their radii, as shown in Figure 5.18. The number of teeth on a gear is proportional to the diameter. The gear ratio is used to measure the relative rotations of the shafts. For example a gear ratio of 20:1 would mean the input shaft of the gear box would have to rotate 20 times for the output shaft to rotate once.

T 1 = Fc r1

T2 = –Fc r2

Vc = ω1 r1 = –ω2 r2

n1 n ----- = ----2r1 r2

–T r n --------1- = ----1 = ----1T2 r2 n2

r –ω –α –∆ θ n ----2 = ---------1 = --------1- = ------------1 = ----2r1 ω2 α2 ∆θ 2 n1

where, n = number of teeth on respective gears r = radii of respective gears Fc = force of contact between gear teeth Vc = tangential velocity of gear teeth T = torques on gears

Figure 5.18

Basic Gear Relationships

For lower gear ratios a simple gear box with two gears can be constructed. For higher gear ratios more gears can be added. To do this, compound gear sets are required. In a compound gear set two or more gears are connected on a single shaft, as shown in Figure 5.19. In this example the gear ratio on the left is 4:1, and the ratio for the set on the right is 4:1. Together they give a gear ratio of 16:1.

rotation - 5.16

N 2 = 60 N2 N4 e = ------------- = 16 N3 N5

N 5 = 15

Output shaft

Input shaft Compound gear set

In this case the output shaft turns 16 times faster than the input shaft. If we reversed directions the output (former input) would now turn 1/16 of the input (former output) shaft speed.

N 3 = 15 N 4 = 60

Figure 5.19

A compound gear set

A manual transmission is shown in Figure 5.20. In the transmission the gear ratio is changed by sliding (left-right) some of the gears to change the sequence of gears transmitting the force. Notice that when in reverse an additional compound gear set is added to reverse the direction of rotation.

rotation - 5.17

9 clutch stem gear 2

8 7

Motor shaft reverse idler

3

4

10

11

6 5

Speed (gear)

Gear Train

1 2 3 4 reverse

2-3-6-9 2-3-5-8 2-3-4-7 bypass gear train 2-3-6-10-11-9

Figure 5.20

In this manual transmission the gear shifter will move the gears in and out of contact. At this point all of the needed gears will be meshed and turning. The final step is to engage the last gear in the gear train with the clutch (plate) and this couples the gears to the wheels.

A manual transmission

Rack and pinion gear sets are used for converting rotation to translation. A rack is a long straight gear that is driven by a small mating gear called a pinion. The basic relationships are shown in Figure 5.21.

rotation - 5.18

T = Fr

V c = ωr

∆l = r∆θ

where, r = radius of pinion F = force of contact between gear teeth Vc = tangential velocity of gear teeth and velocity of rack T = torque on pinion

Figure 5.21

Relationships for a rack and pinion gear set

Belt based systems can be analyzed with methods similar to gears (with the exception of teeth). A belt wound around a drum will act like a rack and pinion gear pair. A belt around two or more pulleys will act like gears.

A gear train has an input gear with 20 teeth, a center gear that has 100 teeth, and an output gear that has 40 teeth. If the input shaft is rotating at 5 rad/sec what is the rotation speed of the output shaft?

What if the center gear is removed? ans. rad case 1: ω 3 = 2.5 --------s rad case 2: ω 3 = – 2.5 --------s

Figure 5.22

Drill problem: Find the gear speed

rotation - 5.19

5.2.6 Friction Friction between rotating components is a major source of inefficiency in machines. It is the result of contact surface materials and geometries. Calculating friction values in rotating systems is more difficult than translating systems. Normally rotational friction will be given as static and kinetic friction torques. An example problem with rotational friction is shown in Figure 5.23. Basically these problems require that the model be analyzed as if the friction surface is fixed. If the friction force exceeds the maximum static friction the mechanism is then analyzed using the dynamic friction torque. There is friction between the shaft and the hole in the wall. The friction force is left as a variable for the derivation of the state equations. The friction value must be calculated using the appropriate state equation. The result of this calculation and the previous static or dynamic condition is then used to determine the new friction value.

rotation - 5.20

Model the system and consider the static and kinetic friction forces on the shaft on the right hand side.

JM

τ

θ Ks θ

+

JM τ FF

∑M

Ks

T s ≤ 10Nm T k = 6Nm

·· = τ – Ks θ – TF = JM θ

·· JM θ = τ – Ks θ – T F · θ = ω τ – TF Ks · ω =  -------------- +  ------ θ JM JM

(1) (2) (3)

Next, the torque force must be calculated, and then used to determine the new torque force. · J M ω = τ – K s θ – T test · T test = τ – K s θ – J M ω cases:

Not slipping previously T test ≤ 10Nm T test > 10Nm Slipping previously T test < 6Nm T test ≥ 6Nm

Figure 5.23

(4)

T F = T test T F = 6Nm T F = T test T F = 6Nm

A friction system example

The friction example in Figure 5.23 can be analyzed using the C program in Figure 5.24. For the purposes of the example some component values are selected and the system is assumed to be at rest initially. The program loops to integrate the state equations. Each loop the friction conditions are checked and then used for a first-order solution to the state equations.

rotation - 5.21

int main(){ double

int FILE

h = 0.1, /* time step */ theta, w, /* the state variables */ acceleration, /* the acceleration */ TF, /* friction force */ Ttest, /* the friction test force */ J = 10, /* the moment of inertia (I picked the value) */ tau = 5, /* the applied torque (I picked the value) */ Ks = 10; /* the spring constant (I picked the value) */ slip = 0; /* the system starts with no slip */ *fp;

theta = 0; w = 0;/* the initial conditions - starting at rest here */ TF = 0.0; /* set the initial friction to 0.0; */ acceleration = 0.0;/* set the initial acceleration to zero also */ if( ( fp = fopen("out.txt", "w")) != NULL){/* open a file to write the results */ for( t = 0.0; t < 10.0; t += h ){/* loop */ Ttest = tau - Ks*theta - J*acceleration; if(slip == 0){ /* not slipping */ if(Ttest >= 10){ TF = 6; slip = 1; } else { TF = Ttest; } } else { /* slipping */ if(Ttest < 6){ TF = Ttest; slip = 0; } else {TF = 6;} } acceleration = (tau - TF + Ks*theta) / J; w = w + h * acceleration; theta = theta + h * w; fprintf(fp, "%f, %f, %f\n", t, theta, w); } } fclose(fp); }

Figure 5.24

A C program for the friction example in Figure 5.23

rotation - 5.22

5.2.7 Permanent Magnet Electric Motors DC motors create a torque between the rotor (inside) and stator (outside) that is related to the applied voltage or current. In a permanent magnet motor there are magnets mounted on the stator, while the rotor consists of wound coils. When a voltage is applied to the coils the motor will accelerate. The differential equation for a motor is shown in Figure 5.25, and will be derived in a later chapter. The value of the constant ’K’ is a function of the motor design and will remain fixed. The value of the coil resistance ’R’ can be directly measured from the motor. The moment of inertia ’J’ should include the motor shaft, but when a load is added this should be added to the value of ’J’.

2 T load d K K    ∴ ----- ω + ω ------ = V s  ------ – ----------- JR  dt  JR JM where,

ω = the angular velocity of the motor K = the motor speed constant J M = the moment of inertia of the motor and attached loads R = the resistance of the motor coils T load = a torque applied to a motor shaft Figure 5.25

Model of a permanent magnet DC motor

The speed response of a permanent magnet DC motor is first-order. The steadystate velocity will be a straight line function of the torque applied to the motor, as shown in Figure 5.26. In addition the line shifts outwards as the voltage applied to the motor increases.

T

voltage/current increases

ω ss Figure 5.26

Torque speed curve for a permanent magnet DC motor

rotation - 5.23

5.3 OTHER TOPICS The energy and power relationships for rotational components are given in Figure 5.27. These can be useful when designing a system that will store and release energy.

(5)

E = E K + EP EK = JM ω

Figure 5.27

2

(6)

E P = Tθ

(7)

P = Tω

(8)

Energy and power relations for rotation

Note: The units for various rotational quantities are listed to the right. They may be used to check equations by doing a unit balance. The unit ’rad’ should be ignored as it appears/disappears sporadically.

coefficient units Ks

Nm-------rad

K d, B

Nms ----------rad

JM

Kgm

2

5.4 DESIGN CASE A large machine is to be driven by a permanent magnet electric motor. A 20:1 gear box is used to reduce the speed and increase the torque of the motor. The motor drives a 10000kg mass in translation through a rack and pinion gear set. The pinion has a pitch diameter of 6 inches. A 10 foot long shaft is required between the gear box and the rack and pinion set. The mass moves on rails with static and dynamic coefficients of friction of 0.2 and 0.1 respectively. We want to select a shaft diameter that will keep the system critically damped when a voltage step input of 20V is applied to the motor.

rotation - 5.24

To begin the analysis the velocity curve in Figure 5.28 was obtained experimentally by applying a voltage of 15V to the motor with no load attached. In addition the resistance of the motor coils was measured and found to be 40 ohms. The steady-state speed and time constant were used to determine the constants for the motor.

rpm 2400

R = 40Ω

0.5s  K2  d- K  T load  --- ----------------ω = + ω V   m J R s  J R- – ---------- dt m JM  M  M The steady-state velocity can be used to find the value of K. 2 rot  K  K ( 0 ) +  2400 ---------  ---------- = 15V  ---------- – ( 0 ) min  J M R JMR

rot- 1min  2400 -------------------- 2πrad ---------------- ( K ) = 15V  min 60s 1rot  15V – 3 Vs K = ---------------------------= 39.8 × 10 --------–1 rad 120πrads The time constant can be used to find the remaining parameters. 2

K 1 –1 --------= ---------- = 2s JM R 0.5s 2

Vs-  39.8 × 10 –3 ------- rad - = 0.198005 ×10-4 = 19.8 × 10 –6 Kgm 2 J = -------------------------------------------–1 ( 40Ω ) ( 2s ) T load d- –1 –1 –2  ---ω m + ω m 2s = V s ( 50.3V s rad ) – ----------------------------------------–6 2  dt 19.8 × 10 Kgm θ m' = ω m

(1) – 1 –2

ω m' = V s 50.3V s rad – ω m 2s

–1

–1

–2

– 50505Kg m T load

(2)

rotation - 5.25

Figure 5.28

Motor speed curve and the derived differential equation

The remaining equations describing the system are developed in Figure 5.29. These calculations are done with the assumption that the inertial effects of the gears and other components are insignificant.

rotation - 5.26

The long shaft must now be analyzed. This will require that angles at both ends be defined, and the shaft be considered as a spring.

θ gear, ω gear = angular position and velocity of the shaft at the gear box θ pinion, ω pinion = angular position and velocity of the shaft at the pinion 1 θ gear = ------ θ m 20

1 ω gear = ------ ω m 20

T shaft = K s ( θ gear – θ pinion ) The rotation of the pinion is related to the displacement of the rack through the circumferential travel. This ratio can also be used to find the force applied to the mass. x mass = θpinion π6in 6in T shaft = F mass  -------- 2 6in K s ( θ gear – θ pinion ) = F mass  --------  2  ·· ∑ Fmass = Fmass = Mmass xmass K s ( θ gear – θ pinion ) --------------------------------------------- = M mass θ·· pinion π6in  6in --------  2  ·· –6 –2 –1 θ pinion = ( θ gear – θ pinion )1.768 × 10 in Kg K s ·· 1 0.0254in 2 –6 – 2 –1 θ pinion =  ------ θ m – θ pinion 1.768 × 10 in Kg K s  --------------------- 20 1.0m ·· 1 –9 –2 –1 θ pinion =  ------ θ m – θ pinion ( 1.141 × 10 )m Kg K s 20 · θ pinion = ω pinion

(3)

· – 12 – 2 –1 –9 –2 –1 ω pinion = 57.1 × 10 m Kg K s θ m – 1.141 × 10 m Kg K s θ pinion

(4)

Figure 5.29

Additional equations to model the machine

If the gear box is assumed to have relatively small moment of inertia, then we can say that the torque load on the motor is equal to the torque in the shaft. This then allows

rotation - 5.27

the equation for the motor shaft to be put into a useful form, as shown in Figure 5.30. Having this differential equation now allows the numerical analysis to proceed. The analysis involves iteratively solving the equations and determining the point at which the system begins to overshoot, indicating critical damping.

The Tload term is eliminated from equation (2) · – 1 –2 –1 – 1 –2 ω m = V s 50.3V s rad – ω m 2s – 50505Kg m K s ( θgear – θ pinion ) · 1 – 1 –2 –1 – 1 –2 ω m = V s 50.3V s rad – ω m 2s – 50505Kg m K s  ------ θm – θ pinion  20  · –1 –2 –1 – 2 ω m = ( V s 50.3V s rad ) + θ pinion ( 50505Kg m K s ) –1

–1

–2

+ ω m ( – 2 s ) + θ m ( – 2525 Kg m K s ) The state equations can then be put in matrix form for clarity. The units will be eliminated for brevity, but acknowledging that they are consistent. θm d- ω m ---= dt θ pinion ω pinion

0 –2525 K s

1 –2

0 50505K s

0

0

0

57.1 × 10

– 12

0 0

θm ωm

1 θpinion –9

K s 0 – 1.141 × 10 K s 0 ω pinion

+

0 Vs 50.3 0 0

The state equations for the system are then analyzed using a computer for the parameters below to find the Ks value that gives a response that approximates critical damping for a step input from 0 to 10V. Ks (rad/Nm)

Overshoot (rad)

100

Figure 5.30

Numerical analysis of system response

These results indicate that a spring value of XXX is required to have the system

rotation - 5.28

behave as if it is critically damped. (Note: Clearly this system is not second order, but in the absence of another characteristics we approximate it as second order.)

5.5 SUMMARY • The basic equations of motion were discussed. • Mass and area moment of inertia are used for inertia and springs. • Rotational dampers and springs. • A design case was presented.

5.6 PRACTICE PROBLEMS 1. Draw the FBDs and write the differential equations for the mechanism below. The right most shaft is fixed in a wall. Τ

θ1

θ2

JM2

JM1 Ks1

Ks2 B

rotation - 5.29

2. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form.

R1

A lever arm has a force on one side, and a spring damper combination on the other side with a suspended mass.

Kd1

R2 J1

x2 F

Ks1 M1

x1

3. Draw the FBDs and write the differential equations for the mechanism below. θ2 R1 JM1

θ1 R2 JM2

Ks Kd x1 x2

M1

4. The system below consists of two masses hanging by a cable over mass ‘J’. There is a spring in the cable near M2. The cable doesn’t slip on ‘J’. a) Derive the differential equations for the following system.

rotation - 5.30

b) Convert the differential equations to state variable equations θ

R

JM

K s1

K s2 x1

M1 F M2

x2

5. Write the state equations for the system to relate the applied force ’F’ to the displacement ’x’. Note that the rotating mass also experiences a rotational damping force indicated with Kd1 K d1

F x

JM

r

θ M

K s1

K s2

K s3 K d2

6. For the system pictured below a) write the differential equations (assume small angular deflec-

rotation - 5.31

tions) and b) put the equations in state variable form.

R1

R2

R3

A round drum with a slot. The slot drives a lever arm with a suspended mass. A force is applied to a belt over the drum.

R4

J1

θ1

F1

Kd1

Ks1

M1

x1

7. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. R1

R2 J M1, N 1

x2 F1

x3

J M2, N 2

Two gears with fixed centers of rotation and lever arms.

Ks1

Kd1 M3

x1

8. For the system pictured below a) write the differential equations (assume small angular deflec-

rotation - 5.32

tions) and b) put the equations in state variable form.

A mass slides on a plane with dry kinetic friction (0.3). It is connected to a round mass that rolls and does not slip.

Kd1 Ks1 x1

M1 Ks2

x2

J M2, R 2 M2

θ3

θ2 F2

9. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form.

Kd3

A pulley system has the bottom pulley anchored. A mass is hung in the middle of the arrangement with springs and dampers on either side. Assume that the cable is always tight.

Ks3

M3 Ks2

x3 F1

R2,J2,M2 x2 θ1 R1,J1

10. For the system pictured below a) write the differential equations (assume small angular

rotation - 5.33

deflections) and b) put the equations in state variable form. M1 x1 Kd1 R1

Ks1 R2 x2 Kd2

A mass is suspended over a lever arm. Forces are applied to the lower side of the moment arm through a spring damper pair.

Ks2

F1

x3

11. For the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. R2 R1 Two gears have a force on one side, and a mass Kd1 N on the other, both sus2 N1 pended from moment arms. There is a rotaJ1 J2 tional damping on one F1 Ks1 θ1 of the gears. θ2 M1

x1

12. Find the polar moments of inertia of area and mass for a round cross section with known radius and mass per unit area. How are they related? 13. The rotational spring is connected between a mass ‘J’, and the wall where it is rigidly held. The mass has an applied torque ‘T’, and also experiences damping ‘B’. a) Derive the differential equation for the rotational system shown. b) Put the equation in state variable form (using variables) and then plot the position (not velocity) as a function of time for the first 5 seconds with your calcula-

rotation - 5.34

tor using the parameters below. Assume the system starts at rest. Nm K s = 10 --------rad

θ

Nms B = 1 ----------rad

J M = 1Kgm

2

T T = 10Nm

J

Ks

B c) A differential equation for the rotating mass with a spring and damper is given below. Solve the differential equation to get a function of time. Assume the system starts at rest. –1 –2 –2 θ'' + ( 1s )θ' + ( 10s )θ = 10s

14. Find the response as a function of time (i.e. solve the differential equation to get a function of time.). Assume the system starts undeflected and at rest. θ τ = 10Nm τ

Ks JM

Kd

J M = 1Kgm Ns K d = 3 -----m N K s = 9 ---m

2

rotation - 5.35

5.7 PRACTICE PROBLEM SOLUTIONS 1. θ1

θ2 K s1 ( θ 1 – θ 2 )

T J M1

J M2 K s1 ( θ 1 – θ 2 )

+

∑ M1

K s2 θ 2

·· = T – K s1 ( θ1 – θ 2 ) = J M1 θ 1 K s1 – K s1 T ·· - + θ2  ---------- = -------θ 1 + θ1  ------ JM   JM  J M1 1 1

+

∑ M2

· ·· = K s1 ( θ 1 – θ 2 ) – Bθ 2 – K s2 θ2 = J M 2 θ 2 K s1 + K s2 – K s1 ·· · B θ 2 + θ2  -------- + θ2  ----------------------- + θ 1  ----------- = 0 JM2 J M2 J M2

2. · x1 = v1 – K s1 K s1 · x 1 = x 1  ----------- + x 2  -------- + g M1 M1 · x2 = v2 2

2

2

 – R 2 K d1  – R 2 K s1  R 2 K s1 – FR 1 · v 2 = v 1  ------------------ + x 1  ------------------ + x 2  --------------- + ------------J1  J1   J1   J1 

· Bθ 2

rotation - 5.36

3. T1 T2 M1

J M1 gM 1

if T1,T2,Kdx1 > 0

J M2

T1

T2

–x 1 θ 1 = -------R2

x1 θ 2 = -----R1

+

∑ Fy

·· = T 1 – gM 1 = – M 1 x 2 T1 ·· x 2 = g – ------M1

+

∑ M1

·· = – T 1 R 1 + T 2 R 1 = – J M1 θ 2 T1 R1 – T2 R1 ·· θ 2 = -----------------------------J M1

+

∑ M2

· ·· = T 2 R 2 – R 2 K d x 1 = – J M2 θ 1 T2 R2 ·· · –R 2 Kd θ 1 + x 1  ---------------- = ----------- JM  JM 2

6 equations, 6 unknowns

2

· Kd x1

T1 = Ks ( x2 – x1 )

rotation - 5.37

4. θK s1 a) RT

K s2 ( x 2 – θR )

T

JM M1 RK s2 ( x 2 – θR )

F

M2 M1 g

·· ∑ FM1 = T – M1 g – F = –M1 x1 ·· ·· T = – M 1 x 1 + M 1 g + F = M 1 Rθ + M 1 g + F ·· ∑ MJ = – RT – θKs1 + RKs2 ( x2 – θR ) = JM θ

M2 g if(T < 0) T=0 if(T >= 0) Rθ = – x 1

2 2 ·· – R ( M 1 g + F ) – θ ( K s1 + R K s2 ) + ( RK s2 )x 2 = ( J M + R M 1 )θ 2

∑ FM2

–R ( M1 g + F )  K s1 + R K s2  – R K s2  ·· --------------------------- = -------------------------------+ x θ + θ  ----------------------------  2 2  JM + R2 M1   J M + R 2 M 1 JM + R M1 ·· = K s2 ( x 2 – θR ) – M 2 g = – M 2 x 2 K s2 –R K s2 ·· x 2 + x 2  -------- + θ  --------------- = g M2 M2

b)

· θ = ω 2

 – K s1 – R K s2  RK s2   – RM 1 g – RF · - + x 2  -------------------------- +  --------------------------------- ω = θ  -------------------------------- JM + R2 M1   J M + R 2 M 1  J M + R 2 M 1  · x2 = v2 RK s2 – K s2 · v 2 = θ  ------------ + x 2  ----------- + g M2 M2

(1)

(2)

rotation - 5.38

5. · θ = ω 2

– K d1 K s2 r  – K s1 – r K s2 Fr · ω = θ  -------------------------------- + ω  ------------ + x  ----------- + -----J J J J   M M M M · x = v K s2 r – K d2 – K s2 – K s3 · v = θ  ----------- + v  ------------ + x  ---------------------------  M   M    M 6. · x1 = v1 – K d1 – K s1 K d1 R 2 R 4 K s1 R2 R 4 · - + x 1  ---------- + ω 1  --------------------- + θ1  -------------------- +g v 1 = v 1  ---------- M1   M1   M1 R3   M1 R3  · θ1 = ω1 2 2

2 2

K d1 R 2 R 4 K s1 R 2 R 4  – K d1 R 2 R 4  – K s1 R2 R 4 – F 1 R 1 · - + θ 1  ----------------------- + --------------ω 1 = v 1  ---------------------- + x 1  --------------------- + ω 1  -----------------------J1 R3 J1 R3 J1  J R2   J R2  1 3

1 3

rotation - 5.39

7. θ2

θ1

· · R 2 K d1 ( x 1 – x 3 )

F1 R1 JM1 ·· J M1 θ 1

JM2 τ

θ1 N 1 = θ2 N2

N2 τ -----N1

· · K d1 ( x 1 – x 3 ) K s1 ( x 1 – x 3 )

·· J M2 θ 2 M3 R 2 K s1 ( x 1 – x 3 )

x θ 2 = -----3R2

·· M3 x1

M3g

· x1 = v1 R 2 K s1 – K d1 – K s1 R2 K d1 · v 1 = v 1  ------------ + x 1  ----------- + ω 2  --------------- + θ 1  --------------- – g  M3   M3   M3   M3  · θ2 = ω2 –N2 2 2 v 1 ( R2 K d1 ) + x 1 ( R 2 K s1 ) + ω 2 ( – R 2 K d1 ) + θ 1 ( – R2 K s1 ) + F  --------- R 1 N1 · ω 2 = ----------------------------------------------------------------------------------------------------------------------------------------------------------------2 N2 J M1 -----2- + J M2 N1

rotation - 5.40

8. · K d1 x 1

K s2 ( x 1 – x 2 )

K s1 x 1 x1 x1 µ k N -------x1

M1

·· M2 x2

K s2 ( x 1 – x 2 )

N = M 1 g cos ( θ 3 ) M 1 g sin ( θ 3 )

J M2, R 2 M2 Fc

x θ 2 = -----2R2

x2 θ2 F2 M 2 g sin ( θ 3 )

· x1 = v1 · v1 = · x2 = v2 · v2 =

9. · x2 = v2 2 2

2 2

2 2

R 1 R 2 ( 2F 1 + M 2 g ) R 1 R 2 K s2  R 1 R 2 ( – K s2 – K s3 )    · v 2 = x 3  ---------------------------------------------------------- + x 2  ---------------------------------------------------------- + ----------------------------------------------------------2 2 2 2 2 2 2 2  4J  4J 1 R 2 + J 2 R 1 + R 1 R 2 M 2 4J 1 R 22 + J 2 R 21 + R 21 R 22 M 2 · 1 R 2 + J 2 R 1 + R 1 R 2 M 2 x3 = v3 – K d3 – K s2 – K s3 K s2 · v 3 = v 3  ------------ + x 3  --------------------------- + x 2  -------- + g M3 M3 M3

rotation - 5.41

10. state equations

· x1 = v1 R1 + R 2 · v 1 = F 1  ------------------  R1 M1  – K s2 K s2 F1 · q = x 2  ----------- + x 3  --------- + --------K d2 K d1 K d2 – K s1 R 1 K s1 R1 + R2 · p = x 1  ----------- + x 2  -------------------------------- + F1  ------------------ K d1 ( R 1 + R 2 ) K d1 R 1 K d1

output equations

R1 + R 2 x 2 = ( x 1 – p )  ------------------  R1  x3 = – q + x2

11. · x1 = v1 – K s1 R 2 K s1 N 1 · v 1 = x 1  ----------- + θ 1  --------------------- + g M1 M1 N2 · θ1 = ω1 2

2

2

2

F1 R1 N2  R 2 K s1 N 1 N 2   – K d1 N 1   – R 2 K s1 N 1  · - + ω 1  ----------------------------- + θ 1  ----------------------------- + ----------------------------ω 1 = x 1  ----------------------------2 2 2 2 2 2  J 1 N 2 + J 2 N 1  J 1 N 2 + J 2 N 1  J 1 N 2 + J 2 N 1 J 1 N 22 + J 2 N 21 12. R

For area: J area

R

R

4

r = ∫ r dA = ∫ r ( 2πr dr ) = 2π ∫ r dr = 2π ---4 2

0

2

0

3

0

R

0

4

πR = --------2

MFor mass: ρ = M ----- = -------2 A πR R

J mass

R

R

4

r = ∫ r dM = ∫ r ( ρ2πr dr ) = 2πρ ∫ r dr = 2πρ ---4 2

0

2

0

3

0

R

0

4

2

πR MR = ρ  --------- = ---------- 2  2

The mass moment can be found by multiplying the area moment by the area density.

rotation - 5.42

13. T

a)

· ·· M = T – K s θ – Bθ = J M θ + ∑ ·· · J M θ + Bθ + K s θ = T Ks T ·· · B θ + θ ------ + θ ------ = -----JM JM JM

JM · Bθ

Ks θ

B T Ks · ω = ------ – ------ θ – ------ ω JM JM JM Nm Nms 10 --------1 ----------10Nm rad rad · ω = -----------------2 – -----------------2 θ – -----------------2 ω 1Kgm 1Kgm 1Kgm

θ' = ω

b)

2 1 0 5s

Nm 10θ s · ω = -------------2-  10 – --------- – --------- ω rad rad Kgm Kgm  ---------- 2 m s s-  · -  10 – 10θ --------- – -------ω = --------------------ω 2  rad rad Kgm 10θ s –2 · ω = s  10 – --------- – --------- ω  rad rad 

rotation - 5.43

(c

homogeneous: –1 · –2 ·· θ + ( 1s )θ + ( 10s )θ = 0 · At guess: θ = e At θ h = Ae h 2 At

–1

At

·· 2 At θh = A e –2

A e + ( 1s )Ae + ( 10s )e 2

–1

A + ( 1s )A + 10s –1

–2

At

= 0 –1 2

–1

= 0

–2

–2

– 1s ± ( 1s ) – 4 ( 1 ) ( 10s ) A = ------------------------------------------------------------------------------2( 1)

–2

– 1s ± 1s – 40s –1 A = ------------------------------------------------------- = ( – 0.5 ± j3.123 )s 2(1) θh = C1 e

–1

– 0.5s t

–1

cos ( 3.123s t + C 2 )

particular: –1

–2

–2

θ'' + ( 1s )θ' + ( 10s )θ = 10s · θp = 0 θp = A guess: –1

·· θp = 0

–2

( 0 ) + ( 1s ) ( 0 ) + ( 10s ) ( A ) = 10s

–2

θp = 1

–2

10s = 1 A = -----------–2 10s

Initial conditions: θ ( t ) = C1e

–1

– 0.5s t

θ ( 0 ) = C1 e

–1

cos ( 3.123s t + C 2 ) + 1

–1

– 0.5s 0

–1

cos ( 3.123s 0 + C 2 ) + 1 = 0

C 1 cos ( C 2 ) + 1 = 0 –1

θ' ( t ) = – 0.5s C 1 e

–1

– 0.5s t

–1

–1

cos ( 3.123s t + C 2 ) – 3.123s C 1 e

–1

–1

– 0.5s t

–1

θ' ( 0 ) = – 0.5s C 1 ( 1 ) cos ( C 2 ) – 3.123s C 1 ( 1 ) sin ( C 2 ) = 0 – 0.5 cos ( C 2 ) – 3.123 sin ( C 2 ) = 0 sin ( C 2 ) – 0.5------------------- = -----------= tan ( C 2 ) cos ( C 2 ) 3.123

C 2 = – 0.159

C 1 cos ( – 0.159 ) + 1 = 0

–1 C 1 = ------------------------------ = – 1.013 cos ( – 0.159 )

θ ( t ) = – 1.013 e

–1

– 0.5s t

–1

cos ( 3.123s t – 0.159 ) + 1

14. 10 27 – 1.5t θ ( t ) = ------ + ( – 1.283 )e cos  ---------- t – 0.524 9 2

–1

sin ( 3.123s t + C 2 )

rotation - 5.44

5.8 ASSIGNMENT PROBLEMS 1. for the system pictured below a) write the differential equations (assume small angular deflections) and b) put the equations in state variable form. R2 R1

θ2 N1

θ1

x2 Kd1

J1

M1

N2

x1

J2 T1

Ks1

Two gears have levers attached. On one side is a mass, the other side a spring damper pair. A torque is applied to one gear. Assume the mass remains in contact with the lever.

2. Draw FBDs for the following mechanical system containing two gears.

Ks1 J 1, R 1

J 2, R 2

y M Ks2

Kd2

rotation - 5.45

3. Draw FBDs for the following mechanical system. Consider both friction cases. τ

Ks1 J,R x Ks1 M

µ s, µ k

4. Draw FBDs for the following mechanical system. J,R Ks1 J,R y

M

Ks2

Kd2

5. Develop a differential equation of motion for the system below assuming that the cable always

rotation - 5.46

remains tight. J,R Ks1 J,R y

M

Ks2

Kd2

6. Analyze the system pictured below assuming the rope remains tight. J,R

F

F = 10N M 1 = 1kg

M1

Ks1 Kd1

M 2 = 1kg

y µk=0.2

R = 0.1m M2

θ=45 Ks2

J = 10Kgm

2

N K s1 = 100 ---m N K s2 = 100 ---m Ns K d1 = 50 -----m Ns K d2 = 50 -----m

Kd2

a) Draw FBDs and write the differential equations for the individual masses. b) Combine the equations in input-output form with y as the output and F as the input. d) Write the equations in state variable matrix form. c) Use Runge-Kutta to find the system state after 1 second.

rotation - 5.47

7. Analyze the system pictured below assuming the rope remains tight. J,R

J,R

F = 10N M 1 = 1kg M 2 = 1kg R = 0.1m J = 10Kgm

2

N K s1 = 100 ---m N K s2 = 100 ---m Ns K d1 = 50 -----m Ns K d2 = 50 -----m

J,R F

M1 Ks1 Kd1

y

M2 Ks2 Kd2

a) Draw FBDs and write the differential equations for the individual masses. b) Combine the equations in input-output form with y as the output and F as the input. c) Write the equations in state variable matrix form. d) Use Runge-Kutta to find the system state after 1 second.

input output equations - 6.1

6. INPUT-OUTPUT EQUATIONS

Topics: • The differential operator, input-output equations • Design case - vibration isolation Objectives: • To be able to develop input-output equations for mechanical systems.

6.1 INTRODUCTION To solve a set of differential equations we have two choices, solve them numerically or symbolically. For a symbolic solution the system of differential equations must be manipulated into a single differential equation. In this chapter we will look at methods for manipulating differential equations into useful forms.

6.2 THE DIFFERENTIAL OPERATOR The differential operator ’d/dt’ can be written in a number of forms. In this book there have been two forms used thus far, d/dt x and x-dot. For convenience we will add a third, ’D’. The basic definition of this operator, and related operations are shown in Figure 6.1. In basic terms the operator can be manipulated as if it is a normal variable. Multiplying by ’D’ results in a derivative, dividing by ’D’ results in an integral. The first-order axiom can be used to help solve a first-order differential equation.

input output equations - 6.2

d- x = Dx ---dt

basic definition

n n d -------- = D n dt

1- x = --D

algebraic manipulation Dx + Dy = D ( x + y ) Dx + Dy = Dy + Dx Dx + ( Dy + Dz ) = ( Dx + Dy ) + Dz n n–m D ---------x- = D x m D x--------------------( D + a )- = x (D + a)

simplification

– at at x(t) -----------------= e  ∫ x ( t )e dt + C (D + a)

first-order axiom

Figure 6.1

Note:

General properties of the differential operator

· x + Ax = y ( t ) xD + Ax = y ( t ) At

At

At

e xD + e Ax = e y ( t ) At

At

At

At

xD + Ax = y ( t ) x( D + A) = y( t) y( t) x = -------------D+A

e xD = e y ( t ) e xD = e y ( t ) At

e x = x = e

∫e

–A t 

At

y ( t )dt + C

at

  ∫ e y ( t )dt + C At

At y(t )–A t ------------= e  ∫ e y ( t )dt + C D+A

Figure 6.2

d- at at d at ---( e x ) = e ----- x + ae x dt dt

Proof of the first-order axiom

at

at

De x = e Dx + ae x

∫ x dt

input output equations - 6.3

Figure 6.3 contains an example of the manipulation of a differential equation using the ’D’ operator. The solution begins by replacing the ’d/dt’ terms with the ’D’ operator. After this the equation is rearranged to simplify the expression. Notice that the manipulation follows the normal rules of algebra.

d d- 2  ---x + ----- x + 5x = 5t  dt dt 2

D x + Dx + 5x = 5t 2

x ( D + D + 5 ) = 5t 5t x = -------------------------2 D +D+5 5  x = t  ------------------------- 2  D +D+5

Figure 6.3

An example of simplification with the differential operator

An example of the solution of a first-order differential equation is given in Figure 6.4. This begins by replacing the differential operator and rearranging the equation. The first-order axiom is then used to obtain the solution. The initial conditions are then used to calculate the coefficient values.

input output equations - 6.4

d---x + 5x = 3t dt

Given,

x ( 0 ) = 10

Dx + 5x = 3t 3t x = ------------D+5 x = e

–5 t 

x = e

∫ e

–5 t 

d- 5t 5t ---( te – e ) dt

guess,

5t

5t

= 5te + e – e 5t

3tdt + C 5t

5t

te – e 3  --------------------- + C     5

Initial conditions,

= 5te

5t

5t

d- 5t 5t 5t ---( te – e ) = 5e t dt 5t

5t

–e te -------------------= 5

∫e

5t

t dt

(0)( 1) – ( 1) x ( 0 ) = ( 1 )  3  ----------------------------- + C = 10     5 C = 10.6 x = e

–5 t 

5t

5t

te – e -  ------------------- 3  + 10.6 5

x = 0.6 ( t – 1 ) + 10.6e x = 0.6t – 0.6 + 10.6e

Figure 6.4

–5t –5t

An example of a solution for a first-order system

6.3 INPUT-OUTPUT EQUATIONS A typical system will be described by more than one differential equation. These equations can be solved to find a single differential equation that can then be integrated. The basic technique is to arrange the equations into an input-output form, such as that in Figure 6.5. These equations will have only a single output variable, and these are always shown on the left hand side. The input variables (there can be more than one) are all on the right hand side of the equation, and act as the non-homogeneous forcing function.

input output equations - 6.5

e.g.,

··· ·· · · ·· 2y 1 + y 1 + y 1 + 4y 1 = u 1 + u 1 + 3u 2 + u 3 + u 3 ·· · ·· · · y 2 + 6y 2 + y 2 = u 1 + 3u 2 + u 2 + 0.5u 2 + u 3

where, y = outputs u = inputs

Figure 6.5

Developing input-output equations

A sample derivation of an input-output equation from a system of differential equations is given in Figure 6.6. This begins by replacing the differential operator and combining the equations to eliminate one of the output variables. The solution ends by rearranging the equation to input-output form.

Given the differential equations, · · y 1 = – 3y 1 + 2y 2 + u1 + 2u 2 · · y 2 = 2y 1 + y 2 + u1

(1) (2)

Find the input-output equations. (1) Dy 1 = – 3y 1 + 2y 2 + u 1 + 2Du 2 ∴y 1 ( D + 3 ) = 2y 2 + u 1 + 2Du 2 D+3 ∴y 2 = y 1  ------------- – 0.5u 1 – Du 2 2 (2)

Dy 2 = 2y 1 + y 2 + Du 1 ∴y 2 ( D – 1 ) = 2y 1 + Du 1 D+3 ∴ y 1  ------------- – 0.5u 1 – Du2 ( D – 1 ) = 2y 1 + Du 1  2  2

D + 2D – 3 2 ∴y 1  ----------------------------- – 2 – 0.5Du 1 + 0.5u 1 – D u 2 + Du2 = Du 1 2 2

2

∴0.5D y 1 + Dy 1 – 3.5y 1 = Du 1 + 0.5Du 1 – 0.5u 1 + D u 2 – Du 2 ∴0.5y 1'' + y 1' – 3.5y 1 = u 1' + 0.5u1' – 0.5u 1 + u 2' – u 2'

Figure 6.6

An input output equation example

input output equations - 6.6

Find the second equation for the example in Figure 6.6 for the output y2.

Figure 6.7

Drill problem: Find the second equation in the previous example

6.3.1 Converting Input-Output Equations to State Equations In some instances we will want to numerically integrate an input-output equation. The example starting in Figure 6.8 shows the development of an input-output equation for two freely rolling masses joined by a spring. The final equation has a derivative on the right hand side that would prevent it from being analyzed in many cases. In particular if the input force ’F’ was a step function the first derivative would yield an undefined (infinite) value that could not be integrated.

input output equations - 6.7

x1 F

x2 Ks

M1

M2

Equations of motion can be derived for these masses. F

Ks ( x2 – x 1 )

M1

∑ Fx

2

= F + Ks ( x2 – x1 ) = M1 D x1 2

x1 ( M1 D + K s ) = F + Ks x2 Ks ( x2 – x 1 )

∑ Fx

M2

2

= –Ks ( x2 – x1 ) = M2 D x2 2

Ks x1 = x 2 ( M2 D + Ks ) The equations can be combined to eliminate x2.  Ks x 1  2 - x 1 ( M 1 D + K s ) = F + K s  ------------------------- M 2 D 2 + K s 2

2

2

2

x1 ( ( M1 D + K s ) ( M2 D + Ks ) – Ks ) = F ( M2 D + Ks ) 4

2

4

2

2

2

2

x1 ( D M1 M2 + D Ks ( M1 + M2 ) + Ks – Ks ) = F ( M 2 D + Ks ) 2

x1 ( D M1 M2 + D Ks ( M1 + M2 ) ) = F ( M2 D + Ks ) d 2 d- 4 d 2  ---x 1 M 1 M 2 +  ----- x 1 K s ( M 1 + M 2 ) =  ----- FM + FK s  dt  dt  dt 2

Figure 6.8

Writing an input-output equation as a differential equation

The equation is then converted to state variable form, including a step to calculate a second derivative of the input, as shown in Figure 6.9.

input output equations - 6.8

This can then be written in state variable form by creating dummy variables for integrating the function ’F’. d-  --- dt x 1 = v 1 d-  ---v = a1  dt 1 d-  --- dt a 1 = d 1 d-  --- dt d 1 M 1 M 2 + a 1 K s ( M 1 + M 2 ) = a F M 2 + FK s – K s ( M 1 + M 2 ) Ks  1 - d  ------------- ---- + aF  ------ d 1 = a 1  ---------------------------------+ F    M 1  M 1 M 2  dt M1 M2 The approximate value of the second derivative of a unit time step can be calculated using the time step. 1 a F0 = -----2 T 1 a F 1 = – ----2T

(when the timestep, step, it is turned on) (after the first timestep)

1 1 v F = TaF 0 + Ta F1 = T  -----2 + T  – ----2- = 0 T T 2

2

2

(to verify)

2

T T T 1 T 1 1 1 x F = ----- a F + ----- aF = -----  -----2 + -----  -----2 = --- + --- = 1 2 2 2 2 2 T  2 T  These equations can then be written in matrix form. x1 d- v 1 ---dt a 1 d1

Figure 6.9

0 1 0 0 = 0 0

0 1 0 –Ks ( M1 + M2 ) 0 0 ----------------------------------M1 M2

0 x 0 0 1 0 0 0 v1 aF + 1 0 0 a1 F Ks 1 - ------------------0 d 1 M1 M1 M2

Writing state equations for equations with derivatives

input output equations - 6.9

6.3.2 Integrating Input-Output Equations An input-output equation is already in a form suitable for normal integration techniques, with the left hand side being the homogeneous part, and the right hand side is the particular part. If the non homogeneous part includes derivatives, these determine the values of initial conditions. An example of explicitly solving such an equation is shown in Figure 6.10 and Figure 6.11.

The solution begins by evaluating the homogeneous equation. · ·· · x + 3x + 2x = 4F + 5F The solution begins by evaluating the homogeneous equation as normal. ·· · x + 3x + 2x = 0 2

A + 3A + 2 = 0 2

–3 ± 3 – 4 ( 2 ) A = ------------------------------------- = –1, – 2 2 –t – 2t xh = C1 e + C 2 e The particular solution can also be found as normal, assuming F is unit step function. Guess,

x = A

· x = 0

·· x = 0

0 + 3 ( 0 ) + 2A = 2 ( 0 ) + 5 ( 1 )

5 A = --2 The derivative in the non-homogeneous solution must now be used to find the initial conditions. However the initial position and velocity are known to be zero. 2

d d d-  ---x + 3  ----- x 0 + 2x 0 = 4  ----- F  + 5F 0  dt 0 dt dt 1 2

d- d-   --- --- dt x 0 + 3 ( 0 ) + 2 ( 0 ) = 4  dt 1 + 5 ( 0 )

for a step function 1 · u ( t ) = ----dt

2

d- d-   --- --- dt x 0 = 4  dt 1 d---x = 4 dt 0

Figure 6.10

Note: This will be used as an initial condition

Integrating an input-output equation

input output equations - 6.10

The initial conditions can then be used to find the values of the coefficients. It will be assumed that the system starts undeflected and at rest. –t

x ( t ) = C 1 e + C2 e x ( 0 ) = C1e

–0

– 2t

+ C2e

–0

5 + --2 5 + --- = 0 2

5 C 1 = – C 2 – --2

–t – 2t · x ( t ) = – C 1 e – 2C 2 e

· x ( 0 ) = – C 1 – 2C 2 = 4 5 –  – C 2 – --- – 2C 2 = 4 2

3 C 2 = – --2 3 5 C 1 = –  – --- – --- = – 1  2 2

The final equation can then be written. – t 3 – 2t 5 x ( t ) = – e – --- e + --2 2

Figure 6.11

Integrating an input-output equation (cont’d)

The example in Figure 6.10 is reconsidered with a sinusoidal input in Figure 6.12. In this case the initial acceleration is found to be non-zero. In practical terms, this can be ignored because only the initial position and velocity will be used to find the coefficients.

input output equations - 6.11

Assume a sinusoidal input, with the system initially at rest. F ( t ) = sin ( t ) F(0) = 0

· F ( t ) = cos ( t ) · F(0) = 1

· d d- 2  ---x 0 + 3  ----- x 0 + 2x 0 = 4 ( F ( 0 ) ) + 5F ( 0 )  dt dt 2

d-  --- dt x 0 + 3 ( 0 ) + 2 ( 0 ) = 4 ( 1 ) + 5 ( 0 ) 2

d-  --- dt x 0 = 4

Figure 6.12

This indicates that the acceleration will have an initial value, but it will not affect the initial position or velocity.

Initial conditions for a sinusoidal input

6.4 DESIGN CASE The classic mass-spring-damper system is shown in Figure 6.13. In this example the forces are summed to provide an equation. The differential operator is replaced, and the equation is manipulated into transfer function form. The transfer function is given in two different forms because the system is reversible and the output could be either ’F’ or ’x’.

input output equations - 6.12

2

dxd x + K s x = – M -------2∑ Fy = – F + Kd ----dt dt

Ks

Kd

2

dx d x F = M -------2- + K d ------ + K s x dt dt x

M

2

F = MD x + K d Dx + K s x F 2 --- = MD x + K d Dx + K s x x

F OR

1 --x- = ----------------------------------------2 F MD + K d D + K s

Aside: An important concept that is ubiquitous yet largely unrecognized is the use of functional design. We look at parts of systems as self contained modules that use inputs to produce outputs. Some systems (such a mechanisms) are reversible, others are not (consider a internal combustion engine, turning the crank does not produce gasoline). An input is typically something we can change, an output is the resulting change in a system. For the example above ‘F’ over ‘x’ implies that we are changing the input ‘x’, and there is some change in ‘F’. We know this could easily be reversed mathematically and practically.

Figure 6.13

A transfer function for a mechanical system

Aside: Keep in mind that the mathematical expression ‘F/x’ is a ratio between input (displacement action) and output (reaction force). When shown with differentials it is obvious that the ratio is not simple, and is a function of time. Also keep in mind that if we were given a force applied to the system it would become the input (action force) and the output would be the displacement (resulting motion). To do this all we need to do is flip the numerators and denominators in the transfer function.

Mass-spring-damper systems are often used when doing vibration analysis and design work. The first stage of such analysis involves finding the actual displacement for a given displacement or force. A system experiencing a sinusoidal oscillating force is given in Figure 6.14. Numerical values are substituted and the homogeneous solution to the equation is found.

input output equations - 6.13

Given the component values input force, M = 1Kg

N K s = 2 ---m

Ns K d = 0.5 -----m

F = 5 sin ( 6t ) N

The differential equation for the mass-spring damper system can be written. 2 dx N d x-  Ns ------1Kg 2 +  0.5 ------ ------ +  2 ---- x = 5 sin ( 6t ) N m dt m dt The homogeneous solution can be determined. 2 d x Ns dx N 1Kg -------2- +  0.5 ------ ------ +  2 ---- x = 0    m dt m dt Ns Ns 2 N – 0.5 ------ ±  0.5 ------ – 4 ( 1Kg )  2 ---- m m m A = ------------------------------------------------------------------------------------------2 ( 1Kg ) A = 0.5 ( – 0.5 ± 0.25 – 8 )s A = ( – 0.25 ± 1.392j )s xh = C1 e Figure 6.14

– 0.25t

–1

–1

cos ( 1.392t + C2 )

Explicit analysis of a mechanical system

The solution continues in Figure 6.15 where the particular solution is found and put in phase shift form.

input output equations - 6.14

The particular solution can now be found with a guess. 2 Ns dx N d x 1Kg -------2- +  0.5 ------ ------ +  2 ---- x = 5 sin ( 6t ) N m dt m dt x p = A sin 6t + B cos 6t x p' = 6A cos 6t – 6B sin 6t x p'' = – 36 A sin 6t – 36B cos 6t –36 A sin 6t – 36B cos 6t + 0.5 ( 6A cos 6t – 6B sin 6t ) + 2 ( A sin 6t + B cos 6t ) = 5 sin ( 6t ) 34 – 36B + 3A + 2B = 0 A = ------ B 3 – 36A – 3B + 2A = 5 34 – 34  ------ B – 3B = 5 3 34 5 A = ------ ( – 0.01288 ) = – 0.1460 B = ----------------------------- = – 0.01288 3 –------------------34 ( 34 )–3 3 x p = ( – 0.1460 ) sin 6t + ( – 0.01288 ) cos 6t 2

2

( – 0.1460 ) + ( – 0.01288 ) x p = ------------------------------------------------------------------- ( ( – 0.1460 ) sin 6t + ( – 0.01288 ) cos 6t ) 2 2 ( – 0.1460 ) + ( – 0.01288 ) x p = 0.1466 ( – 0.9961 sin 6t –0.08788 cos 6t ) – 0.9961 x p = 0.1466 sin  6t + atan  ----------------------  – 0.08788 x p = 0.1466 sin ( 6t + 1.483 )

Figure 6.15

Explicit analysis of a mechanical system (continued)

The system is assumed to be at rest initially, and this is used to find the constants in the homogeneous solution in Figure 6.16. Finally the displacement of the mass is used to find the force exerted through the spring on the ground. In this case there are two force frequency components at 1.392rad/s and 6rad/s. The steady-state force at 6rad/s will have a magnitude of .2932N. The transient effects have a time constant of 4 seconds (1/0.25), and should be negligible within a few seconds of starting the machine.

input output equations - 6.15

The particular and homogeneous solutions can now be combined. x = xh + xp = C1 e x' = – 0.25C 1 e

– 0.25t

– 0.25t

cos ( 1.392t + C 2 ) + 0.1466 sin ( 6t + 1.483 )

cos ( 1.392t + C 2 ) – 1.392 ( C 1 e

– 0.25t

sin ( 1.392t + C 2 ) ) + 6 ( 0.1466 cos ( 6t + 1.483 ) )

The initial conditions can be used to find the unknown constants. 0

0 = C 1 e cos ( 0 + C 2 ) + 0.1466 sin ( 0 + 1.483 ) C 1 cos ( C 2 ) = – 0.1460 – 0.1460 C 1 = -------------------cos ( C 2 ) 0

0

0 = – 0.25C 1 e cos ( 0 + C 2 ) – 1.392 ( C 1 e sin ( 0 + C 2 ) ) + 6 ( 0.1466 cos ( 0 + 1.483 ) ) 0 = – 0.25C 1 cos ( C 2 ) – 1.392 ( C 1 sin ( C 2 ) ) + 0.07713 –0.1460 – 0.1460 0 = – 0.25  -------------------- cos ( C 2 ) – 1.392  -------------------- sin ( C 2 ) + 0.07713 cos ( C 2 ) cos ( C 2 ) 0 = 0.0365 + ( 0.2032 ) tan ( C 2 ) + 0.07713 0.0365 + 0.07713 C 2 = atan  ------------------------------------------ = – 0.5099 – 0.2032 – 0.1460 C 1 = --------------------------------- = – 0.1673 cos ( –0.5099 ) x = ( – 0.1673 e

– 0.25t

cos ( 1.392t – 0.5099 ) + 0.1466 sin ( 6t + 1.483 ) )m

The displacement can then be used to calculate the force transmitted to the ground, assuming the spring is massless. F = Ks x N – 0.25t F =  2 ---- ( – 0.1673 e cos ( 1.392t – 0.5099 ) + 0.1466 sin ( 6t + 1.483 ) )m m F = ( – 0.3346 e

Figure 6.16

– 0.25t

cos ( 1.392t – 0.5099 ) + 0.2932 sin ( 6t + 1.483 ) )N

Explicit analysis of a mechanical system (continued)

A decision has been made to reduce the vibration magnitude transmitted to the ground to 0.1N. This can be done by adding a mass-spring isolator, as shown in Figure 6.17. In the figure the bottom mass-spring-damper combination is the original system. The

input output equations - 6.16

mass and spring above have been added to reduce the vibration that will reach the ground. Values must be selected for the mass and spring. The design begins by developing the differential equations for both masses.

K s2

x2

M2

Kd

K s1

M1

x1 F

– K s2 x 2

∑F

· · ·· = –K s2 x 2 – K d ( x 2 – x 1 ) – K s1 ( x 2 – x 1 ) = M 2 x 2

– K s2 x 2 – K d ( x 2 D – x1 D ) – K s1 ( x 2 – x 1 ) = M 2 x 2 D

M2 · · Kd ( x2 – x1 )

K s1 ( x 2 – x 1 )

2

2

x 2 ( – K s2 – K d D – K s1 – M 2 D ) = x 1 ( – K d D – K s1 ) 2

 K s2 + K d D + K s1 + M 2 D  x 1 = x 2  ------------------------------------------------------------- K d D + K s1   · · Kd ( x2 – x1 )

K s1 ( x 2 – x 1 )

· · ·· = K d ( x 2 – x 1 ) + K s1 ( x 2 – x 1 ) – F = M 1 x 1

K d ( x 2 D – x 1 D ) + K s1 ( x 2 – x 1 ) – F = M 1 x 1 D

M1 F

Figure 6.17

∑F

(1)

2

2

x 1 ( – K d D – K s1 – M 1 D ) + x 2 ( K d D + K s1 ) = F

(2)

Vibration isolation system

For the design we are only interested in the upper spring, as it determines the force on the ground. An input-output equation for that spring is developed in Figure 6.18. The

input output equations - 6.17

given values for the mass-spring-damper system are used. In addition a value for the upper mass is selected. This is arbitrarily chosen to be the same as the lower mass. This choice may need to be changed later if the resulting spring constant is not practical.

The solution begins by combining equations (1) and (2) and inserting the.numerical values for the lower mass, spring and damper. We can also limit the problem by selecting a mass value for the upper mass. 2

 K s2 + K d D + K s1 + M 2 D  2 x 2  ------------------------------------------------------------ ( – K d D – K s1 – M 1 D ) + x 2 ( K d D + K s1 ) = F K D + K   d s1 N Ns K s1 = 2 ---K d = 0.5 -----M 1 = 1Kg M 2 = 1Kg m m 2

 K s2 + 0.5D + 2 + D  2 x 2  ------------------------------------------------- ( – 0.5D – 2 – D ) + x 2 ( 0.5D + 2 ) = F 0.5D + 2   2

2

2

x 2 ( D + 0.5D + 2 + K s2 ) ( D – 0.5D – 2 ) + x 2 ( 0.5D + 2 ) = F ( 0.5D + 2 ) 4

2

1

x 2 ( D ( – 1 ) + D ( K s2 ) + D ( –0.5K s2 ) + ( – 2K s2 ) ) = F ( 0.5D + 2 ) This can now be converted back to a differential equation and combined with the force. d 4 d 2 d d –  ----- x + K s2  ----- x 2 – 0.5K s2  ----- x 2 – 2K s2 x 2 = 0.5  ----- F + 2F      dt 2 dt dt dt d 4 d 2 d d –  ----- x + K s2  ----- x 2 – 0.5K s2  ----- x 2 – 2K s2 x 2 = 0.5  ----- 5 sin ( 6t ) + 2 ( 5 ) sin ( 6t )  dt 2  dt  dt  dt d 2 d d 4 –  ----- x + K s2  ----- x 2 – 0.5K s2  ----- x 2 – 2K s2 x 2 = 15 cos ( 6t ) + 10 sin ( 6t )  dt  dt  dt 2 Figure 6.18

Developing an input output equation

This particular solution of the differential equation will yield the steady-state displacement of the upper mass. This can then be used to find the needed spring coefficient.

input output equations - 6.18

The particular solution begins with a guess. d 4 d 2 d –  ----- x + K s2  ----- x 2 – 0.5K s2  ----- x 2 – 2K s2 x 2 = 15 cos ( 6t ) + 10 sin ( 6t ) dt dt dt 2 x p = A sin 6t + B cos 6t d-  --- dt x p = 6A cos 6t – 6B sin 6t d- 2  ---x = – 36 A sin 6t – 36B cos 6t  dt p d- 3  ---x = – 216 A cos 6t + 216B sin 6t  dt p 4

d-  --- dt x p = 1296A sin 6t + 1296B cos 6t sin ( 6t ) ( – 1296A – 36AK s2 + 0.5K s2 6B – 2K s2 A ) = 10 sin ( 6t ) A ( – 1296 – 38K s2 ) + B ( 3K s2 ) = 10 10 + A ( 1296 + 38K s2 ) B = -----------------------------------------------------3K s2 cos ( 6t ) ( – 1296B – 36BK s2 + ( – 0.5 )K s2 6A – 2K s2 B ) = 15 cos ( 6t ) A ( – 3K s2 ) + B ( – 1296 – 38K s2 ) = 15 10 + A ( 1296 + 38K s2 ) A ( – 3K s2 ) + ------------------------------------------------------ ( – 1296 – 38K s2 ) = 15 3K s2 2

A ( – 9K s2 ) + ( 10 + A ( 1296 + 38K s2 ) ) ( – 1296 – 38K s2 ) = 45K s2 2

45K s2 – 9K s2   A  ------------------------------------------ + A ( 1296 + 38K s2 ) = ------------------------------------------ – 10 ( – 1296 – 38K s2 )  ( – 1296 – 38K s2 ) 45K s2 ----------------------------------------- – 10 ( – 1296 – 38K s2 ) A = -------------------------------------------------------------------------------------2 – 9K s2 ------------------------------------------ + ( 1296 + 38K s2 ) ( – 1296 – 38K s2 ) 45K s2 + 10 ( 1296 + 38K s2 ) A = -----------------------------------------------------------------------------------------------------2 – 9K s2 + ( 1296 + 38K s2 ) ( – 1296 – 38K s2 ) 425K 2s + 12960 A = --------------------------------------------------------------------------------2 – 1453K 2s – 98496K 2s – 1679616

Figure 6.19

Finding the particular solution

input output equations - 6.19

The value for B can then be found. 425K 2s + 12960   - ( 1296 + 38K s2 ) 10 +  -------------------------------------------------------------------------------- – 1453K 22s – 98496K 2s – 1679616 B = -----------------------------------------------------------------------------------------------------------------------------------------3K s2 2

10 ( – 1453K 2s – 98496K 2s – 1679616 ) + ( 425K 2s + 12960 ) ( 1296 + 38K s2 ) B = ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2 3K s2 ( – 1453K 2s – 98496K 2s – 1679616 ) 2

8

1620K 2s + 2.097563 ×10 K 2s B = -------------------------------------------------------------------------------------------------2 3K s2 ( – 1453K 2s – 98496K 2s – 1679616 ) 540K 2s + 69918768 B = --------------------------------------------------------------------------------2 – 1453K 2s – 98496K 2s – 1679616

Figure 6.20

Finding the particular solution (cont’d)

Finally the magnitude of the particular solution is calculated and set to the desired amplitude of 0.1N. This is then used to calculate the spring coefficient.

amplitude = 0.1 =

2

A +B

2

425K 2s + 12960 540K 2s + 69918768  2  2 - +  ----------------------------------------------------------------------------------  -------------------------------------------------------------------------------- – 1453K 22s – 98496K 2s – 1679616  – 1453K 22s – 98496K 2s – 1679616

A value for the spring coefficient was then found using Mathcad to get a value of 662N/m.

Figure 6.21

Calculation of the spring coefficient

input output equations - 6.20

6.5 SUMMARY • The differential operator can be manipulated algebraically • Equations can be manipulated into input-output forms and solved as normal differential equations

6.6 PRACTICE PROBLEMS 1. Develop the input-output equation for the mechanical system below. There is viscous damping between the block and the ground. A force is applied to cause the mass the accelerate. x F M B

2. Find the input-output form for the following equations. · y+y+x = 3 · x+x+y = 0 3. Find the input-output form for the following equations. ·· · · x 1 + x 1 + 2x 1 – x 2 – x 2 = 0 · ·· · – x1 – x1 + x2 + x2 + x2 = F 4. The following differential equations were converted to the matrix form shown. Use Cramer’s rule to find an input-output equation for ‘y’. F ·· y + 2x = -----10 · ·· 7y + 4y + 9x + 3x = 0

F y = -----10 2 ( 7D + 4 ) ( 9D + 3 ) x 0 2

(D )

(2)

input output equations - 6.21

5. Find the input output equation for y2. Ignore the effects of gravity.

K s1 y1

M1

K s2 M2

y2 F

6. Find the input-output equations for the systems below. Here the input is the torque on the left hand side. θ1

τ

θ2

J1

K s1 B1

K s2

J2

B2

7. Write the input-output equations for the mechanical system below. The input is force ‘F’, and the output is ‘y’ or the angle theta (give both equations). Include the inertia of both masses, and

input output equations - 6.22

gravity for mass ‘M’. K

θ R

JM

K

y

M F

8. The applied force ‘F’ is the input to the system, and the output is the displacement ‘x’. K1 = 500 N/m K2 = 1000 N/m

x

w

M = 10kg

F

a) Find x(t), given F(t) = 10N for t >= 0 seconds. b) Using numerical methods, find the steady-state response for an applied force of F(t) = 10cos(t + 1) N ? a) Solve the differential equation to find the explicit response for an applied force of F(t) = 10cos(t + 1) N ? d) Set the acceleration to zero and find an approximate solution for an applied force of F(t) = 10cos(t + 1) N. Compare the solution to the previous solutions.

6.7 PRACTICE PROBLEM SOLUTIONS 1.

input output equations - 6.23

F ·· · B x + x  ----- = ---- M M 2. ·· · x + 2x = –3 ·· · y + 2y = 3

3. d 3 d 2 d d d- 4  ---x + 2  ----- x + 3  ----- x +  ----- x + x 1 =  ----- F + F  dt 1 dt 1 dt 1  dt 1 dt d- 4 d- 3 d- 2 d- d- 2 d-  --- --- --- --- --- ---x + 2 x + 3 x + x + x = 2  dt 2  dt 2  dt 2  dt 2  dt F +  dt F + 2F 4. F----10

(2)

F2 2 ----( 9D + 3 ) 2 0 ( 9D + 3 ) 10 F ( 0.9D + 0.3 ) --------------------------------------------------y = -------------------------------------------------------- = -------------------------------------------------------------= 2 2 4 2 9D + 3D – 14D – 8 D ( 9D + 3 ) – 2 ( 7D + 4 ) 2 (D ) (2) 2

( 7D + 4 ) ( 9D + 3 ) 4

2

2

y ( 9D + 3D – 14D – 8 ) = F ( 0.9D + 0.3 ) d- 4 d- 2 d- 1 d- 2  --- --- --- ---y ( 9 ) + y ( 3 ) + y ( – 14 ) + y ( – 8 ) =  dt  dt  dt  dt F ( 0.9 ) + F ( 0.3 ) d 2 1 d 2 1 d 1 – 14 –8 1 d- 4  ---y +  ----- y  --- +  ----- y  --------- + y  ------ =  ----- F  ------ + F  ---  dt dt 3 dt 9 9 dt 10 3 5. K s1 K s2 d- 4 d 2 K s1 M 2 + K s2 M 2 + K s2 M 1  ---y 2 +  ----- y 2  ------------------------------------------------------------- + y 2  ----------------- =  dt  dt    M1 M2  M1 M2 M1  K s1 + K s2 d- 2  ------------- ---- + F  ---------------------F  dt  M 1 M 2  M1 M2 

input output equations - 6.24

6. d- 4 d- 3  J---------------------------d- 2  J---------------------------------------------------1 B 2 + J 2 B 1 1 K s2 + J 2 K s2 + B 1 B 2  --- --- ---- + θ θ θ + + 2 2 2  dt  dt    dt   J1 J2 J1 J2 K s2 d   B 1 K s2 + B 2 K s2  ---- θ 2 ------------------------------------ = τ -------- dt   J1 J2 J1 J2 J1 B2 + J2 B1 J 1 K s2 + J 2 K s2 + B1 B 2 d- 4 d 3 d 2  ---θ 1 +  ----- θ 1  ----------------------------- +  ----- θ 1  ----------------------------------------------------- +  dt  dt    dt   J1 J2 J1 J2 B2 K s2 1 d-  B d- 2  ---d 1 K s2 + B 2 K s2  -------------------------------------- =  ---τ - +  ----- τ  ---------- + τ  ---------- θ 1  dt    dt  J 1  dt  J 1 J 2  J 1 J 2 J1 J2

input output equations - 6.25

7. θ

R ( K ( θR ) )

∑M

·· = – R ( K ( θR ) ) + R ( K ( – y – θR ) ) = J M θ 2 2 ·· R Kθ + RKy + R Kθ = –J M θ

JM

2

R ( K ( – y – θR ) )

K ( – y – θR )

2

 2R K + J M D  θ  ---------------------------------- = y – RK  

y

∑F

·· = K ( – y – θR ) – F – Mg = My K ( y + θR ) + F + Mg = –M yD

M

2

2

θ ( KR ) + F + Mg = y ( – MD – K ) 2

θ ( KR ) + y ( MD + K ) = – F – Mg

F+Mg for the theta output equation; 2

2

 2R K + J M D  2 θ ( KR ) + θ  ---------------------------------- ( MD + K ) = – F – Mg – RK   2 2 2 2 2 θ ( – K R ) + θ ( 2R K + J M D ) ( MD + K ) = FKR + MgKR 2 2

2

2

2

2

4

2

θ ( – K R + 2R MKD + 2R K + J M MD + J M KD ) = FKR + MgKR d- 4  J----------d- 4 2 2 2 M M  ---- +  ---θ θ ( 2R M + J M ) + θ ( K R ) = FKR + MgKR  dt  KR   dt 2 2 2 2 4  2R 3 K KR  K 3 R 3 K R MgK R d- 4 d  ---  θ + ----- θ  ------------- + -------- + θ  ------------ = F ------------ + -------------------- dt  dt  J M M JMM JMM  JM M  for the y output equation;   – RK - ( KR ) + y ( MD 2 + K ) = – F – Mg y  -------------------------------- 2R2 K + J M D 2 4

2

 2 2 JM D M 2 JM D 2  y  2R MD + ------------------- + K2R + ------------- – R K = K K   2 2  2 JM D   2 JMD  – F  2R + ------------- – Mg  2R + ------------- K  K    4 2 M J J d d-  ----------2 M  ---- + y ( R2 K ) = y M - +  ----- y  2R M + ---- dt  K   dt  K J M d- 2  –--------2 2  ---F + F ( – 2 R ) + ( – 2 MgR )  dt  K  2  R 2 K 2 d- 4 d- 2  2KR 1-  --- ------------------+ + ------------ =  dt y  dt y  J M + M y  J M M   – 2 KR 2  – 2 gKR2 d- 2  – 1  -------F + F  ----------------- +  --------------------  dt  M   JM M   JM 

input output equations - 6.26

8. K1 K 2 K2 K2 ·· x + x  ----------------------------- = F  ----------------------------- + g  ------------------- M ( K1 + K 2 ) M ( K 1 + K2 ) K1 + K 2 a)

x ( t ) = – 0.2168 cos ( 5.774t ) + 0.2162

b)

x ( t ) = – 0.2168 cos ( 5.774t ) + 0.02 cos ( t + 1 ) + 0.1962

c)

x ( t ) = 0.02 cos ( t + 1 ) + 0.1962

6.8 ASSGINMENT PROBLEMS 1. Find the input-output equations for the differential equations below if both ’x’ and ’y’ are outputs. · y + y + 5x = 3 · x+x+y = 7

2. For the system pictured below find the output response as a function of time for y1 and y2 using a) integration to find an explicit function, b) numerical analysis using Scilab or C.

N K s1 = 100 ---m

K s1 y1

M1

K s2 M2

N K s2 = 1000 ---m M 2 = 0.1Kg

y2 F

M 1 = 1Kg

input output equations - 6.27

6.9 REFERENCES Irwin, J.D., and Graf, E.R., Industrial Noise and Vibration Control, Prentice Hall Publishers, 1979. Close, C.M. and Frederick, D.K., “Modeling and Analysis of Dynamic Systems, second edition, John Wiley and Sons, Inc., 1995.

circuits - 7.1

7. ELECTRICAL SYSTEMS

Topics: • Basic components; resistors, power sources, capacitors, inductors and op-amps • Device impedance • Example circuits Objectives: • To apply analysis techniques to circuits

7.1 INTRODUCTION A voltage is a pull or push acting on electrons. The voltage will produce a current when the electrons can flow through a conductor. The more freely the electrons can flow, the lower the resistance of a material. Most electrical components are used to control this flow.

7.2 MODELING Kirchoff’s voltage and current laws are shown in Figure 7.1. The node current law holds true because the current flow in and out of a node must total zero. If the sum of currents was not zero then electrons would be appearing and disappearing at that node, thus violating the law of conservation of matter. The loop voltage law states that the sum of all rises and drops around a loop must total zero.

∑ Inode = 0 ∑ Vloop = 0 Figure 7.1

node current loop voltage

Kirchoff’s laws

The simplest form of circuit analysis is for DC circuits, typically only requiring algebraic manipulation. In AC circuit analysis we consider the steady-state response to a

circuits - 7.2

sinusoidal input. Finally the most complex is transient analysis, often requiring integration, or similar techniques. • DC (Direct Current) - find the response for a constant input. • AC (Alternating Current) - find the steady-state response to an AC input. • Transient - find the initial response to changes. There is a wide range of components used in circuits. The simplest components are passive, such as resistors, capacitors and inductors. Active components are capable of changing their behaviors, such as op-amps and transistors. A list of components that will be discussed in this chapter are listed below. • resistors - reduce current flow as described with ohm’s law • voltage/current sources - deliver power to a circuit • capacitors - pass current based on current flow, these block DC currents • inductors - resist changes in current flow, these block high frequencies • op-amps - very high gain amplifiers useful in many forms

7.2.1 Resistors Resistance is a natural phenomenon found in all materials except superconductors. A resistor will oppose current flow as described by ohm’s law in Figure 7.2. The resistance value is assumed to be linear, but in actuality it varies with conductor temperature.

I V I = --R

+ V

R -

Figure 7.2

V = IR

Ohm’s law

The voltage divider example in Figure 7.3 illustrates the methods for analysis of circuits using resistors. In this circuit an input voltage is supplied on the left hand side. The output voltage on the right hand side will be some fraction of the input voltage. If the output resistance is very large, no current will flow, and the ratio of output to input voltages is determined by the ratio of the resistance between R1 and R2. To prove this the cur-

circuits - 7.3

rents into the center node are summed and set equal to zero. The equations are then manipulated to produce the final relationship.

I1 + I2 + I3 = 0 + R1

Vi – Vo 0 – Vo ∴ ----------------- + I 2 +  --------------- = 0 R1 R2

I1

Assume the output resistance is large, so I2 is negligible.

Vi I2 R2

-

I3

+ Vo -

Vi – V o – Vo ∴ ----------------- +  --------- = 0 R1 R2 1 1 1 ∴V o  ------ + ------ = V i  ------ R1 R2 R1 R 1 + R 2 1- - = V i  ----∴V o  ---------------- R 1 R2   R 1 Vo R2 ∴------ = -----------------Vi R 1 + R2

Figure 7.3

A voltage divider circuit

If two resistors are in parallel or series they can be replaced with a single equivalent resistance, as shown in Figure 7.4.

circuits - 7.4

R1 series resistors

R eq = R 1 + R 2

R2

parallel resistors R1

R2

11 1 ------= ------ + -----R eq R1 R2 1 R eq = ------------------1 1------ + ----R1 R2 R1 R 2 R eq = -----------------R1 + R2

Figure 7.4

Equivalent resistances for resistors in parallel and series

7.2.2 Voltage and Current Sources A voltage source will maintain a voltage in a circuit, by varying the current as required. A current source will supply a current to a circuit, by varying the voltage as required. The schematic symbols for voltage and current sources are shown in Figure 7.5. The supplies with ’+’ and ’-’ symbols provide DC voltages, with the symbols indicating polarity. The symbol with two horizontal lines is a battery. The circle with a sine wave is an AC voltage supply. The last symbol with an arrow inside the circle is a current supply. The arrow indicates the direction of positive current flow.

circuits - 7.5

+ V -

Figure 7.5

+ V

V+

-

V

I

-

Voltage and current sources

A circuit containing a voltage source and resistors is shown in Figure 7.6. The circuit is analyzed using the node voltage method.

Find the output voltage Vo.

R1 +

Vi

+ -

R2

R3

Vo -

Examining the circuit there are two loops, but only one node, so the node current methods is the most suitable for calculations. The currents into the upper right node, Vo, will be solved. Vo – Vi Vo Vo - + ------ + ------ = 0 = I ∑ ---------------R1 R2 R3 1 1 1 1 V o  ------ + ------ + ------ = V i  -------  R 1 R 2 R 3  R1 R2 R 3 + R1 R 3 + R 1 R2 1- - = V i  -----V o  ------------------------------------------------   R1 R 1 R2 R 3 R2 R 3 V o = Vi  -------------------------------------------------- R 2 R 3 + R1 R 3 + R 1 R2 Figure 7.6

A circuit calculation

Aside: when doing node-current methods, select currents out of a node as positive, and in as negative. This will reduce the chances of careless mistakes.

circuits - 7.6

Evaluate the circuit in Figure 7.6 using the loop voltage method.

R2 R3 V o = V i  -------------------------------------------------- R1 R2 + R1 R3 + R2 R3

Figure 7.7

Drill problem: Mesh solution of voltage divider

circuits - 7.7

Evaluate the voltage divider in Figure 7.3 using the loop current method. Hint: Put a voltage supply on the left, and an output resistor on the right. Remember that the output resistance should be infinite.

Figure 7.8

Drill problem: Mesh solution of voltage divider

Dependant (variable) current and voltage sources are shown in Figure 7.9. The voltage and current values of these supplies are determined by their relationship to some other circuit voltage or current. The dependant voltage source will be accompanied by a ’+’ and ’-’ symbol, while the current source has an arrow inside.

V = f( ) +

I = f( )

-

Figure 7.9

Dependant voltage sources

circuits - 7.8

2ohm

Ii

+ V1 -

Find the output current, Io, if Ii = 1A.

3ohm

+

Io

- V =f(V ) 2 1

f(V1) = 3V1

What if the input current is Ii = 1sin(2t)A?

Figure 7.10

Drill problem: Find the currents in the circuit above

7.2.3 Capacitors Capacitors are composed of two isolated metal plates very close together. When a voltage is applied across the capacitor, electrons will be forced into one plate, and forced out of the other plate. Temporarily this creates a small current flow until the plates reach equilibrium. So, any voltage change will result in some current flow. In practical terms this means that the capacitor will block any DC voltages, except for transient effects. But, high frequency AC currents will pass through the device. The equation for a capacitor and schematic symbols are given in Figure 7.11.

circuits - 7.9

+ +

d I = C  ----- V = CDV dt

C V

C

I

-

Figure 7.11

Capacitors

The symbol on the left is for an electrolytic capacitor. These contain a special fluid that increases the effective capacitance of the device but requires that the positive and negative sides must be observed in the circuit. (Warning: reversing the polarity on an electrolytic capacitor can make them leak, fail and possibly explode.) The other capacitor symbol is for a regular capacitor, normally with values under a microfarad.

Find the current as a function of time. + V= 5cos(10t)V

Figure 7.12

Drill problem: Current through a capacitor

C=1uF I

circuits - 7.10

7.2.4 Inductors While a capacitor will block a DC current, an inductor will pass it. Inductors are basically coils of wire. When a current flows through the coils, a magnetic field is generated. If the current through the inductor changes then the magnetic field must change, otherwise the field is maintained without effort (i.e., no voltage). Therefore the inductor resists changes in the current. The schematic symbol and relationship for an inductor are shown in Figure 7.13.

+ L

I V

d V = L  ----- I = LDI dt

-

Figure 7.13

An inductor

An inductor is normally constructed by wrapping wire in loops about a core. The core can be hollow, or be made of ferrite to increase the inductance. Inductors usually cost more than capacitors. In addition, inductors are susceptible to interference when metals or other objects disturb their magnetic fields. When possible, designers normally try to avoid using inductors in circuits.

circuits - 7.11

Find the current as a function of time. + V= 5cos(10t)V

Figure 7.14

L=1mH I

Drill problem: Current through an inductor

7.2.5 Op-Amps The ideal model of an op-amp is shown in Figure 7.15. On the left hand side are the inverting and non-inverting inputs. Both of these inputs are assumed to have infinite impedance, and so no current will flow. Op-amp application circuits are designed so that the inverting and non-inverting inputs are driven to the same voltage level. The output of the op-amp is shown on the right. In circuits op-amps are used with feedback to perform standard operations such as those listed below. • adders, subtractors, multipliers, and dividers - simple analog math operations • amplifiers - increase the amplitude of a signal • impedance isolators - hide the resistance of a circuit while passing a voltage

circuits - 7.12

I-

V+

I+ V+

Figure 7.15

Vo

Note: for analysis use, I- = I+ = 0 V- = V+

An ideal op-amp

A simple op-amp example is given in Figure 7.16. As expected both of the op-amp input voltages are the same. This is a function of the circuit design. (Note: most op-amp circuits are designed to force both inputs to have the same voltage, so it is normally reasonable to assume they are the same.) The non-inverting input is connected directly to ground, so it will force both of the inputs to 0V. When the currents are summed at the inverting input, an equation including the input and output voltages is obtained. The final equation shows the system is a simple multiplier, or amplifier. The gain of the amplifier is determined by the ratio of the input and feedback resistors.

circuits - 7.13

R2 R1 + Vi -

+

+ Vo -

The voltage at the non-inverting input will be 0V, by design the voltage at the inverting input will be the same. V + = 0V V - = V + = 0V The currents at the inverting input can be summed. V- – Vi V- – Vo ---------------- + ----------------- = 0 I = V∑ R1 R2 0 – Vi 0 – Vo -------------- + --------------- = 0 R1 R2 –R 2 Vi V o = -------------R1 –R2 V o =  --------- Vi  R1 

Figure 7.16

A simple inverting operational amplifier configuration

An op-amp circuit that can subtract signals is shown in Figure 7.17.

circuits - 7.14

R2 Find the input/output ratio, R1 + + Vi -

Figure 7.17

R5 + Vref -

R3 R4

+ Vo -

Op-amp example

For ideal op-amp problems the node voltage method is normally the best choice. The equations for the circuit in Figure 7.17 and derived in Figure 7.18. The general approach to this solution is to sum the currents into the inverting and non-inverting input nodes. Notice that the current into the op-amp is assumed to be zero. Both the inverting and non-inverting input voltages are then set to be equal. After that, algebraic manipulation results in a final expression for the op-amp. Notice that if all of the resistor values are the same then the circuit becomes a simple subtractor.

circuits - 7.15

Note: normally node voltage methods work best with op-amp circuits, although others can be used if the non-ideal op-amp model is used. First sum the currents at the inverting and non-inverting op-amp terminals. V+ – Vi V + – V o ----------------- + ------------------ = 0 I = V+ ∑ R1 R2 1 1 1 1 V +  ------ + ------ = V i  ------ + V o  ------  R 1 R 2  R 1  R 2 R1 + R2 1 1 V +  ------------------ = V i  ------ + V o  ------ R1 R2 R1 R2 R2 R1 V + = V i  ------------------ + V o  ------------------ R1 + R2 R 1 + R2

(1)

V - – V ref V- + ------ = 0 I = ∑ V- ------------------R5 R4 1 1 1 V -  ------ + ------ = V ref  ------ R4 R5 R5 R4 V - = V ref  ------------------ R4 + R5

(2)

Now the equations can be combined. V- = V+ R4 R2 R1 V ref  ------------------ = V i  ------------------ + V o  ------------------  R 4 + R 5  R 1 + R 2  R1 + R 2 R1 R2 R4 V o  ------------------ = Vi  ------------------ – V ref  ------------------  R 1 + R 2  R 1 + R 2  R 4 + R 5 R R 4 ( R 1 + R 2 ) V o = Vi  -----2- – V ref  ---------------------------- R 1 ( R 4 + R 5 )  R 1

Figure 7.18

(3)

Op-amp example (continued)

An op-amp (operational amplifier) has an extremely high gain, typically 100,000 times. The gain is multiplied by the difference between the inverting and non-inverting terminals to form an output. A typical op-amp will work for signals from DC up to about

circuits - 7.16

100KHz. When the op-amp is being used for high frequencies or large gains, the model of the op-amp in Figure 7.19 should be used. This model includes a large resistance between the inverting and non-inverting inputs. The voltage difference drives a dependent voltage source with a large gain. The output resistance will limit the maximum current that the device can produce, normally less than 100mA.

V– rn

V

+ A ( V+ – V- )

+

Figure 7.19

Vo ro

typically, r n > 1M Ω 5 A > 10 r o < 100 Ω

A non-ideal op-amp model

7.3 IMPEDANCE Circuit components can be represented in impedance form as shown in Figure 7.20. When represented this way the circuit solutions can focus on impedances, ’Z’, instead of resistances, ’R’. Notice that the primary difference is that the differential operator has been replaced. In this form we can use impedances as if they are resistances.

Device

Time domain

Impedance

Resistor

V ( t ) = RI ( t )

Z = R

Capacitor

1 V ( t ) = ---- ∫ I ( t ) dt C

1 Z = -------DC

Inductor

d V ( t ) = L ----- I ( t ) dt

Z = LD

Figure 7.20

Impedances for electrical components

Note: Impedance is like resistance, except that it includes time variant features also. V = ZI

circuits - 7.17

When representing component values with impedances the circuit solution is done as if all circuit components are resistors. An example of this is shown in Figure 7.21. Notice that the two impedances at the right (resistor and capacitor) are equivalent to two resistors in parallel, and the overall circuit is a voltage divider. The impedances are written beside the circuit elements.

DL t=0sec 50VDC

+ -

R 1/DC

+ Vo -

Find the equivalent for the capacitor and resistor in parallel. DL

50VDC

1 1 R -----------------------= ------------------ = ---------------------1 - --11 RCD + 1 ------------+ DC + --R R 1 -  ------ DC

+ -

Treat the circuit as a voltage divider, R -  -------------------- 1 + DCR R - Vo = 50V ------------------------------------------ = 50V  -----------------------------------------2  R D RLC + DL + R DL +  ---------------------- 1 + DCR Figure 7.21

A impedance example for a circuit

circuits - 7.18

7.4 EXAMPLE SYSTEMS The list of instructions below can be useful when approaching a circuits problem. The most important concept to remember is that a minute of thinking about the solution approach will save ten minutes of backtracking and fixing mistakes. 1. Look at the circuit to determine if it is a standard circuit type such as a voltage divider, current divider or an op-amp inverting amplifier. If so, use the standard solution to solve the problem. 2. Otherwise, consider the nodes and loops in the circuit. If the circuit contains fewer loops, select the current loop method. If the circuit contains fewer nodes, select the node voltage method. Before continuing, verify that the select method can be used for the circuit. 3. For the node voltage method define node voltages and current directions. For the current loop method define current loops and indicate voltage rises or drops by adding ’+’ or ’-’ signs. 4. Write the equations for the loops or nodes. 5. Identify the desired value and eliminate unwanted values using algebra techniques. 6. Use numerical values to find a final answer.

Note: The units for various electrical quantities are listed to the right. They may be used to check equations by doing a unit balance.

coefficient units C

As -----V

L

Vs -----A

R

V --A

The circuit in Figure 7.22 could be solved with two loops, or two nodes. An arbitrary decision is made to use the current loop method. The voltages around each loop are summed to provide equations for each loop.

circuits - 7.19

R1

+ V -

C

L I1

I2 + Vo -

R2

Note: when summing voltages in a loop remember to deal with sources that increase the voltage by flipping the sign. First, sum the voltages around the loops and then eliminate I1.

∑ VL1

= – V + R 1 I 1 + L ( DI 1 – DI 2 ) = 0

( R 1 + LD )I 1 = V + ( LD )I 2

(1)

V LD I 1 = -------------------- +  -------------------- I 2 R 1 + LD R 1 + LD

(2)

I2 ------- + R2 I2 = 0 V = L ( DI – DI ) + L2 2 1 ∑ CD I2 L ( DI 2 – DI 1 ) + -------- + R 2 I 2 = 0 CD 1 ( DL )I 1 =  LD + -------- + R2 I 2   CD R2   1 I 1 =  1 + --------------2 + -------- I 2 LD  CLD

Figure 7.22

(3)

(4)

Example problem

The equations in Figure 7.22 are manipulated further in Figure 7.23 to develop an input-output equation for the second current loop. This current can be used to find the current through the output resistor R2. The output voltage can then be found by multiplying the R2 and I2.

circuits - 7.20

First, sum the voltages around the loops and then eliminate I1. R2   V LD 1 I 1 = -------------------- +  -------------------- I 2 =  1 + --------------2 + -------- I 2 R 1 + LD  R 1 + LD LD  CLD R2  V 1 LD  ------------------=  1 + --------------2 + -------- – -------------------- I 2 R 1 + LD LD R 1 + LD  CLD 2

2

3

 ( CLD + 1 + CDR2 ) ( R 1 + LD ) – CL D  V ------------------=  -------------------------------------------------------------------------------------------------- I2 2 R 1 + LD   CLD 2   CLD - V I 2 =  -------------------------------------------------------------------------------------------------------------------------------- ( R 1 + LD ) ( ( CLD 2 + 1 + CDR 2 ) ( R 1 + LD ) – CL 2 D 3 ) 2   CLD - V I 2 =  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- CL ( R1 + R 2 )D 3 + L ( CR 21 + 2CR 1 R 2 + L )D 2 + R 1 ( CR1 R 2 + 2L )D + ( R 12 )

Convert it to a differential equation. 2

CL ( R 1 + R 2 )I 2''' + L ( CR1 + 2CR1 R 2 + L )I 2'' + R 1 ( CR 1 R 2 + 2L )I 2' + ( R 12 )I 2 = CLV''

Figure 7.23

Example problem (continued)

The equations can also be manipulated into state equations, as shown in Figure 7.24. In this case a dummy variable is required to replace the two first derivatives in the first equation. The dummy variable is used in place of I1, which now becomes an output variable. In the remaining state equations I1 is replaced by q1. In the final matrix form the state equations are in one matrix, and the output variable must be calculated separately.

circuits - 7.21

State equations can also be developed using equations (1) and (3). · · R 1 I 1 + LI 1 = V + LI 2 (1) becomes · · LI 1 – LI 2 = V – R 1 I 1 · · V R1 I 1 – I 2 = --- – ------ I 1 L L q1 = I1 – I2

(10)

· V R1 q 1 = --- – ------ I 1 L L (11)

I1 = q1 + I2 · V R1 q 1 = --- – ------ ( q 1 + I 2 ) L L R1 R1 · V q 1 = q 1  – ------ + I 2  – ------ + --L L L I ·· ·· · LI 2 – LI 1 + ---2- + R 2 I 2 = 0 C I2 · V – R1 I 1 + ---- + R 2 I 2 = 0 C I2 · V – R 1 ( q1 + I 2 ) + ---- = – R 2 I 2 C

(3) becomes

· 1 I 2 = I 2  – R 1 + ---- + q 1 ( – R 1 ) + V C These can be put in matrix form,

d- q 1 ---dt I 2

Figure 7.24

R1 – -----L =

R1 – -----L

1 – R 1 – R1 + ---C

q1 I2

V --+ L V

Example problem (continued)

(12)

(13)

I1 = 1 1

q1 I2

circuits - 7.22

Evaluate the circuit in Figure 7.22 using the node voltage method.

Figure 7.25

Drill problem: Use the node voltage method

circuits - 7.23

Find the equation relating the output and input voltages, Rf

Vin

Figure 7.26

C

Ri +

Drill problem: Find the state equation

Vout

circuits - 7.24

The circuit in Figure 7.27 can be evaluated as a voltage divider when the capacitor is represented as an impedance. In this case the result is a first-order differential equation.

t=0 V s = 3 cos t

C

+ -

R

+ Vo -

As normal we relate the source voltage to the output voltage. The we find the values for the various terms in the frequency domain. ZR  V o = Vs  ----------------- Z R + Z C

where,

ZR = R

1 Z C = -------DC

Next, we may combine the equations, and convert it to a differential equation.   R  V o = Vs  ------------------ 1  R + -------- DC CRD V o = Vs  ----------------------  CRD + 1 V o ( CRD + 1 ) = V s ( CRD ) · · V o ( CR ) + V o = Vs ( CR ) · 1 · V o + Vo  -------- = V s CR

Figure 7.27

Circuit solution using impedances

The first-order differential equation in Figure 7.27 is continued in Figure 7.28 where the equation is integrated. The solution is left in variable form, except for the supply voltage.

circuits - 7.25

First, write the homogeneous solution using the known relationship. t

– -------· 1 CR yields V o + Vo  -------- = 0 V = C e h 1  CR Next, the particular solution can be determined, starting with a guess.

· 1 d V o + Vo  -------- =  ----- ( 3 cos t ) = – 3 sin t CR dt V p = A sin t + B cos t V p' = A cos t – B sin t 1 ( A cos t – B sin t ) + ( A sin t + B cos t )  -------- = – 3 sin t CR 1 A + B  -------- = 0  CR –1 A = B  --------  CR 1 – B + A  -------- = – 3 CR –1 1 – B + B  --------  -------- = – 3  CR  CR 1  B  ----------- 2 2 + 1 = 3 C R 2 2  3C 2 R 2   – 1  3C R – 3 CR B = --------------------- -------- = --------------------A =  --------------------2 2 2 2  CR 2 2 1+C R 1 + C R  1+C R B 2 2 A + B sin  t + atan  ---    A  The homogeneous and particular solutions can now be combined. The system will be assumed to be at rest initially. Vp =

t – -------CR

B 2 2 + A + B sin  t + atan  ---    A  B 0 2 2 0 = C 1 e + A + B sin  0 + atan  ---  A

V 0 = Vh + V p = C1 e

B 2 2 C 1 = – A + B sin  0 + atan  ---    A 

Figure 7.28

Circuit solution using impedances (continued)

circuits - 7.26

7.5 ELECTROMECHANICAL SYSTEMS - MOTORS

7.5.1 Permanent Magnet DC Motors DC motors apply a torque between the rotor and stator that is related to the applied voltage/current. When a voltage is applied the torque will cause the rotor to accelerate. For any voltage and load on the motor there will tend to be a final angular velocity due to friction and drag in the motor. And, for a given voltage the ratio between steady-state torque and speed will be a straight line, as shown in Figure 7.29.

T

voltage/current increases

ω

Figure 7.29

Torque speed curve for a permanent magnet DC motor

The basic equivalent circuit model is shown in Figure 7.30, includes the rotational inertia of the rotor and any attached loads. On the left hand side is the resistance of the motor and the ’back emf’ dependent voltage source. On the right hand side the inertia components are shown. The rotational inertia J1 is the motor rotor, and the second inertia is an attached disk.

circuits - 7.27

R

I Voltage Supply

J1

J2

T, ω

+ Vm + -

Vs -

Because a motor is basically wires in a magnetic field, the electron flow (current) in the wire will push against the magnetic field. And, the torque (force) generated will be proportional to the current. Tm T m = KI ∴I = -----K Next, consider the power in the motor, P = V m I = Tω = KIω ∴V m = Kω Consider the dynamics of the rotating masses by summing moments.

∑M Figure 7.30

d = T m – T load = J  ----- ω dt

d ∴T m = J  ----- ω + T load dt

The torque and inertia in a basic motor model

These basic equations can be manipulated into the first-order differential equation in Figure 7.31.

The current-voltage relationship for the left hand side of the equation can be written and manipulated to relate voltage and angular velocity. Vs – V m I = -----------------R Tm V s – Kω ∴------ = -------------------R K d J  ----- ω + T load  dt V s – Kω ∴------------------------------------ = ------------------R K 2

T load d K K ∴ ----- ω + ω  ------ = Vs  ------ – -----------dt JR JR J

Figure 7.31

The first-order model of a motor

circuits - 7.28

7.5.2 Induction Motors AC induction motors are extremely common because of the low cost of construction, and compatibility with the power distribution system. The motors are constructed with windings in the stator (outside of the motor). The rotor normally has windings, or a squirrel cage. The motor does not have bushes to the rotor. The motor speed is close to, but always less than the rotating AC fields. The rotating fields generate currents, and hence opposing magnetic fields in the stator. The maximum motor speed is a function of the frequency of the AC power, and the number of pole of the machine. For example, an induction motor with three poles being used with a 60Hz AC supply would have a maximum speed of 2*(60Hz/3) = 40Hz = 2400RPM. The equivalent circuit for an AC motor is given in Figure 7.32. The slip of the motor determines the load current, IL. It is a function of the fraction, f, of full speed.

Ls

V

Rs

Lr

Lm

Rr

IL

RL

1–f R L = ---------- R r f

Figure 7.32

Basic model of an induction motor

The torque relationship for AC motors is given in Figure 7.33. These can be combined with the equivalent circuit model to determine the response of the motor to a load.

circuits - 7.29

First the torques on the motor are summed,

∑M

d = T rotor – T load = J ----- ω dt

CONTINUE TO STATE VARIABLE MODEL....

7.5.3 Brushless Servo Motors Brushless servo motors are becoming very popular because of their low maintenance requirements. The motors eliminate the need for brushes by using permanent magnets on the rotor, with windings on the stator, as shown in Figure 7.33. The windings on the stator are switched at a given frequency to produce a desired rotational speed, or held static to provide a holding torque.

Va windings on stator Vb N

Vc

Figure 7.33

The construction of a brushless servo motor

S permanent magnet rotor

circuits - 7.30

The basic relationships for brushless DC motors are given in Figure 7.34.

d V t =  R m + ----- L I m + E  dt  E = Ke ω T = Kt Im where, V t = terminal voltage across motor windings R m = resistance of a motor winding L = phase to phase inductance I m = current in winding E = back e.m.f. of motor K e = motor speed constant

ω = motor speed

K t = motor torque constant T = motor torque

Figure 7.34

Basic relationships for a brushless motor

circuits - 7.31

d T V t =  R m + ----- L ----- + K e ω dt K t dω ∑ M = T – Tload = J ---dt d T = J ----- ω + T load dt where, J = combined moments of inertia for the rotor and external loads T load = the applied torque in the system d J ----- ω + T load d dt V t =  R m + ----- L ------------------------------- + K e ω Kt dt JR m d Rm LJ d 2 L d V t = ---------- ----- ω + ------  ----- ω + ------- T load + ----- ----- T load + K e ω   K t dt K t dt Kt K t dt d 2 d d ( LJ )  ----- ω + ( JR m ) ----- ω + K e K t ω = K t V t – L ----- T load – R m T load dt dt dt Kt V Rm d Ke Kt Rm T load d- 2 d ---- ----- ω + ----------- ω = ----------t – 1--- ---T load – ------------------ω + ----- dt L dt LJ LJ J dt LJ

Figure 7.35

An advanced model of a brushless servo motor

To rotate the motor at a constant velocity the waveform in Figure 7.36 would be applied to each phase. Although each phase would be 120 degrees apart for a three pole motor. A more sophisticated motor controller design would smooth the waves more to approach a sinusoidal shape.

Vt

t(ms)

circuits - 7.32

Figure 7.36

Typical supply voltages

7.6 FILTERS Filters are useful when processing data signals. Low pass often used to eliminate noise, high pass filters eliminate static signals and leave dynamic signals. Band pass filters reject all frequencies outside a desired frequency band. A low pass filter is shown in Figure 7.37. At high frequencies the capacitor, C, has a very low impedance, and grounds the input signal. At low frequencies the capacitor impedance is high, increasing the gain of the op-amp circuit. This is easier to conceptualize if the R1-C pair are viewed as a voltage divider.

Rf

Ri + R1 + Vi -

Figure 7.37

C

+ Vo -

Low-Pass Filter

A high pass filter is shown in Figure 7.38. In this case the voltage divider in the previous circuit is reversed. In this circuit the gain will increase for signals with higher frequencies.

circuits - 7.33

Rf

Ri + C + Vi -

Figure 7.38

+ Vo -

R

High-Pass Filter

7.7 OTHER TOPICS The relationships in Figure 7.39 can be used to calculate the power and energy in a system. Notice that the power calculations focus on resistance, as resistances will dissipate power in the form of heat. Other devices, such as inductors and capacitors, store energy, but don’t dissipate it.

2

V P = IV = I R = -----R 2

Figure 7.39

E = Pt

Electrical power and energy

7.8 SUMMARY • Basic circuit components are resistors, capacitors, inductors op-amps. • node and loop methods can be used to analyze circuits.

circuits - 7.34

• Capacitor and inductor impedances can be used as resistors in calculations.

7.9 PRACTICE PROBLEMS 1. Derive the equations for combined values for resistors, capacitors and inductors in series and parallel. 2. Find the output voltage as a function of input voltage. R

R +

Vi

+ -

R

Vo

R

-

3. Write the differential equation for the following circuit. L

R +

Vi + -

C

Vo -

4. Consider the following circuit. +

L Vi

+

C

-

Vo

R -

a) Develop a differential equation for the circuit. b) Put the equation in state variable matrix form.

circuits - 7.35

5. Develop differential equations and the input-output equation for the electrical system below. R1 Vi

+ -

+ C

L

Vo

R2 -

6. Consider the following circuit. Develop a differential equation for the circuit. L Vi

R1

+

+

C R2

-

R3

Vo -

7. Find the input-output equation for the circuit below, and then find the natural frequency and damping coefficient.

R1 R2

Vi

C

L

+ -

+ Vo -

8. a) Find the differential equation for the circuit below where the input is Vi, and the output is Vo. L +

Vi + -

C

R

Vo -

b) Convert the equation to an input-output equation.

circuits - 7.36

c) Solve the differential equation found in part b) using the numerical values given below. Assume at time t=0, the circuit has the voltage Vo and the first derivative shown below. L = 10mH C = 1µF R = 1KΩ V i = 10V V at t=0s V o = 2V V o ′ = 3 --s 9. a) Write the differential equations for the system pictured below. b) Put the equations in input-output form. R2 R1

Vi

-

Vo

+

C

10. Given the circuit below, find the ratio of the output over the input (this is also known as a transfer function). Simplify the results. R2 Vi

R1

C +

Vo

circuits - 7.37

11. Examine the following circuit and then derive the differential equation. L

R2

R1 +

+

Vi

+ Vo

-

-

12. Examine the following circuit and then derive the differential equation.

L R2 R1 +

+

Vi

+ Vo

-

-

13. a) Find the differential equation for the circuit below. 1000Ω 1µF 0.001H

1000Ω +

Vi

+ -

+ 10Ω

Vo -

circuits - 7.38

b) Put the differential equation in state variable form and a numerical method to produce a detailed sketch of the output voltage Vo. Assume the system starts at rest, and the input is Vi=5V. 14. a) Write the differential equations for the system pictured below. b) Put the equations in state variable form. c) Use numerical methods to find the ratio between input and output voltages for a range of frequencies. The general method is put in a voltage such as Vi=1sin(___t), and see what the magnitude of the output is. Divide the magnitude of the output sine wave by the input magnitude. Note: This should act as a high pass or low pass filter. d) Plot a graph of gain against the frequency of the input. R2 R1

Vi

C

Vo

+

C=1uF R1=1K R2=1K

7.10 PRACTICE PROBLEM SOLUTIONS 1. R1 R 2 R parallel = -----------------R1 + R2

R series = R 1 + R 2

C 1 C2 C series = ------------------C1 + C 2

C parallel = C 1 + C 2

L1 L2 L parallel = -----------------L1 + L2

L series = L 1 + L 2

circuits - 7.39

2. Vo ------ = 1--5 Vi 3. ·· · R 1 1 V o + V o  --- + V o  ------- = V i  ------- L LC LC 4. a)

·· · 1 1 1 V o + Vo  -------- + V o  ------- = V i  ------- RC LC LC

b)

· V o = Xo · –1 –1 1 X o = Xo  -------- + V o  ------- + V i  ------- RC LC LC

5. ·· · 1 1 1 · 1 V o + V o  ---------- + ---------- + V o  ------- = V i  ----------  CR 1 CR 2  LC  CR 1 6. R2 R2 R 3 · R2 R3 C + L ·· · V o + Vo  ------------------------------- + V o  ------------------------------- = V i  --------------------------- LC ( R 2 + R 3 ) LC ( R2 + R 3 ) L ( R2 + R3 ) 7. a)

·· · 1 1 1 · 1 V o + Vo  ---------- + ---------- + V o  ------- = V i  ---------- CR 1 CR2 LC CR 1

b)

ωn =

1-----LC

L ( R1 + R2 ) ζ = ------------------------------2 CR 1 R 2

circuits - 7.40

8. (a.

Sum currents at node Vo ( Vo – Vi ) ( Vo ) - + ( V o )DC + ---------- = 0 ∑ IVo = --------------------DL R V o DL 2 V o – V i + V o D LC + -------------- = 0 R 1 1 1 V o'' + Vo'  -------- + V o  ------- = V i  ------- LC LC CR

(b.

·· · 1 1 1 V o + V o  -------- + V o  ------- = V i  -------  CR  LC  LC

circuits - 7.41

(c.

–2 ·· – 2 –6 ·  10  V o ( 10 10 ) + V o  --------- + V o = 10  10 3  ·· · –8 –5 V o ( 10 ) + V o ( 10 ) + V o = 10

·· · L V o ( LC ) + V o  --- + V o = V i  R

·· · 3 8 9 V o + V o ( 10 ) + V o ( 10 ) = ( 10 ) homogeneous; 2 At

At

3

At

8

A e + Ae ( 10 ) + e ( 10 ) = 0 3 2

3

8

– 10 ± ( 10 ) – 4 ( 10 ) A + A ( 10 ) + ( 10 ) = 0 A = -------------------------------------------------------------- = – 500 ± 9987j 2 – 500t Vh = C1 e cos ( 9987t + C2 ) 2

3

particular;

8

guess 3

8

9

( 0 ) + ( 0 ) ( 10 ) + ( A ) ( 10 ) = ( 10 )

Vp = A

A = 10

V p = 10 for initial conditions, Vo = C1 e

– 500t

cos ( 9987t + C 2 ) + 10

for t=0, Vo=2V

– 500 ( 0 )

2 = C1 e cos ( 9987 ( 0 ) + C 2 ) + 10 – 8 = C 1 cos ( C 2 ) (1)

· – 500t – 500t V o = –500C 1 e cos ( 9987t + C 2 ) – 9987C 1 e sin ( 9987t + C 2 ) for t=0, d/dt Vo=3V

3 = – 500C 1 cos ( C 2 ) – 9987C 1 sin ( C 2 ) 3 = – 500C 1 cos ( C 2 ) – 9987C 1 sin ( C 2 ) –8 3 = – 4000 – 9987  -------------------- sin ( C 2 )  cos ( C 2 ) sin ( C 2 ) – 3997 - = tan ( C 2 ) -------------------- = ------------------cos ( C 2 ) 8 ( 9987 ) –8 C 1 = -------------------- = – 8.01 cos ( C 2 )

V o = – 8.01 e

– 500t

cos ( 9987t – 0.050 ) + 10

C 2 = – 0.050

circuits - 7.42

9. a)

R1 · V i + V i ( R 1 C ) + Vo  ------ = 0  R 2

b)

–R 2 · Vo = V i ( – CR 2 ) + Vi  ---------  R1 

10. Vo – R2 ------ = --------------------------------Vi R 1 + DR 1 R 2 C 11. –R · –L V o = Vi  ------ + V i  --------2-  R 1  R1  12. R2 · · –R2 V o + Vo  ------ = V i  ---------  L  R1  13. (a. Create a node between the inductor and resistor Va, and use the node voltage method

∑ IV

A

( VA – Vi ) ( VA – V– ) = ---------------------- + -------------------------- = 0 0.001D 1000

V– = V

1000000 ( V A – V i ) + V A D = 0

+

= 0V

XXXXADD UNITSXXXXX

1000000 V A = V i  ------------------------------- 1000000 + D

( V– – VA ) ( V– – Vo ) - + ------------------------- + ( V – – V o ) ( 0.000001D ) = 0 = I V ∑ – ------------------------1000 1000 –Vo ) (----------– 1 )-  1000000  (------------- + ( – V o ) ( 0.000001D ) = 0 V i ------------------------------- + 1000  1000000 + D 1000 1000000 V o ( – 1 – 0.001D ) = V i  -------------------------------  1000000 + D 2

V o ( – 1000000 – D – 1000D – 0.001D ) = 1000000V i –9

–3

V o'' ( – 10 ) + V o' ( – 1.001 ( 10 ) ) + V o ( – 1 ) = V i

circuits - 7.43

(b.

d· ---Vo = Vo dt

d- · · ---V o = – 1000000000V i – 1001000Vo – 1000000000V o dt

14. a) b) c)

–R2 · V o = Vi ( –CR 2 ) + V i  ---------  R1  Not a state equation assume Vi=1sin(wt) Vo =

1 2 2 1 + ( 1000ω ) sin  ωt + atan  ----------------  1000ω

d)

7.11 ASSIGNMENT PROBLEMS 1. Write the differential equation for the following schematic. R

R + Vi -

L

C

+ Vo -

circuits - 7.44

2. Write the differential equation for the following schematic. L

R1 +

+

Vi

+ Vo

-

-

3. Write the differential equation for the following schematic. L R + Vi

+

C

+ Vo

-

-

4. Develop the differential equation(s) for the system below, and use them to find the response to the following inputs. Assume that the circuit is off initially. R3 + Vi R1=R2=R3=R4=1Kohm C=1uF a) V i = 5 sin ( 100t ) b) c)

V i = 5 sin ( 1000000t ) Vi = 5

+ -

Vo C

R4

R1 R2

circuits - 7.45

5. Write the input-output equation for the circuit below. C1 Vi

+ -

+

C2 R2

R1

L

Vo

-

6. Study the circuit below. Assume that for t 2 · 2 K ·· ·· ·· J  ·  K - – M c x + ( M p g cos θ L + θ L M p l – x sin θ L M p ) sin θL + V s  --------- – x  ----2- – x  ------- = 0  r w R  r 2w R  r w 2  J ·2 K 2 ·· ·  K - – x  M c + ----2- + ( sin θL ) M p + cos θ L sin θ L M p g + θ L ( M p l sin θ L ) + V s  --------- – x  ------- = 0  r w R  r 2w R   rw 2 2 2 2 M c r w + J + ( sin θL ) M p r w · 2 K - ·  -------K - ·· ------------------------------------------------------------- -------x – x 2   = ( cos θ L sin θ L )M p g + θ L ( M p l sin θ L ) + V s  2 r w R    r w R rw 2

2

M p gr w M p l sin θ L r w    2 ·· - + θ·L  -------------------------------------------------------------- + x = ( cos θL sin θL )  ------------------------------------------------------------- M c r 2w + J + ( sin θL ) 2 M p r 2w  M c r 2w + J + ( sin θ L )2 M p r 2w 2 Kr w     –K - + x·  ----------------------------------------------------------------------- V s  ---------------------------------------------------------------------- R ( M c r 2w + J + ( sin θ L ) 2 M p r 2w )  R ( M c r 2w + J + ( sin θ L ) 2 M p r 2w )

Figure 32.5

Adding the differential equation for the motor

writing guide - 32.14

State Equations: · x = v 2

2 M p gr w     –K · - + ( cos θ L sin θ L )  -------------------------------------------------------------- v = v  ----------------------------------------------------------------------2 2 2 2 2 2  R ( M c r w + J + ( sin θ L ) M p r w )  M c r w + J + ( sin θ L ) M p r w

+ · θL = ωL

2 M p l sin θ L r w  2 - ω L  ------------------------------------------------------------- M c r 2w + J + ( sin θ L ) 2 M p r 2w

Kr w   - + V s  ---------------------------------------------------------------------- R ( Mc r 2w + J + ( sin θ L ) 2 M p r 2w )

· v cos θ L · –-----gωL = sin θ L – ----------------l l

Figure 32.6

State equations for the system

A Scilab program that simulates the given system is given in Figure 32.7.

writing guide - 32.15

// contest.sce // System component values l = 0.4; // 40cm Mp = 1.0; // 1kg Mc = 0.2; // 200g g = 9.81; // good old gravity rw = 0.03; // 6cm dia tires K = 0.5; // motor speed constant R = 7; // motor resistance J = 0.005; // rotor inertia // System state x0 = 0; // initial conditions for position v0 = 0; theta0 = 0.0;// the initial position for the load omega0 = 0.0; X=[x0, v0, theta0, omega0]; // The controller definition PI = 3.14159; ppr = 16;// encoder pulses per revolution; Kpot = 1.72;// the angle voltage ratio Vzero = 2.5;// the voltage when the pendulum is vertical Vadmax = 5;// the A/D voltage range Vadmin = 0; Cadmax = 255;// the A/D converter output limits Cadmin = 0; tolerance = 0.5;// the tolerance for the system to settle Kpp = 20;// position feedback gain Ksp = 2;// sway feedback gain Vpwmmax = 12; // PWM output limitations in V Cpwmmax = 255; // PWM input range Cdeadpos = 100;// deadband limits Cdeadneg = 95; function foo=control(Cdesired) Cp = ppr * X($, 1)/(2*PI*rw); Cpe = Cdesired - Cp; Cpc = Kpp * Cpe; VL = Kpot * X($,3) + 2.5; // assume the zero angle is 2.5V CL = ((VL - Vadmin) / (Vadmax - Vadmin)) * (Cadmax - Cadmin); if CL > Cadmax then CL = Cadmax; end// check for voltages over limits if CL < Cadmin then CL = Cadmin; end CLc = Ksp * (CL - (Cadmax + Cadmin) / 2); Cc = Cpc + CLc; Cpwm = 0; if Cc > 0.5 then// deadband compensation Cpwm = Cdeadpos + (Cc/Cpwmmax)*(Cpwmmax - Cdeadpos); end if Cc Vpwmmax then foo = Vpwmmax; end // clip voltage if too large if foo < -Vpwmmax then foo = -Vpwmmax; end endfunction

Figure 32.7

A Scilab program to simulate the swaying mass on the crane

writing guide - 32.16

// The motion profile generator function foo=motion(t_start, t_end, t_now, C_start, C_end) if t_now < t_start then foo = C_start; elseif t_now > t_end then foo = C_end; else foo = C_start + (C_end - C_start) * (t_now - t_start ) / (t_end - t_start); end endfunction

// define the state matrix function term1 = Mc*rw^2 + J;// Precalculate these terms to save time term2 = R*term1; Xd = 10;// the setpoint 10 turns == 160 pulses Cd = ppr * Xd / (2 * PI * rw) ; function foo=derivative(state,t, h) Vs=control(motion(0, 6, t($, 1), 0, Cd)); // Vs=control(Cd); term3 = cos(state($,3));// precalculate some repeated terms to save time term4 = sin(state($,3)); term5 = term1 + Mp * (term4 * rw)^2; //printf("%f %f \n", Cd, Vs); v_dot = -state($,2)*(K^2) / (term5 * R) ...// d/dt v + term3*term4*Mp*g*rw^2 / term5 ... + state($,4)^2 * Mp*l*term4*rw^2 / term5 ... + Vs*K*rw / term5; foo = [ state($,2), ...// d/dt x = v v_dot, ... state($, 4), ...// d/dt theta -g * term4 / l - state($, 2) * term3 / l ...// d/dt omega ]; endfunction

// Integration Set the time length and step size for the integration steps = 5000;// The number of steps to use t_start = 0;// the start time - normally use zero t_end = 10;// the end time h = (t_end - t_start) / steps;// the step size t = [t_start];// an array to store time values for i=1:steps, t = [t ; t($,:) + h]; X = [X ; X($,:) + h * derivative(X($,:), t($,:), h)];// first order end

Figure 32.8

A Scilab program to simulate the swaying mass on the crane

writing guide - 32.17

// Graph the values for part e) plot2d(t, [X(:,1) + l*sin(X(:,3))], [-2], leg="mass position"); //plot2d(t, [X(:,1), 10*X(:, 3)], [-2, -5], leg="position@theta (X 10)"); xtitle('Time (s)');

// printf the values over time intervals = 20; for time_count=1:intervals, i = int((time_count - 1)/intervals * steps + 1); xmass = X(i,1) + l*sin(X(i,3)); printf("Mass location at t=%f x=%f \n", i * h, xmass); // printf("Point at t=%f x=%f, v=%f, theta=%f, omega=%f \n", i * h, X(i, 1), X(i, 2), X(i, 3), X(i, 4)); end

// find the settling time in the results array ts = 0; for i = 1:steps, xmass = X(i,1) + l*sin(X(i,3)); if xmass > (Cd + tolerance) then ts = i*h + t_start; end if xmass < (Cd - tolerance) then ts = i*h + t_start; end end printf("\nTheoretical settling time %f \n", ts);

Figure 32.9

A Scilab program to simulate the swaying mass on the crane

writing guide - 32.18

32.6.2 Appendix B - EGR 345/101 Contract The text below outlines the general form of a contract between students in EGR 101 and 345. This contract has been entered into this date by the parties of the first part Joe Junior, Pete Zaa, Anne Nyther and Robert Sochs, to be referred to as ’345 students’, with Virve Meurte, to be referred to as ’101 student(s)’. Articles: 1. The 101 student is to participate in the design and construction of a cart as outlined below. The 345 students are to prepare a design and construct a multicomponent system that uses the cart as described below. The result must be a fully functional systems that meets the published design objectives. 2. The 345 students are expected to prepare a functional design for an anti-sway system for a crane. This design will include a cart that is designed in coordination with the 101 student. The 345 students will be required to do all calculation including system dynamics and strength of materials. The 101 student will be responsible for all other design details related to the cart including the geometry, mass, budget bill of materials and construction. This design will be documented fully by the 101 student using accepted CAD practices and ProE. The design work will result in the submission of a Formal Proposal, as shown on the Schedule of Actions. 3. Dr. Jack and/or Farris will comment on the Formal Proposal. Based upon these comments the 101 and 345 students will revise the design and agree upon a design for the cart. This will be labelled Cart Build Approval. This will be signed by all parties and submitted to Dr. Farris by the Scheduled date. 4. The cart will be build according to the Cart Build Approval before the date specified on the Schedule of Actions. At the end of this period the design must be fully documented in ProE and be ready for inclusion in the Design Report Draft. 5. Both the 101 and 345 students will participate in the first tests to verify the operation of the system and develop a First List of Deficiencies. This list will be finalized and signed, according to the date on the Schedule of Actions. The First List of Deficiencies will include a list of remedies to be performed by the 101 and 345 students. 6. The 345 students will prepare the Design Report Draft using the ProE drawing submitted by the 101 student. They are responsible for submitting the report by the date in the Schedule of Actions. 7. Both the 101 and 345 students will participate in the final tests to verify the operation of the system and develop a Final List of Deficiencies. This list will be finalized and signed, according to the date on the Schedule of Actions. The Final List of Deficiencies will include a list of remedies to be performed by the 101 and 345 students. Any changes made to the design must be updated and submitted to the 345 students for inclusion in the Design Report. 8. Both the 101 and 345 students will participate in the Competition listed in the Schedule of Actions. 9. The 345 students are to submit the final report with all necessary changes by the date listed in the Schedule of Actions. 10. The 101 student is expected to produce a cart that is built to professional standards. All drawings are expected to observe professional standards. When communicating drawings, generally accessible files formats should be used. 11. The 345 students are to, at all times, maintain a functional design concept. They must ensure that this will lead to a system that functions within the rules of the competition. 12. In the event of a dispute, 101 and 345 students are expected to resolve any conflicts informally and mitigate any losses. In the event that one or both parties fundamentally breach the

writing guide - 32.19

contract Dr. Farris and Dr. Jack will acts as arbiters. If this occurs, one or both of the parties will be penalized. This may involve actions as severe as receiving a failing grade in the project. Exhibits: 1. Schedule of Actions Oct 15-24 - Cart designs are developed by 101 and 345 students resulting in submission of the Formal Proposal Oct 30, 2003 - Cart Build Approval submitted Nov 11 - Initial build completed Nov 12 - First test completed and First List of Deficiencies submitted Nov 15 - Design Report Draft submitted for review Nov 19 - Final test completed and Final List of Deficiencies submitted Nov 25 - Competition Dec 4 - Submit Final Report

32.6.3 Appendix C - Forms Skills Self Evaluation Peer Evaluations

writing guide - 32.20

Skills Self Evaluation Your Name: none Hands-on Mechanical:

proficient

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

The ability to build components with wood, plastic, metal or other materials.

Hands-on Electrical: Basic wiring skills, soldering, etc.

Hands-on Computer Usage: CAD, Spreadsheets, creating web pages, etc.

Hands-on Computer Application: Programming and computer interfacing

Mathematical Problem Solving: Ability to formulate and solve complex problems

Writing: Layout and write complex documents

Teamwork Skills: The ability to work with others in a team environment.

Leadership Skills: The ability to act as a role model that teammates will follow.

Design Skills: Work in unstructured/semistructured problem solving.

Personal/Technical Strengths: Personal/Technical Weaknesses: People you would like to work with: People you would NOT like to work with: Other Commitments (courses, work, etc. - give hours for each) Other Items of Interest:

writing guide - 32.21

EGR 101 / 345 Project Peer Evaluation Your Name: Your Class: EGR 101 / 345

Person Being Evaluated: good Communicates well:

poor

1

2

3

4

5

1

2

3

4

5

3

4

5

Did the teammate return e-mails and other forms of communication promptly? Could the teammate understand, explain and evaluate the technical aspects of the project in a clear concise manner?

Works in team environment:

Did your teammate come to meetings on time? Did the teammate participate in all aspects of the project? How much did the teammate’s efforts contribute to the overall success of the project?

Meets deadlines:

1

2

Did you teammate complete individual tasks on time? Did the teammate keep the project progressing forward in a timely manner with a consistent effort throughout the project or was the teammate only available when the team was in trouble?

Quality of work:

1

2

3

4

5

3

4

5

Was you r teammate willing to accept and carry out individual tasks on time? How well were these individual tasks carried out? Did your teammate do his or her fair share of the work?

Overall:

1

2

Would you be happy working with the person again? Would you give this person a job reference?

Would you hire this person: yes / no Other Comments:

writing guide - 32.22

Competition Check Sheet Team Number: Arms Swing Freely: arms should swing freely, with the exception of measurement apparatus

YES / NO

Height of Payload: = 40cm

40cm below the beam

Mass of Cart: not including the harness

M =

Kg

C =

$

C =

[ 0, 1 ]

T =

[ 0, 1 ]

d =

m

ts =

s

Cost: proof of costs

Build Quality: assigned by judges. 0 is the best

Technical Analysis: 0 is the best

Test Distance: the distance specified in the test

Settling Times: The time required to move within +/- 0.5in. from the target.

Overall Score: based upon other values

C

M

------t s 2 -------B T 200 0.2 score =  --- ( 4 ) ( 10 ) ( 10 ) ( 2 ) d

Comments:

SCORE =

writing guide - 32.23

EGR 101 / 345 Project Judging Your Name: Work Quality:

Team Number:

average

excellent

poor

1

0

1

2

3

4

5

6 7

8

9

10

2

0

1

2

3

4

5

6

7

8

9

10

3

0

1

2

3

4

5

6

7

8

9

10

4

0

1

2

3

4

5

6

7

8

9

10

5

0

1

2

3

4

5

6

7

8

9

10

6

0

1

2

3

4

5

6

7

8

9

10

7

0

1

2

3

4

5

6

7

8

9

10

8

0

1

2

3

4

5

6

7

8

9

10

9

0

1

2

3

4

5

6

7

8

9

10

10

0

1

2

3

4

5

6

7

8

9

10

11

0

1

2

3

4

5

6

7

8

9

10

12

0

1

2

3

4

5

6

7

8

9

10

writing guide - 33.1

33. ENGINEERING PROBLEM SOLVING - solving problems is important.....

33.1 BASIC RULES OF STYLE The basic rules are listed below. - Always starts mechanics/circuits problems with FBDs or schematics - Create temporary variables when necessary, but eliminate them - Eliminate redundant variables - Always simply the results of calculations - Box final answers - Show derivations for all problems - Use green engineering paper and write your name, problem number and date on the top of each sheet. - Note: a calculator is not a method - Problems should be solved in a logical order from the top to the bottom of the page (not left to right). - Use engineering notation, not scientific notation - Don’t cram things into one page, many problems will take less than one page. - Don’t start a long problem at the bottom of a page. - Don’t just look at the final grade for an assignment, read the comments. Ussually comments will include elements that should be fixed. In later assignments these items normally result in reduced marks. - Variable subscripts are very important, don’t be careless with these.

33.2 EXPECTED ELEMENTS Students in the junior year are expected to, - Compare the results of calculations when asked to do so. This is also expected when different calculations should lead to the same result. - When comparing results, use different methods - verify that units make sense - verify that numerical magnitudes are reasonable. - Use significant figures as appropriate

writing guide - 33.2

- If answers are provided, solutions should match normally. This means if answers don’t match, students should check them.

33.3 SEPCIAL ELEMENTS

33.3.1 Graphs - Label all axis, including units - Provide a legend for surves with multiple traces - Equations are plotted as smooth functions. - Data is plotted as discrete points.

33.3.2 EGR 345 Specific - Frequency responses should be in phase angle forms.

33.4 SCILAB Basic ruules are, - when solving problems using computational tools, such as C programs, or numerical simulations, provide copies of the programs. - when used to solve problems, include program listings

writing guide - 33.3

33.5 TERMINOLOGY The terminology is significant, graph: a plot, numbers: a value equation: a function, a relationship, an expression, proof: a derivation

math guide - 34.1

34. MATHEMATICAL TOOLS ***** This contains additions and sections by Dr. Andrew Sterian. • We use math in almost every problem we solve. As a result the more relevant topics of mathematics are summarized here. • This is not intended for learning, but for reference.

34.1 INTRODUCTION • This section has been greatly enhanced, and tailored to meet our engineering requirements. • The section outlined here is not intended to teach the elements of mathematics, but it is designed to be a quick reference guide to support the engineer required to use techniques that may not have been used recently. • For those planning to write the first ABET Fundamentals of Engineering exam, the following topics are commonly on the exam. - quadratic equation - straight line equations - slop and perpendicular - conics, circles, ellipses, etc. - matrices, determinants, adjoint, inverse, cofactors, multiplication - limits, L’Hospital’s rule, small angle approximation - integration of areas - complex numbers, polar form, conjugate, addition of polar forms - maxima, minima and inflection points - first-order differential equations - guessing and separation - second-order differential equation - linear, homogeneous, non-homogeneous, second-order - triangles, sine, cosine, etc. - integration - by parts and separation - solving equations using inverse matrices, Cramer’s rule, substitution - eigenvalues, eigenvectors - dot and cross products, areas of parallelograms, angles and triple product - divergence and curl - solenoidal and conservative fields - centroids - integration of volumes

math guide - 34.2

- integration using Laplace transforms - probability - permutations and combinations - mean, standard deviation, mode, etc. - log properties - taylor series - partial fractions - basic coordinate transformations - cartesian, cylindrical, spherical - trig identities - derivative - basics, natural log, small angles approx., chain rule, partial fractions

34.1.1 Constants and Other Stuff • A good place to start a short list of mathematical relationships is with greek letters

name lower case

upper case

α β γ δ ε ζ η θ ι κ λ µ ν ξ ο π ρ σ τ υ φ χ ψ ω

Α Β Γ ∆ Ε Ζ Η Θ Ι Κ Λ Μ Ν Ξ Ο Π Ρ Σ Τ Υ Φ Χ Ψ Ω

alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsilon phi chi psi omega

math guide - 34.3

Figure 34.1

The greek alphabet

• The constants listed are amount some of the main ones, other values can be derived through calculation using modern calculators or computers. The values are typically given with more than 15 places of accuracy so that they can be used for double precision calculations.

1 n e = 2.7182818 = lim  1 + --- = natural logarithm base n n→∞ π = 3.1415927 = pi γ = 0.57721566 = Eulers constant 1radian = 57.29578°

Figure 34.2

Some universal constants

34.1.2 Basic Operations • These operations are generally universal, and are described in sufficient detail for our use. • Basic properties include,

commutative

a+b = b+a

distributive

a ( b + c ) = ab + ac

associative

a ( bc ) = ( ab )c

Figure 34.3

Basic algebra properties

a + (b + c) = (a + b) + c

math guide - 34.4

34.1.2.1 - Factorial • A compact representation of a series of increasing multiples.

n! = 1 ⋅ 2 ⋅ 3 ⋅ 4 ⋅ … ⋅ n 0! = 1

Figure 34.4

The basic factorial operator

34.1.3 Exponents and Logarithms • The basic properties of exponents are so important they demand some sort of mention

n

m

(x )( x ) = x

n+m

n

(x ) n–m ---------= x m (x )

0

x = 1 , if x is not 0 x

–p

1 = ----px n

n m

(x )

Figure 34.5

= x

n⋅m

1 --n

x = x

n

n

( xy ) = ( x ) ( y )

Properties of exponents

• Logarithms also have a few basic properties of use,

n

m ---n

=

n

x

n

x

m

x-- = n------xy n y

math guide - 34.5

The basic base 10 logarithm: log x = y

x = 10

y

The basic base n logarithm: log n x = y

x = n

y

The basic natural logarithm (e is a constant with a value found near the start of this section: ln x = log e x = y

Figure 34.6

x = e

y

Definitions of logarithms

• All logarithms observe a basic set of rules for their application,

logn ( xy ) = log n ( x ) + log n ( y )

logn ( n ) = 1 logn ( 1 ) = 0

x logn  -- = log n ( x ) – logn ( y ) y y

log n ( x ) = ylogn ( x ) log m ( x ) log n ( x ) = ------------------logm ( n ) ln ( A ∠θ ) = ln ( A ) + ( θ + 2πk )j

Figure 34.7

Properties of logarithms

34.1.4 Polynomial Expansions • Binomial expansion for polynomials,

k∈I

math guide - 34.6

n

n

( a + x ) = a + na

Figure 34.8

n–1

n( n – 1 ) n – 2 2 n x + -------------------- a x +…+x 2!

A general expansion of a polynomial

34.1.5 Practice Problems 1. Are the following expressions equivalent?

c)

A ( 5 + B ) – C = 5A + B – C A + BA B ------------= ---- + ---C+D C D log ( ab ) = log ( a ) + log ( b )

d)

5(5 ) = 5

e)

3 log ( 4 ) = log ( 16 )

f)

( x + 6 ) ( x – 6 ) = x + 36 log ( 5 ) 10 = -----10 5 6 (-----------------x + 1 ) - = x 2 + 2x + 1

a) b)

g) h)

4

5

2

(x + 1)

2

2. Simplify the following expressions. a) b) c) d) e) f) g)

2

x ( x + 2 ) – 3x 2 (-------------------------------------x + 3 ) ( x + 1 )x -

h)

2

(x + 1) x 3 log ( x ) 64 -----16 15 3------ + ----21 28 (x y ) 2

4x – 8y

i)

 5---  4 -------5

j)

(y + 4) (y – 2)

k)

2 3 4 4

5---  8--- 3  9

l)

3

2

x y x----------+ 1= 4 x+2

math guide - 34.7

3. Simplify the following expressions. + Ba) A -----------AB AB b) -----------A+B 4 5 3 x y )- c)  (------------- 2   x  d) log ( x 5 ) + log ( x 3 )

(ans. + BA B 1 1 a) A -----------= ------- + ------- = --- + --AB AB AB B A AB b) -----------A + B cannot be simplified 4 5 x y ) c)  (------------- 2 -  x 

3

2 5 3

6 15

= (x y ) = x y

d) log ( x 5 ) + log ( x 3 ) = 5 log ( x ) + 3 log ( x ) = 8 log ( x )

4. Simplify the following expressions.

a)

(ans.

a)

2

3

4

n log ( x ) + m log ( x ) – log ( x )

2

3

4

n log ( x ) + m log ( x ) – log ( x ) 2n log ( x ) + 3m log ( x ) – 4 log ( x ) ( 2n + 3m – 4 ) log ( x ) ( 2n + 3m – 4 ) log ( x )

math guide - 34.8

5. Rearrange the following equation so that only ‘y’ is on the left hand side. y---------+ x= x+2 y+z

(ans.

y---------+ x= x+2 y+z y + x = (x + 2)(y + z) y + x = xy + xz + 2y + 2z y – xy – 2y = xz + 2z – x y ( – x – 1 ) = xz + 2z – x xz + 2z – x y = -------------------------–x–1

6. Find the limits below. a)

 t3 + 5  lim  ---------------- t → 0 5t 3 + 1

b)

 t3 + 5  lim  ---------------- t → ∞ 5t 3 + 1

(ans.

a) b)

3  t3 + 5  0 +5 ---------------------lim  ---------------= = 5  3 t → 0 5t 3 + 1 5(0) + 1 3 3  t3 + 5  ∞ + 5 ∞ - = -------------- = 0.2 lim  ---------------- = ----------------------3 3 t → ∞ 5t 3 + 1 5(∞) + 1 5(∞)

math guide - 34.9

34.2 FUNCTIONS

34.2.1 Discrete and Continuous Probability Distributions

Binomial P(m) =

∑  t  p q n

t n–t

q = 1–p

q, p ∈ [ 0, 1 ]

t≤m

Poisson P(m) =



t≤m

t –λ

λe -----------t!

λ>0

Hypergeometric

 r  s   t   n – t P ( m ) = ∑ ----------------------r + s  t≤m  n 

Normal 1 x –t2 P ( x ) = ---------- ∫ e dt 2π –∞

Figure 34.9

Distribution functions

34.2.2 Basic Polynomials • The quadratic equation appears in almost every engineering discipline, therefore is of great importance.

2

ax + bx + c = 0 = a ( x – r 1 ) ( x – r 2 )

Figure 34.10 Quadratic equation

2

– b ± b – 4ac r 1, r 2 = -------------------------------------2a

math guide - 34.10

• Cubic equations also appear on a regular basic, and as a result should also be considered.

3

2

x + ax + bx + c = 0 = ( x – r 1 ) ( x – r 2 ) ( x – r 3 ) First, calculate, 2

3

3b – a Q = ----------------9

9ab – 27c – 2a R = --------------------------------------54

S =

3

3

R+ Q +R

2

T =

3

3

R– Q +R

2

Then the roots, a r 1 = S + T – --3

S+T a j 3 r 2 = ------------ – --- + --------- ( S – T ) 2 3 2

S+T a j 3 r 3 = ------------ – --- – --------- ( S – T ) 2 3 2

Figure 34.11 Cubic equations • On a few occasions a quartic equation will also have to be solved. This can be done by first reducing the equation to a quadratic,

4

3

2

x + ax + bx + cx + d = 0 = ( x – r 1 ) ( x – r 2 ) ( x – r 3 ) ( x – r 4 ) First, solve the equation below to get a real root (call it ‘y’), 3

2

2

2

y – by + ( ac – 4d )y + ( 4bd – c – a d ) = 0 Next, find the roots of the 2 equations below,  a + a 2 – 4b + 4y  y + y2 – 4d r 1, r 2 = z +  ------------------------------------------- z +  ------------------------------ = 0 2 2     2

2  y – y2 – 4d 2  a – a – 4b + 4y r 3, r 4 = z +  ------------------------------------------- z +  ------------------------------ = 0 2 2    

Figure 34.12 Quartic equations

math guide - 34.11

34.2.3 Partial Fractions • The next is a flowchart for partial fraction expansions.

start with a function that has a polynomial numerator and denominator

is the order of the numerator >= denominator?

yes

use long division to reduce the order of the numerator

no Find roots of the denominator and break the equation into partial fraction form with unknown values OR use limits technique. If there are higher order roots (repeated terms) then derivatives will be required to find solutions

use algebra technique

Done

Figure 34.13 The methodolgy for solving partial fractions • The partial fraction expansion for,

math guide - 34.12

A B 1 C x ( s ) = -------------------= ----2 + --- + ----------2 s s+1 s s (s + 1) 1 - C = lim ( s + 1 )  -------------------2  s → –1 s (s + 1) 1 - 2 A = lim s  -------------------2  s→0 s (s + 1)

= 1

1 = lim ----------- = 1 s→0 s + 1

d 2 1 - B = lim ----- s  -------------------2  s → 0 ds s (s + 1)

d 1 = lim -----  ----------- s → 0 ds s + 1

–2

= lim [ – ( s + 1 ) ] = – 1 s→0

Figure 34.14 A partial fraction example • Consider the example below where the order of the numerator is larger than the denominator.

math guide - 34.13

3

2

5s + 3s + 8s + 6x ( s ) = ------------------------------------------2 s +4 This cannot be solved using partial fractions because the numerator is 3rd order and the denominator is only 2nd order. Therefore long division can be used to reduce the order of the equation. 5s + 3 2

s +4

3

2

5s + 3s + 8s + 6 3 5s + 20s 2

3s – 12s + 6 2 3s + 12 – 12s – 6 This can now be used to write a new function that has a reduced portion that can be solved with partial fractions.

– 12s – 6x ( s ) = 5s + 3 + --------------------2 s +4

solve

–--------------------12s – 6A B = ------------- + ------------2 s + 2j s – 2j s +4

Figure 34.15 Solving partial fractions when the numerator order is greater than the denominator • When the order of the denominator terms is greater than 1 it requires an expanded partial fraction form, as shown below.

5 F ( s ) = -----------------------32 s (s + 1) 5 A B C D E ----------------------= ----2 + --- + ------------------3- + ------------------2- + ---------------3 2 s (s + 1) (s + 1) s (s + 1) s (s + 1)

Figure 34.16 Partial fractions with repeated roots

math guide - 34.14

• We can solve the previous problem using the algebra technique.

5 A B C D E ------------------------ = ---+ --- + ------------------3- + ------------------2- + ---------------3 2 2 s ( s + 1) s (s + 1) (s + 1) s (s + 1) 3

3

2

2

2

2

A ( s + 1 ) + Bs ( s + 1 ) + Cs + Ds ( s + 1 ) + Es ( s + 1 ) = ----------------------------------------------------------------------------------------------------------------------------------------3 2 s (s + 1) 4

3

2

s ( B + E ) + s ( A + 3B + D + 2E ) + s ( 3A + 3B + C + D + E ) + s ( 3A + B ) + ( A )= -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3 2 s (s + 1) 0 1 3 3 1

1 3 3 1 0

0 0 1 0 0

0 1 1 0 0

1 2 1 0 0

A 0 B 0 C = 0 D 0 E 5

A 0 1 0 B 1 3 0 C = 3 3 1 D 3 1 0 E 1 0 0

0 1 1 0 0

1 2 1 0 0

–1

0 5 0 – 15 0 = 5 0 10 5 15

5 5 – 15 5 10 15 ------------------------ = ---- + --------- + ------------------- + ------------------- + ---------------3 2 3 2 (s + 1) 2 s s (s + 1) (s + 1) s (s + 1)

Figure 34.17 An algebra solution to partial fractions

34.2.4 Summation and Series b

∑ xi

• The notation

is equivalent to x a + x a + 1 + x a + 2 + … + x b assuming a

i=a

and b are integers and b ≥ a . The index variable i is a placeholder whose name does not matter. • Operations on summations: b

∑ xi i=a

a

=

∑ xi i=b

math guide - 34.15

b

b

∑ αxi i=a b

= α ∑ xi i=a b

b

∑ xi + ∑ yj i=a b

j=a c

∑ xi + ∑ i=a

=

∑ ( xi + yi ) i=a c

xi =

i = b+1

      x y =  ∑ i  ∑ j i = a  j = c  b

d

∑ xi i=a b

d

∑ ∑ xi yj i=a j=c

• Some common summations: N

∑i

1 = --- N ( N + 1 ) 2

i=1

 1 – αN  ----------------, α ≠ 1 for both real and complex α . ∑ α =  1 – α i=0 N, α = 1 

N–1

i



∑α

i

1 = ------------, α < 1 for both real and complex α . For α ≥ 1 , the summation 1–α

i=0

does not converge.

math guide - 34.16

34.2.5 Practice Problems 1. Convert the following polynomials to multiplied terms as shown in the example. e.g.,

x + 2x + 1 = ( x + 1 ) ( x + 1 )

a)

x – 2x + 1

b)

x –1

c)

x +1

2 2

d)

2

2

x + x + 10

e)

2

f)

2. Solve the following equation to find ‘x’. 2

2x + 8x = –8

(ans.

2

2x + 8x = – 8 2

x + 4x + 4 = 0 2 (x + 2) = 0 x = – 2, – 2 3. Reduce the following expression to partial fraction form. x + 4---------------2 x + 8x

(ans.

x+4 A BAx + 8A + Bxx + 4------------------------------------ + -----------------------------------------= = = 2 2 x(x + 8) x x+8 x + 8x x + 8x ( 1 )x + 4 = ( A + B )x + 8A 8A = 4

A = 0.5

1 = A+B B = 0.5 x+4 0.5 ----------------- = 0.5 ------- + ----------2 x x +8 x + 8x

math guide - 34.17

34.3 SPATIAL RELATIONSHIPS

34.3.1 Trigonometry • The basic trigonometry functions are,

y 1 sin θ = -- = ----------r csc θ x 1 cos θ = -- = ----------r sec θ

r y

y 1 sin θ tan θ = -- = ----------- = -----------x cot θ cos θ Pythagorean Formula: 2

2

r = x +y

θ

2

x

• Graphs of these functions are given below,

Sine - sin 1

-270°

-180°

-90°

0° -1

90°

180°

270°

360°

450°

math guide - 34.18

Cosine - cos 1

-270°

-180°

-90°



90°

180°

270°

360°

450°

-1

Tangent - tan 1

-270°

-180°

-90°

0° -1

90°

180°

270°

360°

450°

Cosecant - csc

1

-270°

-180°

-90°

0° -1

90°

180°

270°

360°

450°

math guide - 34.19

Secant - sec 1

-270°

-180°

-90°



90°

180°

270°

360°

450°

-1

Cotangent - cot

1

-270°

-180°

-90°

0° -1

90°

180°

270°

360°

450°

• NOTE: Keep in mind when finding these trig values, that any value that does not lie in the right hand quadrants of cartesian space, may need additions of ±90° or ±180°.

math guide - 34.20

Cosine Law: 2

2

2

c = a + b – 2ab cos θ c c

θA

Sine Law:

b

b c a ------------= -------------- = -------------sin θ A sin θ B sin θ C θC

θB

a • Now a group of trigonometric relationships will be given. These are often best used when attempting to manipulate equations.

math guide - 34.21

sin ( – θ ) = – sin θ

cos ( – θ ) = cos θ

tan ( – θ ) = – tan θ

sin θ = cos ( θ – 90° ) = cos ( 90° – θ ) = etc. sin ( θ 1 ± θ 2 ) = sin θ 1 cos θ 2 ± cos θ 1 sin θ 2

OR

sin ( 2θ ) = 2 sin θ cos θ

− sin θ sin θ cos ( θ1 ± θ 2 ) = cos θ 1 cos θ 2 + 1 2

OR

cos ( 2θ ) = ( cos θ ) + ( sin θ )

tan θ 1 ± tan θ 2 tan ( θ 1 ± θ 2 ) = -----------------------------------1− + tan θ 1 tan θ 2 cot θ 1 cot θ2 − +1 cot ( θ 1 ± θ 2 ) = ------------------------------------tan θ 2 ± tan θ 1 θ – cos θsin --- = ± 1-------------------2 2

-ve if in left hand quadrants

θ + cos θcos --- = ± 1-------------------2 2 θ sin θ 1 – cos θ tan --- = --------------------- = --------------------2 1 + cos θ sin θ 2

2

( cos θ ) + ( sin θ ) = 1

• Numerical values for these functions are given below.

θ (deg) -90 -60 -45 -30 0 30 45 60 90

sin θ

cos θ

tan θ

-1.0 -0.866 -0.707 -0.5 0 0.5 0.707 0.866 1.0

0.0 0.5 0.707 0.866 1 0.866 0.707 0.5 0.0

-infinity -1 0 1 infinity

2

2

math guide - 34.22

• These can also be related to complex exponents,



–jθ



e +e cos θ = ---------------------2

–j θ

e –e sin θ = --------------------2j

34.3.2 Hyperbolic Functions • The basic definitions are given below,

x

–x

e –e sinh ( x ) = ------------------ = hyperbolic sine of x 2 x

–x

e +e cosh ( x ) = ------------------ = hyperbolic cosine of x 2 x

–x

sinh ( x ) e –e - = hyperbolic tangent of x tanh ( x ) = ------------------- = ----------------x –x cosh ( x ) e +e 1 2 = hyperbolic cosecant of x csch ( x ) = ------------------ = ----------------x –x sinh ( x ) e –e 1 2 - = hyperbolic secant of x sech ( x ) = ------------------- = ----------------x –x cosh ( x ) e +e x

–x

cosh ( x ) e +e = hyperbolic cotangent of x coth ( x ) = ------------------- = ----------------x –x sinh ( x ) e –e

• some of the basic relationships are,

math guide - 34.23

sinh ( – x ) = – sinh ( x ) cosh ( –x ) = cosh ( x ) tanh ( – x ) = – tanh ( x ) csch ( – x ) = – csch ( x ) sech ( – x ) = sech ( x ) coth ( –x ) = – coth ( x )

• Some of the more advanced relationships are,

2

2

2

2

2

2

( cosh x ) – ( sinh x ) = ( sech x ) + ( tanh x ) = ( coth x ) – ( csch x ) = 1 sinh ( x ± y ) = sinh ( x ) cosh ( y ) ± cosh ( x ) sinh ( y ) cosh ( x ± y ) = cosh ( x ) cosh ( y ) ± sinh ( x ) sinh ( y ) tanh ( x ) ± tanh ( y ) tanh ( x ± y ) = ----------------------------------------------1 ± tanh ( x ) tanh ( y ) • Some of the relationships between the hyperbolic, and normal trigonometry functions are,

sin ( jx ) = j sinh ( x )

j sin ( x ) = sinh ( jx )

cos ( jx ) = cosh ( x )

cos ( x ) = cosh ( jx )

tan ( jx ) = j tanh ( x )

j tan ( x ) = tanh ( jx )

34.3.2.1 - Practice Problems

math guide - 34.24

1. Find all of the missing side lengths and corner angles on the two triangles below.

5

5

3

3 10°

2. Simplify the following expressions. cos θ cos θ – sin θ sin θ =

(ans.

2

( s + 3j ) ( s – 3j ) ( s + 2j ) =

cos θ cos θ – sin θ sin θ = cos ( θ + θ ) = cos ( 2θ ) 2

2

2

2

2

( s + 3j ) ( s – 3j ) ( s + 2j ) = ( s – 9j ) ( s + 4js + 4j ) 4

3

2 2

2 2

2

2

s + 4js + 4j s – 9j s – 9j 4js – 9j 4j 4

3

2

2

s + ( 4j )s + ( 5 )s + ( 36j )s + ( – 36 ) 3. Solve the following partial fraction 1 Note: there was a typo here, so --------------an acceptable answer is also. x + 0.5

4 -------------------------= 2 x + 3x + 2

(ans.

A B Ax + 2A + Bx + B( 2A + B ) + ( A + B )x 4 -------------------------= ------------ + ------------ = -----------------------------------------= ------------------------------------------------2 2 2 x + 1 x + 2 x + 3x + 2 x + 3x + 2 x + 3x + 2 A+B = 0

A = –B

2A + B = 4 = – 2B + B = –B

B = –4

A = 4

4 - ----------–4 ----------+ x+1 x+2

34.3.3 Geometry • A set of the basic 2D and 3D geometric primitives are given, and the notation used is described below,

math guide - 34.25

A = contained area P = perimeter distance V = contained volume S = surface area x, y, z = centre of mass x, y, z = centroid I x, I y, I z = moment of inertia of area (or second moment of inertia)

AREA PROPERTIES:

∫y

Ix =

2

dA = the second moment of inertia about the y-axis

A

∫x

Iy =

2

dA = the second moment of inertia about the x-axis

A

∫ xy dA

I xy =

= the product of inertia

A

∫r

JO =

2

dA =

A

∫ (x

2

2

+ y ) dA = I x + I y = The polar moment of inertia

A

∫ x dA A - = centroid location along the x-axis x = -----------∫ dA A

∫ y dA A - = centroid location along the y-axis y = -----------∫ dA A

math guide - 34.26

y

Rectangle/Square: A = ab P = 2a + 2b

a x

Centroid:

Moment of Inertia (about centroid axes): 3

b x = --2

ba I x = -------12 3

a y = --2

b Moment of Inertia (about origin axes): 3

ba I x = -------3 3

b a I y = -------12

b a I y = -------3

I xy = 0

b a I xy = ----------4

2 2

math guide - 34.27

Triangle:

y bh A = -----2

a

P =

θ

h x b

Moment of Inertia (about centroid axes):

Centroid: a+b x = -----------3 h y = --3

Moment of Inertia (about origin axes):

3

3

bh I x = -------36

bh I x = -------12

bh 2 2 I y = ------ ( a + b – ab ) 36

bh 2 2 I y = ------ ( a + b – ab ) 12

2

2

bh I xy = -------- ( 2a – b ) 72

Circle:

bh I xy = -------- ( 2a – b ) 24

y A = πr

r

2

P = 2πr x

Centroid:

Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): 4

x = r

πr I x = -------4

y = r

πr I y = -------4 I xy = 0

Mass Moment of Inertia (about centroid): 2

Ix =

4

Iy = I xy =

Mr J z = ---------2

math guide - 34.28

Half Circle:

y

2

πr A = -------2 P = πr + 2r

r x Centroid: x = r 4r y = -----3π

Moment of Inertia (about origin axes):

Moment of Inertia (about centroid axes): π 8 4 I x =  --- – ------ r 8 9π

4

πr I x = -------8

4

πr I y = -------8

4

πr I y = -------8 I xy = 0

I xy = 0

Quarter Circle:

y

2

πr A = -------4 πr P = ----- + 2r 2

r x Centroid:

Moment of Inertia (about centroid axes):

4r x = -----3π

I x = 0.05488r

4r y = -----3π

I y = 0.05488r

4

4

πr I y = -------16

4

I xy = – 0.01647 r

Moment of Inertia (about origin axes): 4 πr ------Ix = 16

4

4

I xy

r = ---8

math guide - 34.29

Circular Arc:

y 2

θr A = -------2 P = θr + 2r

r x θ

Centroid: θ 2r sin --2 x = ----------------3θ y = 0

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes): 4

Ix =

r I x = ---- ( θ – sin θ ) 8

Iy =

r I y = ---- ( θ + sin θ ) 8

I xy =

I xy = 0

4

math guide - 34.30

Ellipse:

y

r1

A = πr 1 r 2 P = 4r 1 ∫

π --2

0

2

r2 2

2

r1 + r 2 2 1 – -------------------- ( sin θ ) dθ a

x

2

r 1 + r2 P ≈ 2π --------------2 Centroid:

Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): 3

x = r2 y = r1

πr 1 r 2 I x = ------------4 3 πr 1 r 2 I y = ------------4 I xy =

Ix = Iy = I xy =

math guide - 34.31

Half Ellipse:

y

πr 1 r 2 A = -----------2 P = 2r 1 ∫

π --2

0

2

2 r1

r1

2 r2

+ 2 1 – -------------------- ( sin θ ) dθ + 2r 2 a

r2

x

2

r 1 + r2 P ≈ π --------------- + 2r 2 2 Centroid: x = r2 4r 1 y = -------3π

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes): 3

3

I x = 0.05488r 2 r 1 3

I y = 0.05488r 2 r 1 2 2

I xy = – 0.01647r 1 r 2

πr 2 r 1 I x = -----------16 3 πr 2 r 1 -----------Iy = 16 2 2 r1 r2 I xy = --------8

math guide - 34.32

Quarter Ellipse: πr 1 r 2 A = ------------4

P =

r1 ∫

π --2

0

2

y

2

r1

2

r1 + r 2 2 1 – -------------------- ( sin θ ) dθ + 2r 2 a

r2

x

2

π r 1 + r2 P ≈ --- --------------- + 2r 2 2 2 Centroid:

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

4r 2 x = -------3π

Ix =

I x = πr 2 r 1

4r 1 y = -------3π

Iy =

I y = πr 2 r 1

I xy =

r2 r1 = --------8

3

3

2 2

I xy

Parabola:

y

2 A = --- ab 3 a

 4a + b + 16a b b + 16a P = --------------------------- + ------ ln  ---------------------------------------- 2 b 8a   2

2

2

2

2

x b

Centroid:

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

b x = --2

Ix =

Ix =

2a y = -----5

Iy =

Iy =

I xy =

I xy =

math guide - 34.33

Half Parabola:

y

ab A = -----3 a

 4a + b2 + 16a 2 b + 16a b P = --------------------------- + --------- ln  ---------------------------------------- 4 16a  b  2

2

2

x b

Centroid: 3b x = -----8 2a y = -----5

Moment of Inertia Moment of Inertia (about centroid axes): (about origin axes): 3 3 8ba 2ba I x = -----------I x = -----------175 7 3

19b a I y = --------------480 2 2

b a I xy = ----------60

3

2b a I y = -----------15 2 2

b a I xy = ----------6

• A general class of geometries are conics. This for is shown below, and can be used to represent many of the simple shapes represented by a polynomial.

math guide - 34.34

2

2

Ax + 2Bxy + Cy + 2Dx + 2Ey + F = 0 Conditions

A = B = C = 0 B = 0, A = C 2 B – AC < 0 2 B – AC = 0 2 B – AC > 0

straight line circle ellipse parabola hyperbola

math guide - 34.35

VOLUME PROPERTIES: Ix =

∫ rx

2

dV = the moment of inertia about the x-axis

V

Iy =

∫ ry

2

dV = the moment of inertia about the y-axis

V

Iz =

∫ rz

2

dV = the moment of inertia about the z-axis

V

∫ x dV V - = centroid location along the x-axis x = -----------∫ dV V

∫ y dV V - = centroid location along the y-axis y = -----------∫ dV V

∫ z dV V - = centroid location along the z-axis z = -----------∫ dV V

math guide - 34.36

Parallelepiped (box):

y

V = abc

c

z

S = 2 ( ab + ac + bc ) b

x a

Moment of Inertia (about centroid axes):

Centroid: a x = --2

M(a + b ) I x = --------------------------12

b y = --2

M(a + c ) I y = --------------------------12

c z = --2

M(b + a ) I z = --------------------------12

2

2

2

Moment of Inertia (about origin axes):

Mass Moment of Inertia (about centroid):

2

Ix =

Jx =

Iy =

Jy =

Iz =

Jz =

2

2

Sphere:

y

r

4 3 V = --- πr 3 S = 4πr

Centroid:

z

2

x Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

2

x = r

2Mr I x = ------------5

y = r

2Mr I y = ------------5

z = r

2Mr I z = ------------5

Mass Moment of Inertia (about centroid): 2

Ix =

2Mr J x = ------------5

Iy =

2Mr J y = ------------5

Iz =

2Mr J z = ------------5

2

2

2

2

math guide - 34.37

Hemisphere:

y

2 3 V = --- πr 3 z r

S =

Centroid:

x = r

Moment of Inertia (about centroid axes):

x

Moment of Inertia (about origin axes):

83 2 I x = --------- Mr 320

Ix =

2

3r y = ----8 z = r

2Mr I y = ------------5

Iy =

83 2 I z = --------- Mr 320

Iz =

Cap of a Sphere:

y h

1 2 V = --- πh ( 3r – h ) 3 z r

S = 2πrh

Centroid:

x = r y = z = r

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

Ix =

Ix =

Iy =

Iy =

Iz =

Iz =

x

math guide - 34.38

Cylinder:

y

V = hπr

r

2

h

S = 2πrh + 2πr

z

2

x

Centroid:

Moment of Inertia (about centroid axis):

x = r

h r I x = M  ------ + ---- 12 4

h y = --2

Mr I y = ---------2

z = r

r h I z = M  ------ + ----  12 4 

2

2

Moment of Inertia (about origin axis): 2

Mass Moment of Inertia (about centroid):

2

2

2

2

2

h r I x = M  ----- + ---- 3 4

M ( 3r + h ) J x = -----------------------------12

Iy =

Mr J y = ---------2

2

2

2

2

2

2

M ( 3r + h ) J z = -----------------------------12

r h I z = M  ----- + ----  3 4

Cone:

y

1 2 V = --- πr h 3 2

S = πr r + h

2

z

Centroid:

Moment of Inertia (about centroid axes): 3

h

Moment of Inertia (about origin axes):

2

x = r

3h 3r I x = M  -------- + -------- 80 20

h y = --4

3Mr I y = ------------10

z = r

3h 3r I z = M  -------- + -------- 80 20

Ix =

2

Iy = 3

r

2

Iz =

x

math guide - 34.39

Tetrahedron:

y

z

1 V = --- Ah 3

h A Centroid:

Moment of Inertia (about origin axes):

Moment of Inertia (about centroid axes):

x =

Ix =

Ix =

h y = --4

Iy =

Iy =

Iz =

Iz =

z =

Torus:

x

y r2

1 2 2 V = --- π ( r 1 + r 2 ) ( r 2 – r 1 ) 4

r1

z 2

2

2

S = π ( r2 – r1 )

x

Centroid:

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

x = r2

Ix =

Ix =

r 2 – r 1 y =  ------------- 2 

Iy =

Iy =

Iz =

Iz =

z = r2

math guide - 34.40

Ellipsoid:

y r2

4 V = --- πr 1 r 2 r 3 3

r3 r1

z S =

x

Centroid:

x = r1 y = r2 z = r3

Moment of Inertia (about origin axes):

Moment of Inertia (about centroid axes): Ix =

Ix =

Iy =

Iy =

Iz =

Iz =

Paraboloid:

y

1 2 V = --- πr h 2

h z r

S =

Centroid:

x = r y = z = r

Moment of Inertia (about centroid axes):

Moment of Inertia (about origin axes):

Ix =

Ix =

Iy =

Iy =

Iz =

Iz =

x

math guide - 34.41

34.3.4 Planes, Lines, etc. • The most fundamental mathematical geometry is a line. The basic relationships are given below,

y = mx + b

defined with a slope and intercept

1 m perpendicular = ---m

a slope perpendicular to a line

y2 – y1 m = ---------------x2 – x1

the slope using two points

--x- + --y- = 1 a b

as defined by two intercepts

• If we assume a line is between two points in space, and that at one end we have a local reference frame, there are some basic relationships that can be derived.

math guide - 34.42

y θβ

( x 2, y 2, z 2 )

d

( x 1, y 1, z 1 ) d =

2

2

( x2 – x1 ) + ( y2 – y1 ) + ( z2 – z1 )

θγ

2

θα x

( x 0, y 0, z 0 )

z The direction cosines of the angles are, x2 – x1 θ α = acos  ---------------- d 2

y2 – y1 θ β = acos  ---------------- d 2

z2 – z1 θ γ = acos  --------------- d

2

( cos θ α ) + ( cos θ β ) + ( cos θ γ ) = 1 The equation of the line is, y – y1 z–z x – x1 --------------- = --------------- = --------------1x2 – x1 y2 – y1 z2 – z1 ( x, y, z ) = ( x 1, y 1, z 1 ) + t ( ( x 2, y 2, z 2 ) – ( x 1, y 1, z 1 ) )

• The relationships for a plane are,

Explicit

Parametric t=[0,1]

math guide - 34.43

y b

The explicit equation for a plane is, Ax + By + Cz + D = 0

P 1 = ( x 1, y 1, z 1 ) where the coefficients defined by the intercepts are, 1 A = --a

1 B = --b

1 C = --c

N P 2 = ( x 2, y 2, z 2 )

D = –1

P 3 = ( x 3, y 3, z 3 )

a

x

c

z The determinant can also be used, x – x1 y – y1 z – z1 det x – x 2 y – y 2 z – z 2 = 0 x – x3 y – y3 z – z3 ∴det

y2 – y1 z2 – z1 y3 – y1 z3 – z1

( x – x 1 ) + det

+ det

z2 – z1 x2 – x1 z3 – z1 x3 – x1

x2 – x1 y2 – y1 x3 – x1 y3 – y1

( y – y1 )

( z – z1 ) = 0

The normal to the plane (through the origin) is, ( x, y, z ) = t ( A , B , C )

34.3.5 Practice Problems 1. What is the circumferenece of a circle? What is the area? What is the ratio of the area to the circumference?

math guide - 34.44

2. What is the equation of a line that passes through the points below? a) (0, 0) to (2, 2) b) (1, 0) to (0, 1) c) (3, 4) to (2. 9) 3. Find a line that is perpendicular to the line through the points (2, 1) and (1, 2). The perpendicular line passes through (3, 5). 4. Manipulate the following equations to solve for ‘x’. a) x 2 + 3x = – 2 b) sin x = cos x

(ans. a) x 2 + 3x = – 2 2

x + 3x + 2 = 0 2

– 3 ± 3 – 4( 1)( 2 ) –3± 9–8 –3±1 x = ------------------------------------------------ = ------------------------------ = ---------------- = – 1, – 2 2(1 ) 2 2 b) sin x = cos x sin x---------= 1 cos x tan x = 1 x = atan 1 x = …, –135°, 45°, 225°, … 5. Simplify the following expressions. a)

(ans.

a)

2

( cos 2θ ) sin 2θ  ---------------------- + sin 2θ  sin 2θ 

2

( cos 2θ ) 2 2 sin 2θ  ---------------------- + sin 2θ = ( cos 2θ ) + ( sin 2θ ) = 1 sin 2θ

math guide - 34.45

6. A line that passes through the point (1, 2) and has a slope of 2. Find the equation for the line, and for a line perpendicular to it.

(ans.

given, y = mx + b m = 2 x = 1 y = 2 substituting 2 = 2(1) + b y = 2x

b = 0

perpendicular 1 m perp = – ---- = – 0.5 m y = – 0.5 x

34.4 COORDINATE SYSTEMS

34.4.1 Complex Numbers • In this section, as in all others, ‘j’ will be the preferred notation for the complex number, this is to help minimize confusion with the ‘i’ used for current in electrical engineering. • The basic algebraic properties of these numbers are,

math guide - 34.46

The Complex Number: j =

2

–1

j = –1

Complex Numbers: a + bj

where,

a and b are both real numbers

Complex Conjugates (denoted by adding an asterisk ‘*’ the variable): N = a + bj

N* = a – bj

Basic Properties: ( a + bj ) + ( c + dj ) = ( a + c ) + ( b + d )j ( a + bj ) – ( c + dj ) = ( a – c ) + ( b – d )j ( a + bj ) ⋅ ( c + dj ) = ( ac – bd ) + ( ad + bc )j Na + bj N N* a + bj c – dj ac + bd  bc – ad ---- + ------------------ j = -------------- = -----  ------- =  --------------  ------------- = ----------------2 2 2  2 M c + dj M N* c + dj c – dj c +d c +d • We can also show complex numbers graphically. These representations lead to alternative representations. If it in not obvious above, please consider the notation above uses a cartesian notation, but a polar notation can also be very useful when doing large calculations.

math guide - 34.47

CARTESIAN FORM

Ij imaginary (j) N = R + Ij R real

A =

2

R +I

2

I θ = atan  --- R POLAR FORM

R = A cos θ I = A sin θ

Ij imaginary (j) N = A ∠θ θ

R real A = amplitude θ = phase angle

• We can also do calculations using polar notation (this is well suited to multiplication and division, whereas cartesian notation is easier for addition and subtraction),

math guide - 34.48

A ∠θ = A ( cos θ + j sin θ ) = Ae



( A 1 ∠θ 1 ) ( A 2 ∠θ 2 ) = ( A 1 A 2 ) ∠( θ 1 + θ 2 ) ( A 1 ∠θ 1 ) A --------------------- =  -----1- ∠( θ 1 – θ 2 )  A 2 ( A 2 ∠θ 2 ) n

n

( A ∠θ ) = ( A ) ∠( nθ )

(DeMoivre’s theorem)

• Note that DeMoivre’s theorem can be used to find exponents (including roots) of complex numbers

• Euler’s formula: e



= cos θ + j sin θ

• From the above, the following useful identities arise: jθ

– jθ

e +e cos θ = ---------------------2 jθ

– jθ

e –e sin θ = --------------------2j

34.4.2 Cylindrical Coordinates • Basically, these coordinates appear as if the cartesian box has been replaced with a cylinder,

math guide - 34.49

z

z ( x, y, z ) ↔ ( r, θ, z )

z z y

r

x x

y

θ 2

x +y

2

x = r cos θ

r =

y = r sin θ

y θ = atan  -- x

34.4.3 Spherical Coordinates • This system replaces the cartesian box with a sphere,

math guide - 34.50

z

z ( x, y, z ) ↔ ( r, θ, φ )

φ

r z

y x x

y

θ r =

x = r sin θ cos φ y = r sin θ sin φ

z φ = acos  -  r

34.4.4 Practice Problems 1. Simplify the following expressions.

b) c)

16 -------------------2 ( 4j + 4 ) 3j + 5 --------------------2 ( 4j + 3 ) ( 3 + 5j )4j

2

y θ = atan  -- x

z = r cos θ

a)

2

x +y +z

where,

j =

–1

2

math guide - 34.51

(ans. a)

16 16 16--------------------- = ------------------------------------ = ------= – 0.5j 2 – 16 + 32j + 16 32j ( 4j + 4 )

3j + 5 3j + 5 3j + 5 – 7 – 24j – 35 – 141j + 72 37 – 141j b) -------------------- = --------------------------------= ---------------------  --------------------- = --------------------------------------- = ----------------------2 – 16 + 24j + 9 – 7 + 24j – 7 – 24j 49 + 576 625 ( 4j + 3 ) c) ( 3 + 5j )4j = 12j + 20j 2 = 12j – 20

2. For the shape defined below, y

y = (x + 2)

2

a) find the area of the shape. b) find the centroid of the shape. c) find the moment of inertia of the shape about the centroid. x 4

34.5 MATRICES AND VECTORS

34.5.1 Vectors • Vectors are often drawn with arrows, as shown below,

head terminus A vector is said to have magnitude (length or strength) and direction. origin tail

math guide - 34.52

• Cartesian notation is also a common form of usage.

y

j x

i

z

k becomes y

z

j

k

x

i

• Vectors can be added and subtracted, numerically and graphically,

A = ( 2, 3, 4 )

A + B = ( 2 + 7, 3 + 8, 4 + 9 )

B = ( 7, 8, 9 )

A – B = ( 2 – 7, 3 – 8, 4 – 9 )

B A+B

Parallelogram Law A

A

B

34.5.2 Dot (Scalar) Product • We can use a dot product to find the angle between two vectors

math guide - 34.53

F2 = 5i + 3j

y F1 • F2 cos θ = ----------------F1 F2

F1 = 2i + 4j

θ

 ( 2 ) ( 5 ) + ( 4 )( 3)  ∴θ = acos  -------------------------------------------  2 2 + 4 2 5 2 + 3 2 22 ∴θ = acos  ----------------------- = 32.5° ( 4.47 ) ( 6 )

x

• We can use a dot product to project one vector onto another vector.

z We want to find the component of force F1 that projects onto the vector V. To do this we first convert V to a unit vector, if we do not, the component we find will be multiplied by the magnitude of V.

F 1 = ( – 3i + 4j + 5k )N

V = 1j + 1k y

x

λV

F1

1j + 1k V = ------ = --------------------- = 0.707j + 0.707k V 2 2 1 +1

F 1V = λ V • F 1 = ( 0.707j + 0.707k ) • ( – 3i + 4j + 5k )N ∴F 1V = ( 0 ) ( – 3 ) + ( 0.707 ) ( 4 ) + ( 0.707 ) ( 5 ) = 6N

V

F 1V

• We can consider the basic properties of the dot product and units vectors.

math guide - 34.54

Unit vectors are useful when breaking up vector magnitudes and direction. As an example consider the vector, and the displaced x-y axes shown below as x’-y’.

F = 10N

y y’

x’

45° 60° x We could write out 5 vectors here, relative to the x-y axis, x axis = 2i y axis = 3j x‘ axis = 1i + 1j y‘ axis = – 1i + 1j F = 10N ∠60° = ( 10 cos 60° )i + ( 10 sin 60° )j None of these vectors has a magnitude of 1, and hence they are not unit vectors. But, if we find the equivalent vectors with a magnitude of one we can simplify many tasks. In particular if we want to find the x and y components of F relative to the x-y axis we can use the dot product. λ x = 1i + 0j (unit vector for the x-axis) F x = λ x • F = ( 1i + 0j ) • [ ( 10 cos 60° )i + ( 10 sin 60° )j ] ∴ = ( 1 ) ( 10 cos 60° ) + ( 0 ) ( 10 sin 60° ) = 10N cos 60° This result is obvious, but consider the other obvious case where we want to project a vector onto itself,

math guide - 34.55

10 cos 60°i + 10 sin 60°j F λ F = ------ = --------------------------------------------------------- = cos 60°i + sin 60°j F 10

Incorrect - Not using a unit vector FF = F • F = ( ( 10 cos 60° )i + ( 10 sin 60° )j ) • ( ( 10 cos 60° )i + ( 10 sin 60° )j ) = ( 10 cos 60° ) ( 10 cos 60° ) + ( 10 sin 60° ) ( 10 sin 60° ) 2

2

= 100 ( ( cos 60° ) + ( sin 60° ) ) = 100 Using a unit vector FF = F • λF = ( ( 10 cos 60° )i + ( 10 sin 60° )j ) • ( ( cos 60° )i + ( sin 60° )j ) = ( 10 cos 60° ) ( cos 60° ) + ( 10 sin 60° ) ( sin 60° ) 2

2

= 10 ( ( cos 60° ) + ( sin 60° ) ) = 10

Correct Now consider the case where we find the component of F in the x’ direction. Again, this can be done using the dot product to project F onto a unit vector. u x' = cos 45°i + sin 45°j F x' = F • λ x' = ( ( 10 cos 60° )i + ( 10 sin 60° )j ) • ( ( cos 45° )i + ( sin 45° )j ) = ( 10 cos 60° ) ( cos 45° ) + ( 10 sin 60° ) ( sin 45° ) = 10 ( cos 60° cos 45° + sin 60° sin 45° ) = 10 ( cos ( 60° – 45° ) ) Here we see a few cases where the dot product has been applied to find the vector projected onto a unit vector. Now finally consider the more general case,

math guide - 34.56

y

V2 V1 θ2

V 2V 1 θ1 x

First, by inspection, we can see that the component of V2 (projected) in the direction of V1 will be, V 2V 1 = V 2 cos ( θ 2 – θ1 ) Next, we can manipulate this expression into the dot product form, = V 2 ( cos θ 1 cos θ2 + sin θ 1 sin θ2 ) = V 2 [ ( cos θ 1 i + sin θ 1 j ) • ( cos θ 2 i + sin θ 2 j ) ] V1 V2 V 1 • V2 V1 • V2 = V 2 --------- • --------- = V 2 ------------------ = ------------------ = V2 • λ V1 V1 V2 V1 V2 V1 Or more generally, V1 • V 2 V2 V 1 = V 2 cos ( θ2 – θ 1 ) = V 2 -----------------V1 V2 V1 • V2 ∴ V 2 cos ( θ 2 – θ1 ) = V 2 -----------------V1 V2 V1 • V2 ∴ cos ( θ 2 – θ 1 ) = -----------------V 1 V2 *Note that the dot product also works in 3D, and similar proofs are used.

math guide - 34.57

34.5.3 Cross Product • First, consider an example,

F = ( – 6.43i + 7.66j + 0k )N d = ( 2i + 0j + 0k )m i M = d×F =

j

k

2m 0m 0m – 6.43N 7.66N 0N

NOTE: note that the cross product here is for the right hand rule coordinates. If the left handed coordinate system is used F and d should be reversed.

∴M = ( 0m0N – 0m ( 7.66N ) )i – ( 2m0N – 0m ( – 6.43N ) ) j + ( 2m ( 7.66N ) – 0m ( –6.43N ) )k = 15.3k ( mN ) NOTE: there are two things to note about the solution. First, it is a vector. Here there is only a z component because this vector points out of the page, and a rotation about this vector would rotate on the plane of the page. Second, this result is positive, because the positive sense is defined by the vector system. In this right handed system find the positive rotation by pointing your right hand thumb towards the positive axis (the ‘k’ means that the vector is about the z-axis here), and curl your fingers, that is the positive direction.

• The basic properties of the cross product are,

math guide - 34.58

The cross (or vector) product of two vectors will yield a new vector perpendicular to both vectors, with a magnitude that is a product of the two magnitudes. V1 × V2 V1

V2

V1 × V2 = ( x 1 i + y1 j + z1 k ) × ( x2 i + y 2 j + z 2 k ) i j k V1 × V2 =

x1 y1 z1 x2 y2 z2

V 1 × V 2 = ( y 1 z 2 – z 1 y 2 )i + ( z 1 x 2 – x 1 z 2 )j + ( x 1 y 2 – y 1 x 2 )k We can also find a unit vector normal ‘n’ to the vectors ‘V1’ and ‘V2’ using a cross product, divided by the magnitude. V1 × V2 λ n = --------------------V1 × V2 • When using a left/right handed coordinate system,

The positive orientation of angles and moments about an axis can be determined by pointing the thumb of the right hand along the axis of rotation. The fingers curl in the positive direction. y

x

x

z

+ z

z

y

+ y

• The properties of the cross products are,

+ x

math guide - 34.59

The cross product is distributive, but not associative. This allows us to collect terms in a cross product operation, but we cannot change the order of the cross product. r 1 × F + r 2 × F = ( r 1 + r2 ) × F

DISTRIBUTIVE

r×F≠F×r but r × F = –( F × r )

NOT ASSOCIATIVE

34.5.4 Triple Product

When we want to do a cross product, followed by a dot product (called the mixed triple product), we can do both steps in one operation by finding the determinant of the following. An example of a problem that would use this shortcut is when a moment is found about one point on a pipe, and then the moment component twisting the pipe is found using the dot product.

ux uy uz ( d × F) • u =

dx dy dz F x F y Fz

34.5.5 Matrices • Matrices allow simple equations that drive a large number of repetitive calculations - as a result they are found in many computer applications. • A matrix has the form seen below,

math guide - 34.60

n columns a 11 a21 … a n1 a 12 a22 … a n2 … … … … a 1m a 2m … a nm

m rows

If n=m then the matrix is said to be square. Many applications require square matrices. We may also represent a matrix as a 1-by-3 for a vector.

• Matrix operations are available for many of the basic algebraic expressions, examples are given below. There are also many restrictions - many of these are indicated.

A = 2

3 4 5 B = 6 7 8 9 10 11

12 13 14 C = 15 16 17 18 19 20

Addition/Subtraction

3+2 4+2 5+2 A+B = 6+2 7+2 8+2 9 + 2 10 + 2 11 + 2

21 D = 22 23

E = 24 25 26

3 + 12 4 + 13 5 + 14 B + C = 6 + 15 7 + 16 8 + 17 9 + 18 10 + 19 11 + 20

B + D = not valid 3–2 4–2 5–2 B–A = 6–2 7–2 8–2 9 – 2 10 – 2 11 – 2 B – D = not valid

3 – 12 4 – 13 5 – 14 B + C = 6 – 15 7 – 16 8 – 17 9 – 18 10 – 19 11 – 20

math guide - 34.61

Multiplication/Division 3--2 B --- = 6--A 2 9--2

3(2 ) 4(2 ) 5(2) A ⋅ B = 6(2 ) 7(2 ) 8(2) 9 ( 2 ) 10 ( 2 ) 11 ( 2 )

B⋅D =

B⋅C =

( 3 ⋅ 21 + 4 ⋅ 22 + 5 ⋅ 23 ) ( 6 ⋅ 21 + 7 ⋅ 22 + 8 ⋅ 23 ) ( 9 ⋅ 21 + 10 ⋅ 22 + 11 ⋅ 23 )

4--2 7--2 10 -----2

5--2 8--2 11 -----2

D ⋅ E = 21 ⋅ 24 + 22 ⋅ 25 + 23 ⋅ 26

( 3 ⋅ 12 + 4 ⋅ 15 + 5 ⋅ 18 ) ( 3 ⋅ 13 + 4 ⋅ 16 + 5 ⋅ 19 ) ( 3 ⋅ 14 + 4 ⋅ 17 + 5 ⋅ 20 ) ( 6 ⋅ 12 + 7 ⋅ 15 + 8 ⋅ 18 ) ( 6 ⋅ 13 + 7 ⋅ 16 + 8 ⋅ 19 ) ( 6 ⋅ 14 + 7 ⋅ 17 + 8 ⋅ 20 ) ( 9 ⋅ 12 + 10 ⋅ 15 + 11 ⋅ 18 ) ( 9 ⋅ 13 + 10 ⋅ 16 + 11 ⋅ 19 ) ( 9 ⋅ 14 + 10 ⋅ 17 + 11 ⋅ 20 ) B- --B D --, -, ---- , etc = not allowed (see inverse) C D B Note: To multiply matrices, the first matrix must have the same number of columns as the second matrix has rows.

math guide - 34.62

Determinant B = 3⋅

7 8 –4⋅ 6 8 +5⋅ 6 7 10 11 9 11 9 10

7 8 10 11

= ( 7 ⋅ 11 ) – ( 8 ⋅ 10 ) = – 3

6 8 9 11

= ( 6 ⋅ 11 ) – ( 8 ⋅ 9 ) = – 6

6 7 9 10

= ( 6 ⋅ 10 ) – ( 7 ⋅ 9 ) = – 3

= 3 ⋅ ( – 3 ) – 4 ⋅ ( –6 ) + 5 ⋅ ( – 3 ) = 0

D , E = not valid (matrices not square)

Transpose

3 6 9 T B = 4 7 10 5 8 11

T

D = 21 22 23

24 T E = 25 26

math guide - 34.63

Adjoint

T

7 8 10 11 B = – 4 5 10 11 4 5 7 8

– 6 8 10 11 3 5 9 11

6 7 9 10 – 3 4 9 10

– 3 5 6 8

3 4 6 7

The matrix of determinant to the left is made up by getting rid of the row and column of the element, and then finding the determinant of what is left. Note the sign changes on alternating elements.

D = invalid (must be square)

Inverse x D = B⋅ y z

To solve this equation for x,y,z we need to move B to the left hand side. To do this we use the inverse.

–1

B D = B

–1

x ⋅B⋅ y z

x x –1 B D = I⋅ y = y z z

B

D

–1

–1

B = --------B

In this case B is singular, so the inverse is undetermined, and the matrix is indeterminate.

= invalid (must be square)

math guide - 34.64

Identity Matrix This is a square matrix that is the matrix equivalent to ‘1’. B⋅I = I⋅B = B D⋅I = I⋅D = D B

–1

⋅B = I

1 0 0 1 0, , 1 0 1 0 , etc=I 0 1 0 0 1 • The eigenvalue of a matrix is found using,

A – λI = 0

34.5.6 Solving Linear Equations with Matrices • We can solve systems of equations using the inverse matrix,

Given, 2⋅x+4⋅y+3⋅z = 5 9⋅x+6⋅y+8⋅z = 7 11 ⋅ x + 13 ⋅ y + 10 ⋅ z = 12 Write down the matrix, then rearrange, and solve. 2 4 3 x 5 = 9 6 8 y 7 11 13 10 z 12

x 2 4 3 ∴ y = 9 6 8 z 11 13 10

–1

5 7 = 12

math guide - 34.65

• We can solve systems of equations using Cramer’s rule (with determinants),

Given, 2⋅x+4⋅y+3⋅z = 5 9⋅x+6⋅y+8⋅z = 7 11 ⋅ x + 13 ⋅ y + 10 ⋅ z = 12 Write down the coefficient and parameter matrices,

A =

2 4 3 9 6 8 11 13 10

B =

5 7 12

Calculate the determinant for A (this will be reused), and calculate the determinants for matrices below. Note: when trying to find the first parameter ‘x’ we replace the first column in A with B. 5 4 3 7 6 8 12 13 10 x = ------------------------------ = A 2 5 3 9 7 8 11 12 10 y = ------------------------------ = A 2 4 5 9 6 7 11 13 12 z = ------------------------------ = A

34.5.7 Practice Problems 1. Perform the matrix operations below.

math guide - 34.66

Multiply

ANS.

1 2 3 10 4 5 6 11 = 7 8 9 12 Determinant 12 3 42 6 78 9

1 2 3 10 68 = 4 5 6 11 167 7 8 9 12 266

1 2 3 4 2 6 7 8 9

=

Inverse 12 3 42 6 78 9

1 2 3 4 2 6 7 8 9

–1

=

= 36

–1

=

– 0.833 0.167 0.167 0.167 – 0.333 0.167 0.5 0.167 –0.167

2. Perform the vector operations below, 1 A = 2 3

6 B = 2 1

Cross Product

A×B =

Dot Product

A•B =

ANS. A × B = ( – 4, 17, – 10 ) A • B = 13

4. Solve the following equations using any technique, 5x – 2y + 4z = – 1 6x + 7y + 5z = – 2 2x – 3y + 6z = – 3

ANS. x= 0.273 y= -0.072 z= -0.627

5. Solve the following set of equations using a) Cramer’s rule and b) an inverse matrix. 2x + 3y = 4 5x + 1y = 0

math guide - 34.67

(ans.

a)

2 3 x = 4 5 1 y 0

b)

4 3 0 1 4 x = ---------------- = --------– 13 2 3 5 1

2 4 5 0 – 20 20 y = ---------------- = --------- = -----– 13 13 2 3 5 1

T

x = 2 3 y 5 1

–1

1 –3 1 –( 5 ) 4 – -----– 5 2 – ( 3 ) 2 1- 4 4 = -------------------------------- 4 = ------------------- 4 =  – ----= 13   – 13 13 0 0 – 20 20 0 2 3 -----13 5 1

6. Perform the following matrix calculation. Show all work. T

A B C X L + D E F Y M GH I Z N (ans.

T

A B C X L D E F Y + M GH I Z N

T

=

AX + BY + CZ L DX + EY + FZ + M GX + YH + IZ N

AX + BY + CZ + L = DX + EY + FZ + M GX + YH + IZ + N

= AX + BY + CZ + L DX + EY + FZ + M GX + YH + IZ + N 7. Perform the matrix calculations given below. a)

A B C X D E F Y = GH I Z

b)

A B C D E F X Y Z = GH I

T

math guide - 34.68

8. Find the dot product, and the cross product, of the vectors A and B below. x A = y z

(ans.

p B = q r

A • B = xp + yq + zr A×B =

i j k x y z p q r

yr – zq = i ( yr – zq ) + j ( zp – xr ) + k ( xq – yp ) = zp – xr xq – yp

9. Perform the following matrix calculations. a)

a b c

T

b)

d e f g h k mnp

a b c d

c)

a b c d

–1

(ans. a)

b)

a b c

T

d e f d e f = g h k a b c g h k = ( ad + bg + cm ) ( ae + bh + cn ) ( af + bk + cp ) mnp mnp

a b c d

= ad – bc

adj

c) a b c d

–1

a b d –c d - ----------------–c ----------------c d –b a ad – bc ad – bc = ------------------- = ------------------- = ad – bc – b - ----------------a a b ----------------ad – bc ad – bc c d

math guide - 34.69

10. Find the value of ‘x’ for the following system of equations. x + 2y + 3z = 5 x + 4y + 8z = 0 4x + 2y + z = 1

(ans.

12 3 x 5 14 8 y = 0 42 1 z 1 5 2 3 0 4 8 1 2 1 5 ( 4 – 16 ) + 2 ( 8 – 0 ) + 3 ( 0 – 4 ) – 60 + 16 – 12 – 56 x = ------------------ = ---------------------------------------------------------------------------------- = ---------------------------------- = --------- = – 7 1 ( 4 – 16 ) + 2 ( 32 – 1 ) + 3 ( 2 – 16 ) – 12 + 62 – 42 8 1 2 3 1 4 8 4 2 1

11. Perform the matrix calculations given below. a)

A B C X D E F Y = GH I Z

b)

A B C D E F X Y Z = GH I

c)

d)

e)

det A B = C D A B C D A B C D

A

= –1

=

math guide - 34.70

12. Solve the following set of equations with the specified methods. 3x + 5y = 7 4x – 6y = 2

a) Inverse matrix b) Cramer’s rule c) Gauss-Jordan row reduction d) Substitution

34.6 CALCULUS • NOTE: Calculus is very useful when looking at real systems. Many students are turned off by the topic because they "don’t get it". But, the secret to calculus is to remember that there is no single "truth" - it is more a loose collection of tricks and techniques. Each one has to be learned separately, and when needed you must remember it, or know where to look.

34.6.1 Single Variable Functions 34.6.1.1 - Differentiation • The basic principles of differentiation are,

math guide - 34.71

Both u, v and w are functions of x, but this is not shown for brevity. Also note that C is used as a constant, and all angles are in radians.

d----(C) = 0 dx dd ----( Cu ) = ( C ) ------ ( u ) dx dx dd d ----( u + v + … ) = ------ ( u ) + ------ ( v ) + … dx dx dx d- n n–1 d ----( u ) = ( nu ) ------ ( u ) dx dx dd d ----( uv ) = ( u ) ------ ( v ) + ( v ) ------ ( u ) dx dx dx d-  u--- v d u- ----d -------- ------ ( u ) –  ---=  2 dx  2 dx ( v ) dx  v v v dd d d ----( uvw ) = ( uv ) ------ ( w ) + ( uw ) ------ ( v ) + ( vw ) ------ ( u ) dx dx dx dx dd d ----( y ) = ------ ( y ) ------ ( u ) = chain rule dx du dx d1 ----( u ) = -------------dx d----( x) du d----(y) d du ------ ( y ) = -------------dx d----(x) du

• Differentiation rules specific to basic trigonometry and logarithm functions

math guide - 34.72

dd ----( sin u ) = ( cos u ) ------ ( u ) dx dx dd ----( cos u ) = ( – sin u ) ------ ( u ) dx dx d1 2d ----( tan u ) =  ----------- ------ ( u ) dx cos u dx d- u u d ----( e ) = ( e ) ------ ( u ) dx dx d1 ----( ln x ) = --dx x

d2 d ----( cot u ) = ( – csc u ) ------ ( u ) dx dx d d----( sec u ) = ( tan u sec u ) ------ ( u ) dx dx dd ----( csc u ) = ( – csc u cot u ) ------ ( u ) dx dx dd ----( sinh u ) = ( cosh u ) ------ ( u ) dx dx dd ----( cosh u ) = ( sinh u ) ------ ( u ) dx dx d2 d ----( tanh u ) = ( sech u ) ------ ( u ) dx dx

• L’Hospital’s rule can be used when evaluating limits that go to infinity.

d- d- 2   ---  ---f(x)  f( x)   dt  dt     f ( x ) - = … lim  ---------- = lim  --------------------- = lim  ----------------------x → a g(x) x → a  d  x → a  d  2  ---- g ( x ) g ( x )   dt    ---dt • Some techniques used for finding derivatives are,

math guide - 34.73

Leibnitz’s Rule, (notice the form is similar to the binomial equation) can be used for finding the derivatives of multiplied functions. d- 0  ----d- n d- 1  ----d- n – 1 d- n  ---- ---- n  ----( uv ) = ( u ) ( v ) + ( u ) (v)  dx  dx  dx  dx  1  dx d n–2 d 0 d- 2  ----n d n  n  ----( u )  - ( v ) + … +    ------ ( u )  ------ ( v )  n dx  2  dx dx dx

34.6.1.2 - Integration • Some basic properties of integrals include,

In the following expressions, u, v, and w are functions of x. in addition to this, C is a constant. and all angles are radians.

∫ C dx

= ax + C

∫ Cf ( x ) dx

= C ∫ f ( x ) dx

∫ ( u + v + w + … ) dx ∫ u dv

=

∫ u dx + ∫ v dx + ∫ w dx + …

= uv – ∫ v du = integration by parts

1 u = Cx = ---- ∫ f ( u ) du C dF(u) ( x ) du = ∫ ----------- du ∫ F ( f ( x ) ) dx = ∫ F ( u ) ----du f' ( x )

∫ f ( Cx ) dx

n+1

x n +C ∫ x dx = ----------n+1 x

x a+C ∫ a dx = ------ln a

1

∫ --x- dx ∫ e dx x

= ln x + C x

= e +C

• Some of the trigonometric integrals are,

u = f(x)

math guide - 34.74

∫ sin x dx

= – cos x + C

∫ cos x dx

= sin x + C

∫ ( sin x )

2

∫ ( cos x )

3x sin 2x sin 4x dx = ------ + ------------- + ------------- + C 8 4 32 n+1 ( sin x ) n +C ∫ cos x ( sin x ) dx = -----------------------n+1

∫ ( cos x )

4

sin x cos x + x dx = – ------------------------------- + C 2

∫ sinh x dx

= cosh x + C

sin x cos x + x dx = ------------------------------- + C 2

∫ cosh x dx

= sinh x + C

∫ tanh x dx

= ln ( cosh x ) + C

2

2

cos x ( ( sin x ) + 2 )3 +C ∫ ( sin x ) dx = – ------------------------------------------3 2

sin x ( ( cos x ) + 2 )+C ∫ ( cos x ) dx = ------------------------------------------3 3

∫ x cos ( ax ) dx

cos ( ax -) --x= -----------------+ sin ( ax ) + C 2 a a 2 2

2 2x cos ( ax -) ------------------a x –2 + sin ( ax ) + C ∫ x cos ( ax ) dx = ------------------------2 3 a a

• Some other integrals of use that are basically functions of x are,

math guide - 34.75

n+1

x n -+C ∫ x dx = ----------n+1

∫ ( a + bx )

–1

ln a + bx dx = ----------------------- + C b

2 –1 1 a + 2 –b ( a + bx ) dx = ---------------------- ln  --------------------------- + C, a > 0, b < 0 ∫ 2 ( – b )a a – x –b 2

ln ( bx + a -) +C ∫ x ( a + bx ) dx = --------------------------2b 2 –1

∫x

2

∫ (a

x a x ab 2 –1 ( a + bx ) dx = --- – ------------- atan  ------------- + C b b ab a 2

1 a+x 2 –1 2 2 – x ) dx = ------ ln  ------------ + C, a > x 2a a–x

∫ ( a + bx ) ∫ x(x

2

–1

2

2 a + bx dx = ---------------------- + C b

1 – --2

± a ) dx =

2

CORRECT??

2

x ±a +C

2 –1 1 ( a + bx + cx ) dx = ------ ln ∫ c

2 b a + bx + cx + x c + ---------- + C, c > 0 2 c

2 –1 1 – 2cx – b ( a + bx + cx ) dx = ---------- asin ------------------------- + C, c < 0 ∫ 2 –c b – 4ac

math guide - 34.76

1 --2

3 ---

1--2

3---

22 ( a + bx ) ∫ ( a + bx ) dx = ----3b 22 ( a + bx ) ∫ ( a + bx ) dx = ----3b

∫ x ( a + bx )

1 --2

3 --2

2 ( 2a – 3bx ) ( a + bx ) dx = – ---------------------------------------------------2 15b 1

---  2 2 1   ln  x +  ----2- + x   1 --a   2 2 2 1--x ( 1 + a x ) + --------------------------------------------2 2 2 a ∫ ( 1 + a x ) dx = ---------------------------------------------------------------------------------2 3--2 2

1 a  ----2- + x   a --------------------------( + x ) d x x 1 a = ∫ 3 1 --2 2 2

1

---  1 2 2   ----3 1 1 ln  x +  2 + x   ------a   ax 18 2 2 2 2 2 2 2 2 2  ---------------------------------------------------------( 1 + a x ) d x = + x – x ( 1 + a x ) – x ∫ 2 2 3  4 a 8a 8a 1--2 2 2

1---

1--asin ( ax ) 2 2 2 ( – x ) d x = x ( 1 – a x ) + --------------------1 a ∫ 2 a 1--2 2 2

3---

1 --2 2

3 ---

a 1 2 2 ∫ x ( 1 – a x ) dx = – --3-  a----2- – x  1 ---

x- 2 2 2 1--x 2 2 2 2 -x ( a – x ) d x – ( – x ) x ( a – x ) + a asin  --- = a + ∫  8 4 a 2

2

1 – --2

1 ---

1 1 2 2 ∫ ( 1 + a x ) dx = --a- ln x +  a----2- + x  2 2

∫(1 – a

1 – --2

1 1 x ) dx = --- asin ( ax ) = – --- acos ( ax ) a a

2 2

math guide - 34.77

• Integrals using the natural logarithm base ‘e’,

ax

ax e +C ∫ e dx = -----a ax

e ( ax – 1 ) + C ∫ xe dx = -----2 a ax

34.6.2 Vector Calculus • When dealing with large and/or time varying objects or phenomenon we must be able to describe the state at locations, and as a whole. To do this vectors are a very useful tool. • Consider a basic function and how it may be represented with partial derivatives.

math guide - 34.78

y = f ( x, y, z ) We can write this in differential form, but the right hand side must contain partial derivatives. If we separate the operators from the function, we get a simpler form. We can then look at them as the result of a dot product, and divide it into two vectors. ∂ ∂ ∂ ( d )y =    f ( x, y, z ) dx +    f ( x, y, z ) dy +    f ( x, y, z ) dz ∂x ∂y ∂z ∂ ∂ ∂ ( d )y =   dx +   dy +   dz f ( x, y, z ) ∂x ∂y ∂z ∂ ∂ ∂ ( d )y =  i + j + k • ( dxi + dyj + dzk ) f ( x, y, z ) ∂x ∂y ∂z We then replace these vectors with the operators below. In this form we can manipulate the equation easily (whereas the previous form was very awkward). ( d )y = [ ∇ • dX ]f ( x, y, z ) ( d )y = ∇f ( x, y, z ) • dX ( d )y = ∇f ( x, y, z ) dX cos θ In summary, ∇ =

∂ ∂ ∂ i+ j+ k ∂x ∂y ∂z

F = F x i + F y j + Fz k

∇ • F = the divergence of function F ∇ × F = the curl of function F

• Gauss’s or Green’s or divergence theorem is given below. Both sides give the flux across a surface, or out of a volume. This is very useful for dealing with magnetic fields.

∫ ( ∇ • F ) dV V

=

°∫ FdA A

where, V, A = a volume V enclosed by a surface area A F = a field or vector value over a volume

math guide - 34.79

• Stoke’s theorem is given below. Both sides give the flux across a surface, or out of a volume. This is very useful for dealing with magnetic fields.

∫ ( ∇ × F ) dA

=

A

°∫ FdL L

where, A, L = A surface area A, with a bounding parimeter of length L F = a field or vector value over a volume

34.6.3 Differential Equations • Solving differential equations is not very challenging, but there are a number of forms that need to be remembered. • Another complication that often occurs is that the solution of the equations may vary depending upon boundary or initial conditions. An example of this is a mass spring combination. If they are initially at rest then they will stay at rest, but if there is some disturbance, then they will oscillate indefinitely. • We can judge the order of these equations by the highest order derivative in the equation. • Note: These equations are typically shown with derivatives only, when integrals occur they are typically eliminated by taking derivatives of the entire equation. • Some of the terms used when describing differential equations are, ordinary differential equations - if all the derivatives are of a single variable. In the example below ’x’ is the variable with derivatives.

e.g.,

d d- 2  ---x +  ----- x = y  dt dt

first-order differential equations - have only first-order derivatives,

e.g.,

d- d-  --- --- dt x +  dt y = 2

math guide - 34.80

second-order differential equations - have at least on second derivative, 2

d d-  ---x +  ----- y = 2  dt  dt

e.g.,

higher order differential equations - have at least one derivative that is higher than second-order. partial differential equations - these equations have partial derivatives • Note: when solving these equations it is common to hit blocks. In these cases backtrack and try another approach. • linearity of a differential equation is determined by looking at the dependant variables in the equation. The equation is linear if they appear with an exponent other than 1.

eg.

y'' + y' + 2 = 5x 2

( y'' ) + y' + 2 = 5x 3

linear non-linear

y'' + ( y' ) + 2 = 5x

non-linear

y'' + sin ( y' ) + 2 = 5x

non-linear

34.6.3.1 - First-order Differential Equations • These systems tend to have a relaxed or passive nature in real applications. • Examples of these equations are given below,

2

3

y' + 2xy – 4x = 0 y' – 2y = 0

• Typical methods for solving these equations include, guessing then testing separation

math guide - 34.81

homogeneous 34.6.3.1.1 - Guessing • In this technique we guess at a function that will satisfy the equation, and test it to see if it works.

y' + y = 0 y = Ce

the given equation

–t

the guess

now try to substitute into the equation y' = –Ce

–t –t

y' + y = – Ce + Ce

–t

= 0

therefore the guess worked - it is correct y = Ce

–t

• The previous example showed a general solution (i.e., the value of ’C’ was not found). We can also find a particular solution.

y = Ce y = 5e

–t

–t

a general solution a particular solution

34.6.3.1.2 - Separable Equations • In a separable equation the differential can be split so that it is on both sides of the equation. We then integrate to get the solution. This typically means there is only a single derivative term.

math guide - 34.82

e.g.,

dx ------ + y 2 + 2y + 3 = 0 dy 2

∴dx = ( – y – 2y – 3 )dy 3

–y 2 ∴x = -------- – y – 3y + C 3 e.g.,

dx ------ + x = 0 dy 1 ∴ – --- dx = dy x ∴ ln ( – x ) = y

34.6.3.1.3 - Homogeneous Equations and Substitution • These techniques depend upon finding some combination of the variables in the equation that can be replaced with another variable to simplify the equation. This technique requires a bit of guessing about what to substitute for, and when it is to be applied.

math guide - 34.83

e.g.,

dy ------ = y-- – 1 dx x

the equation given

y u = -x

the substitution chosen

Put the substitution in and solve the differential equation, dy ------ = u – 1 dx du ∴u + x ------ = u – 1 dx du –1 ∴------ = -----dx x du 1 ∴– ------ = --dx x ∴– u = ln ( x ) + C Substitute the results back into the original substitution equation to get rid of ’u’, y – -- = ln ( x ) + C x ∴y = – x ln ( x ) – Cx

34.6.3.2 - Second-order Differential Equations • These equations have at least one second-order derivative. • In engineering we will encounter a number of forms, - homogeneous - nonhomogeneous 34.6.3.2.1 - Linear Homogeneous • These equations will have a standard form,

math guide - 34.84

d- 2 d-  --- ---y + A  dt  dt y + By = 0

• An example of a solution is,

e.g.,

d- 2 d-  --- --- dt y + 6  dt y + 3y = 0 Guess, y = e

Bt

d- Bt  --- dt y = Be 2

d- 2 Bt  --- dt y = B e substitute and solve for B, 2 Bt

Bt

B e + 6Be + 3e

Bt

= 0

2

B + 6B + 3 = 0 B = – 3 + 2.449j, – 3 – 2.449j substitute and solve for B, y = e y = e y = e

( – 3 + 2.449j )t – 3 t 2.449jt

e

–3 t

( cos ( 2.449t ) + j sin ( 2.449t ) )

Note: if both the roots are the same, y = C1e

Bt

+ C 2 te

Bt

34.6.3.2.2 - Nonhomogeneous Linear Equations • These equations have the general form,

math guide - 34.85

d- 2 d-  --- ---y + A  dt  dt y + By = Cx

• to solve these equations we need to find the homogeneous and particular solutions and then add the two solutions.

y = yh + yp to find yh solve, d- 2 d  --- --- dt y + A  dt y + B = 0 to find yp guess at a value of y and then test for validity, A good table of guesses is, Cx form

Guess

A

C

Ax + B Ax e

Cx + D Ax Ax Ce Cxe

B sin ( Ax )

or B cos ( Ax )

• Consider the example below,

C sin ( Ax ) + D cos ( Ax ) or Cx sin ( Ax ) + xD cos ( Ax )

math guide - 34.86

d- 2 d- – 2x  --- ---y + y – 6y = e  dt  dt First solve for the homogeneous part, d- 2 d-  --- --- dt y +  dt y – 6y = 0

try

y = e

Bx

d- Bx  ---= Be y  dt 2

d- 2 Bx  ---y = B e  dt 2 Bx

B e

+ Be

Bx

– 6e

Bx

= 0

2

B +B–6 = 0 B = – 3, 2 yh = e

– 3x

+e

2x

Next, solve for the particular part. We will guess the function below. y = Ce

– 2x

d- – 2x  ---y = – 2C e  dt 2

d- – 2x  --- dt y = 4Ce 4Ce

– 2x

+ – 2C e

– 2x

– 6Ce

– 2x

= e

– 2x

4C – 2C – 6C = 1 C = 0.25 y p = 0.25e

– 2x

Finally, y = e

– 3x

+e

2x

+ 0.25e

– 2x

34.6.3.3 - Higher Order Differential Equations

34.6.3.4 - Partial Differential Equations • Partial difference equations become critical with many engineering applications involving flows, etc.

math guide - 34.87

34.6.4 Other Calculus Stuff • The Taylor series expansion can be used to find polynomial approximations of functions.

(n – 1)

2

n–1

f f'' ( a ) ( x – a ) ( a)(x – a) f ( x ) = f ( a ) + f' ( a ) ( x – a ) + ------------------------------- + … + -----------------------------------------------2! ( n – 1 )!

34.6.5 Practice Problems 1. Find the derivative of the function below with respect to time. 3t ------------------ + e 2t 2 (2 + t)

(ans.  d   3t d- d –2 2t –2 –3 2t ----- ------------------ + e 2t =  ---( 3t ( 2 + t ) ) +  ----- ( e ) = 3 ( 2 + t ) – 6t ( 2 + t ) + 2e 2  dt    dt  dt (2 + t) 2. Solve the following differential equation, given the initial conditions at t=0s. x'' + 4x' + 4x = 5t

x0 = 0

x' 0 = 0

math guide - 34.88

(ans.

homogeneous solution: guess:

x'' + 4x' + 4x = 0

xh = e

At

x h' = Ae

2 At

At

A e + 4Ae + 4e xh = C1 e

– 2t

+ C 2 te

At

At

2 At

x h'' = A e 2

= 0 = A + 4A + 4 = ( A + 2 ) ( A + 2 )

– 2t

particular solution: guess: x p = At + B

x p' = A

x p'' = 0

( 0 ) + 4 ( A ) + 4 ( At + B ) = 5t ( 4A + 4B ) + ( 4A )t = ( 0 ) + ( 5 )t 5 A = --- = 1.25 4 x p = 1.25t – 1.25 combine and solve for constants: x ( t ) = xh + xp = C1 e for x(0) = 0

– 2t

0 = C1 e

for (d/dt)x(0) = 0

4 ( 1.25 ) + 4B = 0

+ C 2 te –2 ( 0 )

– 2t

+ 1.25t – 1.25

+ C 2 ( 0 )e

0 = ( – 2 )C 1 e

–2 ( 0 )

–2 ( 0 )

+ 1.25 ( 0 ) – 1.25 = C 1 – 1.25 C 1 = 1.25

+ ( – 2 )C 2 ( 0 )e

– 2 C 1 + C 2 + 1.25 = 0 = –2 ( 1.25 ) + C 2 + 1.25 2t

2t

x ( t ) = 1.25e + 1.25te + 1.25t – 1.25 3. Find the following derivatives. d a) ----- ( sin t + cos t ) dt d –2 b) ----- ( ( t + 2 ) ) dt d 8t c) ----- ( 5te ) dt d d) ----- ( 5 ln t ) dt

B = – 1.25

–2( 0)

+ C2 e

–2 ( 0 )

+ 1.25

C 2 = 1.25

math guide - 34.89

(ans. d d d a) ----- ( sin t + cos t ) = ----- ( sin t ) + ----- ( cos t ) = cos t – sin t dt dt dt d –2 –3 b) ----- ( ( t + 2 ) ) = –2 ( t + 2 ) dt d 8t 8t 8t c) ----- ( 5te ) = 5e + 40te dt d 5 d) ----- ( 5 ln t ) = --dt t 4. Find the following integrals

∫ 6 t dt 7t b) ∫ 14 e dt c) ∫ sin ( 0.5t ) dt 2

a)

d)

5

∫ --x- dx

(ans. 3

t 3 a) ∫ 6 t dt = 6  ---- = 2t + C 3 2

7t

e 7t 7t b) ∫ 14 e dt = 14  ------ + C = 2e + C 7 c)

∫ sin ( 0.5t ) dt

d)

∫ --x- dx

5

– cos ( 0.5t ) = -------------------------- + C = – 2 cos ( 0.5t ) + C 0.5

= 5 ln ( x ) + C

5. Find the following derivative. d4t –3 ---( 5te + ( t + 4 ) ) dt

math guide - 34.90

6. Find the following derivatives. a)

1 - d-  --------------dx  x + 1

b)

d- –t ---( e sin ( 2t – 4 ) ) dt

(ans. a)

d-  ----------1 - –1 ----= ------------------2  dx x + 1 (x + 1)

b)

d ----- ( e –t sin ( 2t – 4 ) ) = – e –t sin ( 2t – 4 ) + 2e –t cos ( 2t – 4 ) dt

7. Solve the following integrals. a)

b)

(ans.

∫e

2t

dt

∫ ( sin θ + cos 3θ ) dθ

a)

∫e

b)

∫ ( sin θ + cos 3θ ) dθ

2t

2t

dt = 0.5e + C 1 = – cos θ + --- sin 3θ + C 3

8. Solve the following differential equation. x'' + 5x' + 3x = 3

x( 0) = 1 x' ( 0 ) = 1

math guide - 34.91

(ans.

x( 0) = 1

x'' + 5x' + 3x = 3

x' ( 0 ) = 1

Homogeneous: 2

A + 5A + 4 = 0 – 5 ± 25 – 16 –5±3 A = ------------------------------------ = ---------------- = – 4, – 1 2 2 xh = C1 e

– 4t

+ C2e

–t

Particular: xp = A

x'p = 0

x'' p = 0

0 + 5 ( 0 ) + 3A = 3

A = 1

xp = 1 Initial values: x = x h + xp = C1 e

– 4t

–t

+ C2 e + 1

1 = C1( 1 ) + C2( 1 ) + 1 x' = – 4C 1 e

– 4t

– C2e

–t

1 = – 4C 1 ( 1 ) – C 2 ( 1 ) 4 ( – C2 ) + C2 = –1 1 – 4t 1 –t x = – --- e + --- e + 1 3 3

C1 = –C2

1 C 2 = --3 1 C 1 = – --3

9. Set up an integral and solve it to find the volume inside the shape below. The shape is basically a cone with the top cut off.

math guide - 34.92

z

y

b x a

(ans.

V =



c

a

dV =

∫0 A dx

c–b r = b +  ----------- x a 2

2

c–b c–b c–b 2 2 2 A = πr = π  b +  ----------- x = πb + 2π  ----------- x + π  ----------- x   a    a   a  a

V =

2

c–b 2 2 c – b- x + π  ----------- x  dx ∫0  πb + 2π  ---------a  a

c–b 2 π c–b 3 V = πb x + π  ----------- x + ---  ----------- x 3 a a 2

2

a

0

c–b 2 π c–b 2 3 2 V = πb a + π  ----------- a + ---  ----------- a a 3 a π 2 2 2 V = πb a + π ( c – b )a + --- ( c – b ) a 3 10. Solve the first order non-homogeneous differential equation below. Assume the system starts at rest. 2x' + 4x = 5 sin 4t 11. Solve the second order non-homogeneous differential equation below. 2x'' + 4x' + 2x = 5

where,

x( 0) = 2 x' ( 0 ) = 0

math guide - 34.93

34.7 NUMERICAL METHODS • These techniques approximate system responses without doing integrations, etc.

34.7.1 Approximation of Integrals and Derivatives from Sampled Data • This form of integration is done numerically - this means by doing repeated calculations to solve the equation. Numerical techniques are not as elegant as solving differential equations, and will result in small errors. But these techniques make it possible to solve complex problems much faster. • This method uses forward/backward differences to estimate derivatives or integrals from measured data.

y(t) yi + 1 yi yi – 1

ti – 1

T

ti

T

ti + 1

ti

T i + y i – 1  y-------------------( ) ≈ y t ∫ti – 1 i  2 - ( ti – ti – 1 ) = --2- ( y i + yi – 1 ) y i – y i – 1 y i + 1 – y i d---- =  -------------------- = --1- ( y i – y i – 1 ) = --1- ( y i + 1 – y i ) y ( t i ) ≈  ------------------- ti – ti – 1   t i + 1 – ti  dt T T 1 --1- ( y i + 1 – y i ) – --- ( y i – y i – 1 ) –2 yi + yi – 1 + y i + 1 d- T T  ---------------------------------------------------------------------------------------------------------------≈ y ( t ) = i 2  dt T T 2

math guide - 34.94

34.7.2 Euler First-order Integration • We can also estimate the change resulting from a derivative using Euler’s equation for a first-order difference equation. d y ( t + h ) ≈ y ( t ) + h ----- y ( t ) dt

34.7.3 Taylor Series Integration • Recall the basic Taylor series,

1 2 d 2 d 1 3 d 3 1 4 d 4 x ( t + h ) = x ( t ) + h  ----- x ( t ) + ----- h  ----- x ( t ) + ----- h  ----- x ( t ) + ----- h  ----- x ( t ) + …  dt 2!  dt 3!  dt 4!  dt

• When h=0 this is called a MacLaurin series. • We can integrate a function by,

d-  ---= 0  dt x 0

d- 2 3  ---x = 1+x +t  dt

x0 = 0 t (s)

x(t)

d/dt x(t)

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

0

0

h = 0.1

math guide - 34.95

34.7.4 Runge-Kutta Integration • The equations below are for calculating a fourth order Runge-Kutta integration.

1 x ( t + h ) = x ( t ) + --- ( F 1 + 2F 2 + 2F 3 + F4 ) 6 F 1 = hf ( t, x ) F1 h F 2 = hf  t + ---, x + ------ 2 2 F2 h F 3 = hf  t + ---, x + ------  2 2 F 4 = hf ( t + h, x + F 3 ) where, x = the state variables f = the differential function t = current point in time h = the time step to the next integration point

34.7.5 Newton-Raphson to Find Roots • When given an equation where an algebraic solution is not feasible, a numerical solution may be required. One simple technique uses an instantaneous slope of the function, and takes iterative steps towards a solution.

f ( xi ) x i + 1 = x i – ----------------------d ----f ( x )  dx i  • The function f(x) is supplied by the user.

math guide - 34.96

• This method can become divergent if the function has an inflection point near the root. • The technique is also sensitive to the initial guess. • This calculation should be repeated until the final solution is found.

34.8 LAPLACE TRANSFORMS • The Laplace transform allows us to reverse time. And, as you recall from before the inverse of time is frequency. Because we are normally concerned with response, the Laplace transform is much more useful in system analysis. • The basic Laplace transform equations is shown below,

F(s) =



∫0 f ( t )e

– st

dt

where, f ( t ) = the function in terms of time t F ( s ) = the function in terms of the Laplace s

34.8.1 Laplace Transform Tables • Basic Laplace Transforms for operational transformations are given below,

math guide - 34.97

TIME DOMAIN

FREQUENCY DOMAIN

Kf ( t )

Kf ( s )

f1 ( t ) + f2 ( t ) –f3 ( t ) + … df (t) ----------dt

f1 ( s ) + f2 ( s ) –f 3 ( s ) + … –

sf ( s ) – f ( 0 )

2



d------------f ( t )2 dt

df ( 0 ) 2 – s f ( s ) – sf ( 0 ) – -----------------dt

n

f ( t )d------------n dt

n

s f( s) – s

t

∫0 f ( t ) dt

f-------( s -) s

f ( t – a )u ( t – a ), a > 0

e

e

– at

f(t)

f ( at ), a > 0 tf ( t ) n

t f(t) f------( t )t

– as

n–1



f(0 ) – s

n – 2 df ( 0



f( s)

f(s – a) 1  s --- f --a  a –-------------df ( s )ds n

f ( s -) ( – 1 ) -------------n ds nd

n



f ( 0 )-----------------)- – … – d------------------n dt dt



∫ f ( u ) du s

• A set of useful functional Laplace transforms are given below,

math guide - 34.98

TIME DOMAIN

A --s

A

1 ---2 s 1---------s+a

t e

– at

ω ----------------2 2 s +ω s ----------------2 2 s +ω

sin ( ωt ) cos ( ωt ) te e e

FREQUENCY DOMAIN

– at

– at

– at

Ae

sin ( ωt ) cos ( ωt )

– at

Ate

2

2

2

2

(s + a) + ω s+a ------------------------------(s + a) + ω

A---------s–a

– at

2Ae

1 ------------------2 (s + a) ω -------------------------------

– αt

2t A e

A ----------------2 (s – a) cos ( βt + θ )

– αt

cos ( βt + θ )

complex conjugate

A A ----------------------+ -------------------------------------s + α + βj s + α – βj complex conjugate

A A ------------------------------ + ------------------------------------2 2 ( s + α – βj ) ( s + α + βj )

• Laplace transforms can be used to solve differential equations.

math guide - 34.99

34.9 z-TRANSFORMS • For a discrete-time signal x [ n ] , the two-sided z-transform is defined by ∞

X(z) =



∞ –n

x [ n ]z . The one-sided z-transform is defined by X ( z ) =

n = –∞

∑ x [ n ]z

–n

. In

n=0

both cases, the z-transform is a polynomial in the complex variable z . • The inverse z-transform is obtained by contour integration in the complex plane n–1 1 dz . This is usually avoided by partial fraction inversion techx [ n ] = -------- ∫ X ( z )z j2π° niques, similar to the Laplace transform. • Along with a z-transform we associate its region of convergence (or ROC). These are the values of z for which X ( z ) is bounded (i.e., of finite magnitude).

math guide - 34.100

• Some common z-transforms are shown below. Table 1: Common z-transforms Signal x[ n]

z-Transform X(z)

ROC

δ[n]

1

All z

u[n]

1 --------------–1 1–z

z >1

nu [ n ]

z ---------------------–1 2 (1 – z )

–1

–1

2

n u[n ]

n

a u[n ]

z >1

–1

( 1 + z )z---------------------------–1 3 (1 – z )

z >1

1 -----------------–1 1 – az

z > a

–1

n

na u [ n ]

n

( – a )u [ – n – 1 ]

az -------------------------–1 2 ( 1 – az )

z > a

1 -----------------–1 1 – az

z < a

–1

( – na )u [ – n – 1 ]

az -------------------------–1 2 ( 1 – az )

cos ( ω 0 n ) u [ n ]

1 – z cos ω 0 -----------------------------------------------–1 –2 1 – 2z cos ω 0 + z

sin ( ω 0 n ) u [ n ]

z sin ω 0 -----------------------------------------------–1 –2 1 – 2z cos ω 0 + z

n

z < a

–1

z >1

–1

z >1

–1

n

a cos ( ω 0 n ) u [ n ]

1 – az cos ω 0 --------------------------------------------------------–1 2 –2 1 – 2az cos ω 0 + a z

z > a

math guide - 34.101

Table 1: Common z-transforms Signal x[ n]

z-Transform X(z)

a sin ( ω 0 n ) u [ n ]

az sin ω 0 --------------------------------------------------------–1 2 –2 1 – 2az cos ω 0 + a z

n! ---------------------u[n] k! ( n – k )!

z ----------------------------–1 k + 1 (1 – z )

ROC

–1

n

z > a

–k

z >1

• The z-transform also has various properties that are useful. The table below lists properties for the two-sided z-transform. The one-sided z-transform properties can be derived from the ones below by considering the signal x [ n ]u [ n ] instead of simply x [ n ] . Table 2: Two-sided z-Transform Properties Property Notation

Linearity

Time Domain

z-Domain

x[ n] x1 [ n ]

X(z) X1 ( z )

x2 [ n ]

X2 ( z )

αx 1 [ n ] + βx 2 [ n ]

αX 1 ( z ) + βX 2 ( z )

ROC r2 < z < r 1 ROC 1 ROC 2 At least the intersection of ROC 1 and ROC 2

Time Shifting

x[ n – k]

z-Domain Scaling

a x[ n]

X(a z)

Time Reversal

x [ –n ]

z-Domain Differentiation

nx [ n ]

n

–k

z X( z)

That of X ( z ) , except z = 0 if k > 0 and z = ∞ if k < 0

–1

a r2 < z < a r1

X(z )

–1

1 1 ---< z < ---r2 r1

dX ( z ) – z -------------dz

r2 < z < r 1

math guide - 34.102

Table 2: Two-sided z-Transform Properties Property Convolution

Time Domain x 1 [ n ]*x 2 [ n ]

z-Domain

ROC

X 1 ( z )X 2 ( z )

At least the intersection of ROC 1 and ROC 2

Multiplication

x 1 [ n ]x 2 [ n ]

1z –1 ------X 1 ( v )X 2  -- v dv ∫  v j2π°

Initial value theorem

x [ n ] causal

x [ 0 ] = lim X ( z )

At least r 1l r 2l < z < r 1u r 2u

z→∞

34.10 FOURIER SERIES • These series describe functions by their frequency spectrum content. For example a square wave can be approximated with a sum of a series of sine waves with varying magnitudes. • The basic definition of the Fourier series is given below.

a0 f ( x ) = ----- + 2





nπx nπx a n cos  --------- + b n sin  ---------  L   L 

n=1

1 L nπx a n = --- ∫ f ( x ) cos  --------- dx L –L L

1 L nπx b n = --- ∫ f ( x ) sin  --------- dx L –L L

34.11 TOPICS NOT COVERED (YET) • To ensure that the omissions are obvious, I provide a list of topics not covered below. Some of these may be added later if their need becomes obvious. • Frequency domain - Fourier, Bessel

math guide - 34.103

34.12 REFERENCES/BIBLIOGRAPHY Spiegel, M. R., Mathematical Handbook of Formulas and Tables, Schaum’s Outline Series, McGraw-Hill Book Company, 1968.

C programming - 35.1

35. A BASIC INTRODUCTION TO ‘C’

35.1 WHY USE ‘C’?

• ‘C’ is commonly used to produce operating systems and commercial software. Some examples of these are UNIX, Lotus-123, dBase, and some ‘C’ compilers.

• Machine Portable, which means that it requires only small changes to run on other computers.

• Very Fast, almost as fast as assembler.

• Emphasizes structured programming, by focusing on functions and subroutines.

• You may easily customize ’C’ to your own needs.

• Suited to Large and Complex Programs.

C programming - 35.2

• Very Flexible, allows you to create your own functions.

35.2 BACKGROUND

• Developed at Bell Laboratories in the Early 70’s, and commercial compilers became available in the Late 70’s.Recnetly has become more popular because of its ties to UNIX. Over 90% of UNIX is written in ‘C’. AT&T originally developed ‘C’ with the intention of making it an in-house standard.

35.3 PROGRAM PARTS

• /* is the start of a comment.

• */ is the end of comment.

• The main program is treated like a function, and thus it has the name main().

• lower/UPPER case is crucial, and can never be ignored.

C programming - 35.3

• Statements are separated by semi-colons ‘;’

• Statements consist of one operation, or a set of statements between curly brackets {, }

• There are no line numbers.

Program to Add two Numbers: /* A simple program to add two numbers and print the results */ main() { int x, y = 2, z; /* define three variables and give one a value */ x = 3; /* give another variable a value */ z = x + y; /* add the two variables */ printf(“%d + %d = %d\n”, x, y, z); /*print the results */ } Results (output):

• lines may be of any length.

• A very common function in ‘C’ is printf(). This function will do a formatted print. The format is the first thing which appears between the brackets. In this case the format says print an integer %d followed by a space then a ‘+’ then another space, another integer, another space, ‘=’, and another space, another integer, then a line feed ‘\n’. All variables that follow the format statement are those to be printed. x, y, and z are the three integers to be printed, in their respective orders.

C programming - 35.4

• Major Data Types for variables and functions are (for IBM PC): int (2 byte integer), short (1 byte integer), long (4 byte integer), char (1 byte integer), float (4 byte IEEE floating point standard), double (8 byte IEEE floating point standard).

•int, short, long, char can be modified by the addition of unsigned, and register. An unsigned integer will not use 1 bit for number sign. A register variable will use a data register in the microprocessor, if possible, and it will speed things up (this is only available for integers).

Example of Defining Different Data Types: main() { unsigned int i; register j; short k; char l; double m; etc

• A function consists of a sub-routine or program, which has been assigned a name. This function is capable of accepting an argument list, and returning a single value. The function must be defined before it is called from within the program. (e.g. sin() and read()).

C programming - 35.5

Program to add numbers with a function: /* A simple program to add two numbers and print the results */ int add(); /* Declare a integer function called ‘add’ */ main() { int x = 3, y = 2, z; /* define three variables and give values */ z = add(x, y); /* pass the two values to ‘add’ and get the sum*/ printf(“%d + %d = %d\n”, x, y, z); /*print the results */ } int add(a, b) /* define function and variable list */ int a, b; /* describe types of variable lists */ { int c; /* define a work integer */ c = a + b; /* add the numbers */ return(c); /* Return the number to the calling program */

• Every variable has a scope. This determines which functions are able to use that variable. If a variable is global, then it may be used by any function. These can be modified by the addition of static, extern and auto. If a variable is defined in a function, then it will be local to that function, and is not used by any other function. If the variable needs to be initialized every time the subroutine is called, this is an auto type. static variables can be used for a variable that must keep the value it had the last time the function was called. Using extern will allow the variable types from other parts of the program to be used in a function.

C programming - 35.6

Program example using global variables: /* A simple program to add two numbers and print the results */ int x = 3, /* Define global x and y values */ y = 2, add(); /* Declare an integer function called ‘add’ */ main() { printf(“%d + %d = %d\n”, x, y, add()); /*print the results */ } int add() /* define function */ { return(x + y); /* Return the sumto the calling program */

• Other variable types of variables are union, enum, struct, etc.

• Some basic control flow statements are while(), do-while(), for(), switch(), and if(). A couple of example programs are given below which demonstrate all the ’C’ flow statements.

Program example with a for loop: /* A simple program toprint numbers from 1 to 5*/ main() { int i; for(i = 1; i x){ printf(“Maximum is %d \n”, y); } else { printf(“Both values are %d \n”, x); } }

Example Program using switch-case: main() { int x = 3; /* Number of People in Family */ switch(x){ /* choose the numerical switch */ case 0: /* Nobody */ printf(“There is no family \n”); break; case 1: /* Only one person, but a start */ printf(“There is one parent\n”); break; case 2: /* You need two to start something */ printf(“There are two parents\n”); break; default: /* critical mass */ printf(“There are two parents and %d kids\n”, x-2); break; } }

C programming - 35.9

• #include will insert the file named filename.h into the program. The *.h extension is used to indicate a header file which contains ‘C’ code to define functions and constants. This almost always includes “stdio.h”. As we saw before, a function must be defined (as with the ‘add’ function). We did not define printf() before we used it, this is normally done by using #include at the top of your programs. “stdio.h” contains a line which says ‘int printf();’. If we needed to use a math function like y = sin(x) we would have to also use #include , or else the compiler would not know what type of value that sin() is supposed to return.

•#define CONSTANT TEXT will do a direct replacement of CONSTANT in the program with TEXT, before compilation. #undef CONSTANT will undefine the CONSTANT.

A Sample Program to Print Some sin() values (using defined constatnts) #include “stdio.h” #include “math.h” #define TWO_PI 6.283185307 #define STEPS 5 main() { double x; /* Current x value*/ for(x = 0.0; x