Lecture 1 - Introduction
description
Transcript of Lecture 1 - Introduction
![Page 1: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/1.jpg)
Lecture 1 - IntroductionLecture 1 - Introduction
June 3, 2002
CVEN 302
![Page 2: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/2.jpg)
Lecture’s GoalsLecture’s Goals
• General Introduction to CVEN 302 - Computer Applications in Engineering and Construction
• Introduction to Computer Lab• Why do you need to be able to write and
understand computer program and numerical methods?
• Matlab - Mathematical Laboratory
![Page 3: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/3.jpg)
CVEN 302 CVEN 302 Computer Applications in Computer Applications in
Engineering and ConstructionEngineering and Construction
Text: Applied Numerical Analysis
Using MatLab
Author: Laurene V. Fausett
Software: Matlab Version 6.0
![Page 4: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/4.jpg)
IntroductionIntroduction
Professor: Dr. E. Sandt
Office :207 CVEN Building
Phone: 458-4780
Office Hr: MWF 2:00 PM - 4:00 PM
Email: [email protected]
URL: http://stommel.tamu.edu/~esandt/
![Page 5: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/5.jpg)
Grade Breakdown
Homework 25 %
Exam 1 20 %
Exam 2 20 %
Final 35 %
![Page 6: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/6.jpg)
TopicsTopics
• Matlab - Mathematical Program (Vectors)
• Computer Errors - Recognition and solutions
• Roots f(x) = 0– Linear Methods– Nonlinear Methods
![Page 7: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/7.jpg)
TopicsTopics
• Linear Systems - Setting up multiple sets of equations and solution techniques.
• LU Decomposition - Technique to decompose matrices
• Eigen-analysis - finding the eigenvalues and eigenvectors
![Page 8: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/8.jpg)
TopicsTopics• Fitting Data
– Interpolation– Curve Fitting
• Numerical Differentiation
• Numerical Integration
![Page 9: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/9.jpg)
TopicsTopics
• ODE’s (ordinary differential equations)– Initial Value Problems– Systems of ODE’s of IVP– Boundary Value Problems– Systems of ODE’s of BVP
• Partial Differential Equations (PDE’s)
![Page 10: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/10.jpg)
Why do we need to know how to use Why do we need to know how to use numerical analysis and methods?numerical analysis and methods?
• Applications
• Numerical Errors
• Computer Types
• Computer Software
You are not going to be given a nice neat exact solution in the “real world”.
![Page 11: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/11.jpg)
ApplicationsApplications
• Signal Processing
• CFD (Computational Fluid Dynamics)
• Structural Analysis
• Finite Element Analysis
![Page 12: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/12.jpg)
ApplicationsApplications
• Interpolation - Handling data
• Optimization - Design and estimation
• CAD (Computer Aided-Drafting)
• Data Collection
![Page 13: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/13.jpg)
Numerical ErrorsNumerical Errors
Computers are only as good as theComputers are only as good as the
person running themperson running them.
![Page 14: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/14.jpg)
Numerical ErrorsNumerical Errors
• Precision Limits
• Stability
– Convergence
– Divergence
• Alaising
![Page 15: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/15.jpg)
Numerical ErrorsNumerical Errors
• Round-off Errors
• Truncation Errors - Code dependent
• Machine Precision
![Page 16: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/16.jpg)
Computer Hardware TypesComputer Hardware Types
Personal Computer
Supercomputers
Vector Processors
Array Processors
Parallel Processor
![Page 17: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/17.jpg)
SoftwareSoftware
Operating Systems (OS)
• Windows - NT, ME, Windows
• Unix
• VMS - VAX
• Linux
![Page 18: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/18.jpg)
SoftwareSoftwareLanguages
– Fundamental Assembler (Bit manipulations)– Engineering Languages
• Fortran• Cobol• Pascal• C++ ( J++ )• Basic
– HTML and Java
![Page 19: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/19.jpg)
SoftwareSoftwareHigher-Order Programming
– Maple - Mathematical Programming Language
– Mathematica - Mathematical Programming Language
– Java - Internet Programming Language
– Matlab - Matrix Laboratory
![Page 20: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/20.jpg)
SoftwareSoftware
Tools– Word Processors– Spreadsheets– Database Management– Graphics– Mathematical Computer Codes
![Page 21: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/21.jpg)
Matlab -Matrix LaboratoryMatlab -Matrix Laboratory
– 50 Licenses are available on the network with a wavelet tool box
– Student Version is available at the MSC ($120) without the tool boxes.
Currently Matlab 6.0 is available on CVEN Network
![Page 22: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/22.jpg)
MatLabMatLab
You will need to obtain an account on the CVEN Network. You can obtain an account in the CVEN Lab. It will take a couple of days to get it setup.
The Matlab program can be run using command line, batch commands, and programs.
![Page 23: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/23.jpg)
What is a program?What is a program?
Program consist of three main components:
• Input
• Main Program - Numerical methods and analysis and/or evaluation.
• Output - Results.
![Page 24: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/24.jpg)
InputsInputs
• Numerical values
• Initialization of the variables
• Conditions
• Equations
![Page 25: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/25.jpg)
Main ProgramMain Program
– Loops (for do while)– Conditions ( if then elseif etc.. )– Error Convergence (while )
Using flow charts, the programs can be designed to perform a task. Using:
![Page 26: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/26.jpg)
OutputOutput
– Numerical Values– Decisions– Graphs and Plots
Outputs are the results of the program. They can go through a series of post-processing methods.
![Page 27: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/27.jpg)
MatLabMatLab
Variable Types
– Integers
– Real Values (float and double)
– Complex Numbers (a + ib)• a - real value• b - imaginary value (“i” is the square root of -1)
![Page 28: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/28.jpg)
MatlabMatlab
Data types– Numerical
• Scalars• Vectors• Matrices
– Logic Types– Alpha/Numerical Types
![Page 29: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/29.jpg)
MatlabMatlab
• A scalar value is the simple number, a, 2, 3.14157…,
• A vector is a union of a
• Transpose vector
4321 ,,, xxxxx
4
3
2
1
T
x
x
x
x
x
![Page 30: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/30.jpg)
MatlabMatlab• Matrix is a combination of vectors and
scalars. Scalar and vectors are subsets of matrices.
• Matlab uses matrix to do mathematical methods.
333231
232221
131211
aaa
aaa
aaa
A
![Page 31: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/31.jpg)
MatlabMatlab
• Set of computer functions– Circular functions - sin(x),cos(x), tan(x),
asin(x), acos(x), atan(x)– Hyperbolic functions - sinh(x), cosh(x),
tanh(x)– Logarithmic functions - ln(x), log(x), exp(x)– Logic functions - abs(x), real(x), imag(x)
![Page 32: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/32.jpg)
MatlabMatlab
• Simple commands– clc - clears window– clg - clear graphic window– clear - clears the workspace– who - variable list– whos - variable list with size– help - when doubt use it!
![Page 33: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/33.jpg)
MatlabMatlab
• Simple commands and symbols – ^C - an escape from a loop– inf - infinity– NaN - No numerical value
![Page 34: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/34.jpg)
Matlab - Scalar OperationsMatlab - Scalar Operations
• Addition - a + b
• Subtraction - a - b
• Multiplication - a * b
• Right Division - a / b
• Left Division - b \ a
• Exponential - a^b
![Page 35: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/35.jpg)
Order of Precedence of Order of Precedence of Arithmetic OperationsArithmetic Operations
Precedence( 1 ) - Parenthesis
( 2 ) - Exponential from left to right
( 3 ) - Multiplication and division from left to right.
( 4 ) - Addition and subtraction from left to right.
![Page 36: Lecture 1 - Introduction](https://reader036.fdocuments.in/reader036/viewer/2022062309/56814f01550346895dbc9423/html5/thumbnails/36.jpg)
HomeworkHomework
• Obtain an account on CVEN Network
• Find the Website (http:\\stommel.tamu.edu\~esandt)
• Play with Matlab
• Email me and say Hi! I
will need your email address to create an class email list.