Lecture 5b: Starting Matlab
|
|
- Norah Rice
- 5 years ago
- Views:
Transcription
1 Lecture 5b: Starting Matlab James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University August 7, 2013
2 Outline 1 Resources 2 Starting Matlab 3 Homework # 16 Homework # 17 4 A Sample Matlab Session
3 Abstract This lecture is going to help you get started with Matlab ( see )
4 Resources In the text, Section 2.4 is the first discussion about how to use Matlab in the text.
5 Starting Matlab Create a directory for this class. On a CCIT Computer: On Your Laptop: Set up a directory on your public U drive called M111 or something you like better. or use a flash drive. Create a directory on your hard drive if you are on a laptop. or use a flash drive.
6 Starting Matlab Starting Matlab: On a CCIT Computer: With Student Edition: Go to a computer lab of your choice. Go to All Programs in Windows. Scroll down to choose CES Scroll to choose MatLab2011a or whatever Matlab shows up. CCIT installs newer versions from time to time so the version of Matlab you see here might be different. I ll just call this Matlab for convenience. Click on MatLab and it starts up. Once Matlab is installed, just start it up.
7 Starting Matlab You ll see something like this.
8 Starting Matlab Now that Matlab is up and running: Let s assume your choice of directory is neanderthal. Go to a directory which is for this class s programs and files. In MatLab typing pwd shows your current directory Changing directory: On a CCIT Computer: In Matlab, type % change to y o u r p u b l i c d i r e c t o r y cd U: \ % change to y o u r d i r e c t o r y f o r t h i s c l a s s. cd n e a n d e r t h a l On Your Laptop: Just cd to your directory wherever it is.
9 Let s start with Riemann sums in Matlab. As you have seen, doing these by hand is tedious. Let s look at how we might do them using MatLab. Here is a typical MatLab session to do this. Let s calculate the Riemann sum for the function f (x) = x 2 on the interval [1, 3] using the partition P = {1, 1.5, 2.1, 2.8, 3.0} and evaluation set E = {1.2, 1.7, 2.5, 2.9}. First, set up our function. MatLab allows us to define a function inside the MatLab environment as follows >> f x ) ( x. ˆ 2 ) ; This defines the function f (x) = x 2. If we had wanted to define g(x) = 2x 2 + 3, we would have used >> g x ) ( 2 x. ˆ 2 + 3) ;
10 In MatLab, variables with columns are what in mathematics are called vectors. Consider this example. We want the variable X to have 3 rows and 1 columns. To do that, we insert a ; between the numbers so each number starts a new row. Note there is no semicolon at the end of the line below so Matlab displays what X is after we type the command. % >> X = [ 1 ; 2 ; 3 ] X = Adding the ; turns off the display. >> X = [ 1 ; 2 ; 3 ] ;
11 Variables that are only one row and multiple columns are also possible. These are also vectors but oriented differently. Consider this example. We want the variable Y to have 1 rows and 4 columns. To do that, we insert a, between the numbers so each number starts a new column. We leave off the ; so that Y is displayed. % >> Y = [ 1, 2, 6, 8] Y = Adding the ; turns off the display. >> Y = [ 1, 2, 6, 8];
12 Now let Z be another column vector the same size as X. >> Z = [ 4 ; 2 ; 6 ] ; The MatLab notation X.*Z means to multiple component wise: 1 4 (1)(4) = (2)( 2) = (3)(6) 18 So in MatLab, we have >> X. Z ans =
13 To square X, we would write X.^2 to square each component creating a new vector with each entry squared. >> X. ˆ 2 ans = The way we set up the function f (x.^2); makes use of this. The variable X may or may not be a vector. So we write x.^2 so that if x is a vector, multiplication is done component wise and if not, it is just the squaring of a number. So for our function, to find f for all the values in X, we just type >> f (X) ans = 1 4 9
14 Now let s setup the partition with the command >> P = [ 1 ; 1. 5 ; 2. 1 ; 2. 8 ; 3. 0 ] P = The command diff in MatLab is applied to a vector to create the differences we have called the x i s. >> dx = d i f f (P) dx =
15 Next, we set up the evaluation set E. >> E = [ 1. 2 ; 1. 7 ; 2. 5 ; 2. 9 ] E = Find f (E); a new vector with the values f (s i ) s. Use f (E). dx to create the new vector with components f (s i ) x i. >> g = f ( E). dx g =
16 Finally, we add all these components together to get the Riemann sum. In MatLab, we add up the entries of a vector g with the command sum(g). >> RS = sum ( g ) RS = Without the comments, the MatLab session is not too long. >> f x ) ( x. ˆ 2 ) ; >> P = [ 1 ; 1. 5 ; 2. 1 ; 2. 8 ; 3. 0 ] ; >> dx = d i f f (P) ; >> E = [ 1. 2 ; 1. 7 ; 2. 5 ; 2. 9 ] ; >> g = f ( E). dx ; >> RS = sum ( g ) ;
17 Let s learn how to graph a function f. To graph f we need to set up a variable which tells us how many data points to use in the plot. This variable is different from our partition variable. The linspace command sets up a variable y to be a vector with 21 points in it. The first point is 1 and the last point is 3 and the interval [1, 3] is divided into 20 equal size pieces. So this command creates y values spaced.1 apart: {y 1 = 1, y 2 = 1.1, y 3 = 1.2,..., y 20 = 2.9, y 21 = 3.0}. We use the pairs (y i, f (y i )) to make a plot by connecting the dots determined by the pairs using lines. And here is the plot in Matlab >> y = l i n s p a c e ( 1, 3, 2 1 ) ; >> p l o t ( y, f ( y ) ) ;
18 We can add stuff to this bare bones plot. >> x l a b e l ( x a x i s ) ; >> y l a b e l ( y a x i s ) ; >> l e g e n d ( x ˆ 2, l o c a t i o n, best ) ; >> t i t l e ( P l o t o f f ( x ) = x ˆ2 on [ 1, 3 ] ) ; xlabel sets the name printed under the horizontal axis. ylabel sets the name printed next to the vertical axis. legend sets a blurb printed inside the graph explaining the plot. Great when you plot multiple things on the same graph. title sets the title of the graph.
19 The graph pops up in a separate window as you can see. Using the file menu, select save as and scroll through the choices to save the graph as a.png file a Portable Network Graphics file. You ll need to give the file a name. I chose graph1.png.
20 To graph a rectangle, we graph 4 lines. The MatLab command >> p l o t ( [ x1 x2 ] ], [ y1 y2 ] ) plots a line from the pair (x1, y1) to (x2, y2). To plot rectangle, do this. >> h o l d on % s e t a x i s so we can s e e r e c t a n g l e >> a x i s ( [ P( 1 ) 1 P( 2 )+1 0 f ( E ( 1 ) ) +1]) % p l o t top, LHS, RHS and bottom o f r e c t a n g l e >> p l o t ( [ P( 1 ) P( 2 ) ], [ f ( E ( 1 ) ) f ( E ( 1 ) ) ] ) ; >> p l o t ( [ P( 1 ) P( 1 ) ], [ 0 f ( E ( 1 ) ) ] ) ; >> p l o t ( [ P( 2 ) P( 2 ) ], [ 0 f ( E ( 1 ) ) ] ) ; >> p l o t ( [ P( 1 ) P( 2 ) ], [ 0 0 ] ) ; >> h o l d o f f
21 This generates the rectangle. To show the Riemann sum approximation as rectangles, we use a for loop in MatLab >> f o r i = 1 : 4.. do s t u f f f o r each c h o i c e o f i end
22 To put this all together, we have to force Matlab to plot repeatedly without erasing the previous plot. We use hold on and hold off to do this. We start with hold on and then all plots are kept until the hold off is used. We still think f is always positive so the bottom is 0 and the top is the f (E(I )) value. h o l d on % s e t h o l d to on f o r i = 1 : 4 % graph r e c t a n g l e s bottom = 0 ; top = f (E( i ) ) ; p l o t ( [ P( i ) P( i +1) ], [ f ( E ( i ) ) f ( E( i ) ) ] ) ; p l o t ( [ P( i ) P( i ) ], [ bottom top ] ) ; p l o t ( [ E( i ) E ( i ) ], [ bottom top ], r ) ; p l o t ( [ P( i +1) P( i +1) ], [ bottom top ] ) ; p l o t ( [ P( i ) P( i +1) ], [ 0 0 ] ) ; end h o l d o f f % s e t h o l d o f f
23 We don t know if f can be negative. So the rectangles might need to point down. We do that by setting the bottom and top of the rectangles using an if test. bottom = 0 ; top = f (E( i ) ) ; i f f (E( i ) ) < 0 top = 0 ; bottom = f ( E ( i ) ) ; end
24 All together, we have h o l d on % s e t h o l d to on [ s i z e P,m] = s i z e (P) ; f o r i = 1 : s i z e P 1 % graph a l l t h e r e c t a n g l e s bottom = 0 ; top = f ( E ( i ) ) ; i f f ( E ( i ) ) < 0 top = 0 ; bottom = f ( E ( i ) ) ; end p l o t ( [ P( i ) P( i +1) ], [ f (E( i ) ) f (E( i ) ) ] ) ; p l o t ( [ P( i ) P( i ) ], [ bottom top ] ) ; p l o t ( [ E ( i ) E ( i ) ], [ bottom top ], r ) ; p l o t ( [ P( i +1) P( i +1) ], [ bottom top ] ) ; p l o t ( [ P( i ) P( i +1) ], [ 0 0 ] ) ; end y = l i n s p a c e (P( 1 ),P( s i z e P ), 101) ; % o v e r l a y t h e f u n c t i o n graph p l o t ( y, f ( y ) ) ; x l a b e l ( x a x i s ) ; y l a b e l ( y a x i s ) ; t i t l e ( Riemann Sum o v e r l a y e d on the f u n c t i o n graph ) ; h o l d o f f ;
25 To save typing, let s learn to use a Matlab function. In Matlab s file menu, choose create a new Matlab function which gives f u n c t i o n [ v a l u e 1, v a l u e 2,... ] = MyFunction ( arg1, arg2,... ) % s t u f f i n h e r e end [value1, value2,...] are returned values the function calculates that we want to save. (arg1, arg2,...) are things the function needs to do the calculations. They are called the arguments to the function. MyFunction is the name of the function. This function must be stored in the file MyFunction.m.
26 Our function returns the Riemann sum, RS, and use the arguments: our function f, the partition P and the Evaluation set E. Since only one value returned [RS] can be RS. f u n c t i o n RS = RiemannSum ( f, P, E) % comments a l w a y b e g i n w i t h a % matlab l i n e s h e r e end The name for the function RiemannSum must be used as the file name: i.e. we must use RiemannSum.m as the file name.
27 Here is a complete Riemann sum graphing function! f u n c t i o n RS = RiemannSum ( f, P, E) % f i n d Riemann sum dx = d i f f (P) ; RS = sum ( f ( E ). dx ) ; [ s i z e P,m] = s i z e (P) ; %g e t s i z e o f P a r t i t i o n c l f ; % c l e a r t h e o l d graph h o l d on % s e t h o l d to on f o r i = 1 : s i z e (P) 1 % graph a l l t h e r e c t a n g l e s bottom = 0 ; top = f ( E ( i ) ) ; i f f ( E ( i ) ) < 0 top = 0 ; bottom = f ( E ( i ) ) ; end p l o t ( [ P( i ) P( i +1) ], [ f (E( i ) ) f (E( i ) ) ] ) ; p l o t ( [ P( i ) P( i ) ], [ bottom top ] ) ; p l o t ( [ E ( i ) E ( i ) ], [ bottom top ], r ) ; p l o t ( [ P( i +1) P( i +1) ], [ bottom top ] ) ; p l o t ( [ P( i ) P( i +1) ], [ 0 0 ] ) ; end y = l i n s p a c e (P( 1 ),P( s i z e P ), 101) ; % o v e r l a y t h e f u n c t i o n graph p l o t ( y, f ( y ) ) ; x l a b e l ( x a x i s ) ; y l a b e l ( y a x i s ) ; t i t l e ( Riemann Sum o v e r l a y e d on the f u n c t i o n graph ) ; h o l d o f f ; end
28 A typical use is then >> f x ) s i n ( 3 x ) ; >> P = [ 1 ; 1. 5 ; 2. 1 ; 2. 8 ; 3. 0 ] ; >> E = [ 1. 2 ; 1. 7 ; 2. 5 ; 2. 9 ] ; >> RS = RiemannSum ( f, P, E ) ; This generates a pop up figure which we can save to a file.
29
30 To see graphically how the Riemann sums converge to the Riemann integral, let s write a new function: Riemann sums using uniform partitions and midpoint evaluation sets. f u n c t i o n RS = RiemannUniformSum ( f, a, b, n ) % s e t up a u n i f o r m p a r t i t i o n w i t h n+1 p o i n t s d e l t a x = ( b a ) /n ; P = [ a : d e l t a x : b ] ; % makes a row v e c t o r f o r i =1:n s t a r t = a+( i 1) d e l t a x ; s t o p = a+i d e l t a x ; E( i ) = 0. 5 ( s t a r t+s t o p ) ; end % send i n transpose of P and E so we use column v e c t o r s % b e c a u s e o r i g i n a l RiemannSum f u n c t i o n u s e s columns RS = RiemannSum ( f, P, E ) ; end We can then generate a sequence of Riemann sums for different values of n.
31 A typical session: >> f x ) s i n ( 3 x ) ; >> RS = RiemannUniformSum ( f, 1,4,10) >> RS = RiemannUniformSum ( f, 1,4,20) >> RS = RiemannUniformSum ( f, 1,4,40) >> RS = RiemannUniformSum ( f, 1,4,80)
32 Riemann sum with a uniform partition P 10 of [ 1, 4] for n = 10. The function is sin(3x) and the Riemann sum is
33 Riemann sum with a uniform partition P 20 of [ 1, 4] for n = 20. The function is sin(3x) and the Riemann sum is
34 Riemann sum with a uniform partition P 40 of [ 1, 4] for n = 40. The function is sin(3x) and the Riemann sum is
35 Riemann sum with a uniform partition P 80 of [ 1, 4] for n = 80. The function is sin(3x) and the Riemann sum is The actual value is 4 quite close! 1 sin(3x)dx = The n = 80 case is
36 The experiment we just did should help you understand better what we mean by the Riemann Integral. What we have shown is lim S(f, P n, E n ) = n for the particular sequence of uniform partitions P n with the particular choice of the evaluation sets E n being the midpoints of each of the subintervals determined by the partition. Note the P n = 5/n in each case. Of course, the Riemann integral existing means we get this value no matter what sequence of partitions we choose with associated evaluation sets as long as the norm of the partitions goes to 0.
37 Homework # 16 HW #16 Directions: For the given function f, partition P and evaluation set E, do the following: use Matlab to find S(f, P, E) for the partition P and evaluation set E. 1 Create a new word document called HW16.doc; don t use docx please. 2 Do the document in single space. 3 Do matlab fragments in bold font. 4 The document starts with your name, MTHSC 111, Summer Session I, 2012, HW 16 and the date. Then 1 State Problem 1. insert into your doc the matlab commands you use to solve the problem. Do this in bold. before each line of matlab add explanatory comments so I can check to see you know what you re doing. 2 State Problem 2. same stuff
38 Homework # 16 Something like this: Jim Peterson MTHSC 111 Summer Session I, 2012 HW 16 May 26, 2012 Problem 1: Let f (t) = sin(5t) on the interval [1, 3] with P = {1, 1.5, 2.0, 2.5, 3.0} and E = {1.2, 1.8, 2.3, 2.8}. % add e x p l a n a t i o n h e r e >> f x ) s i n (5 x ) ; % add e x p l a n a t i o n h e r e >> P = [ 1 ; 1. 5 ; 2. 0 ; 2. 5 ; 3. 0 ] ; % add e x p l a n a t i o n h e r e >> E = [ 1. 2 ; 1. 8 ; 2. 3 ; 2. 8 ] ; % add e x p l a n a t i o n h e r e >> dx = d i f f (P) ; % add e x p l a n a t i o n h e r e >> g = f ( E ). dx ; % add e x p l a n a t i o n h e r e >> RS = sum ( g ) RS =
39 Homework # 16 Actual HW # 16 1 Let f (t) = t on the interval [1, 3] with P = {1, 1.5, 2.0, 2.5, 3.0} and E = {1.2, 1.8, 2.3, 2.8}. 2 Let f (t) = sin(4t) on the interval [ 2, 3] with P = { 2, 1.6,.1, } and E = { 1.8, 1.3,.5, 1.1, 1.7, 2.6}. 3 Let f (t) = 3t 2 2t 7 on the interval [1, 2] with P = {1, 1.2, 1.5, 1.8, 2.0} and E = {1.1, 1.3, 1.7, 1.9}
40 Homework # 17 HW # 17 Directions: For the given function f, interval [a, b] and choice of n, you ll calculate the corresponding uniform partition Riemann sum using the functions RiemannSum in file RiemannSum.m and RiemannUniformSum in file RiemannUniformSum.m. Create a new file in Matlab Type the code for RiemannSum into this file. Save this file as RiemannSum.m in your directory. Create a new file in Matlab Type the code for RiemannUniformSum into this file. Save this file as RiemannUniformSum.m in your directory. If you are using the CCIT networked Matlab, you have to get Matlab to recognize the new files. So do this: >> cd.. >> cd n e a n d e r t h a l % use y o u r d i r e c t o r y s name h e r e If you are using your own Matlab you don t have to do this.
41 Homework # 17 HW # 17 Directions Continued: 1 Create a new word document called HW17.doc in single space with matlab fragments in bold font. 2 The document starts with your name, MTHSC 111, Summer Session I, 2012, HW 17 and the date. Then 1 State Problem 1. insert into your doc the matlab to solve the problem in bold. before each line of matlab add explanatory comments. For each value of n, do a save as and save the figure with a filename like HW17[ ].png where [ ] is where you put the number of the graph. Something like HW17a.png, HW17b.png etc. Insert this picture into the doc resizing as needed to make it look good. Explain in the doc what the picture shows. 2 State Problem 2. same stuff
42 Homework # 17 Something like this: Jim Peterson MTHSC 111 Summer Session I, 2012 HW 17 May 26, 2012 Problem 1: Let f (t) = sin(5t) on the interval [1, 3] with n = 10, 20, 40 and 60. % add e x p l a n a t i o n h e r e >> f x ) s i n (5 x ) ; % add e x p l a n a t i o n h e r e >> RS = RiemannUniformSum ( f, 1, 3, 1 0 ) % add e x p l a n a t i o n h e r e and i n s e r t graph >> RS = RiemannUniformSum ( f, 1, 3, 2 0 ) % add e x p l a n a t i o n h e r e and i n s e r t graph >> RS = RiemannUniformSum ( f, 1, 3, 4 0 ) % add e x p l a n a t i o n h e r e and i n s e r t graph >> RS = RiemannUniformSum ( f, 1, 3, 6 0 ) % add e x p l a n a t i o n h e r e and i n s e r t graph Then compare the Riemann sum for n = 60 with the true value of the Riemann integral and comment on how they compare.
43 Homework # 17 Actual HW # 17 1 Let f (t) = t 2 2t + 3 on the interval [ 2, 3] with n = 8, 16, 32 and 48. Compare the Riemann sum you get for n = 48 with the true value of the Riemann integral and comment on how they compare. 2 Let f (t) = sin(2t) on the interval [ 1, 5] with n = 10, 40, 60 and 80. Compare the Riemann sum you get for n = 80 with the true value of the Riemann integral and comment on how they compare. 3 Let f (t) = t 2 + 8t + 5 on the interval [ 2, 3] with n = 4, 12, 30 and 50. Compare the Riemann sum you get for n = 50 with the true value of the Riemann integral and comment on how they compare.
44 A Sample Matlab Session Start Matlab
45 A Sample Matlab Session Simple Riemann sums
46 A Sample Matlab Session Uniform Riemann sum with n = 10.
47 A Sample Matlab Session Plot that pops up for n = 10.
48 A Sample Matlab Session Uniform Riemann sum with n = 30.
49 A Sample Matlab Session Plot that pops up for n = 10.
An Introduction to Matlab
An Introduction to Matlab James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University August 25, 2013 Outline Starting Matlab Matlab Vectors and Functions
More informationIntegration by Parts Logarithms and More Riemann Sums!
Integration by Parts Logarithms and More Riemann Sums! James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 16, 2013 Outline 1 IbyP with
More informationRiemann Integration. James K. Peterson. February 2, Department of Biological Sciences and Department of Mathematical Sciences Clemson University
Riemann Integration James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University February 2, 2017 Outline 1 Riemann Sums 2 Riemann Sums In MatLab 3 Graphing
More informationRiemann Integration. Outline. James K. Peterson. February 2, Riemann Sums. Riemann Sums In MatLab. Graphing Riemann Sums
Riemann Integration James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University February 2, 2017 Outline Riemann Sums Riemann Sums In MatLab Graphing
More informationRiemann Integration Theory
Riemann Integration Theory James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University February 3, 2017 Outline 1 Uniform Partition Riemann Sums 2 Refinements
More informationRiemann Sums. Outline. James K. Peterson. September 15, Riemann Sums. Riemann Sums In MatLab
Riemann Sums James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 15, 2013 Outline Riemann Sums Riemann Sums In MatLab Abstract This
More informationProject One: C Bump functions
Project One: C Bump functions James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 2, 2018 Outline 1 2 The Project Let s recall what the
More informationMATLAB BASICS. Instructor: Prof. Shahrouk Ahmadi. TA: Kartik Bulusu
MATLAB BASICS Instructor: Prof. Shahrouk Ahmadi 1. What are M-files TA: Kartik Bulusu M-files are files that contain a collection of MATLAB commands or are used to define new MATLAB functions. For the
More informationNewton s Cooling Model in Matlab and the Cooling Project!
Newton s Cooling Model in Matlab and the Cooling Project! James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University March 10, 2014 Outline Your Newton
More information() Chapter 8 November 9, / 1
Example 1: An easy area problem Find the area of the region in the xy-plane bounded above by the graph of f(x) = 2, below by the x-axis, on the left by the line x = 1 and on the right by the line x = 5.
More informationLab 2 Worksheet. Problems. Problem 1: Geometry and Linear Equations
Lab 2 Worksheet Problems Problem : Geometry and Linear Equations Linear algebra is, first and foremost, the study of systems of linear equations. You are going to encounter linear systems frequently in
More informationSolving systems of ODEs with Matlab
Solving systems of ODEs with Matlab James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 20, 2013 Outline 1 Systems of ODEs 2 Setting Up
More informationIntroduction to Computational Neuroscience
CSE2330 Introduction to Computational Neuroscience Basic computational tools and concepts Tutorial 1 Duration: two weeks 1.1 About this tutorial The objective of this tutorial is to introduce you to: the
More informationPredator - Prey Model Trajectories are periodic
Predator - Prey Model Trajectories are periodic James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 4, 2013 Outline 1 Showing The PP
More informationDerivatives and the Product Rule
Derivatives and the Product Rule James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University January 28, 2014 Outline 1 Differentiability 2 Simple Derivatives
More informationMAT 343 Laboratory 6 The SVD decomposition and Image Compression
MA 4 Laboratory 6 he SVD decomposition and Image Compression In this laboratory session we will learn how to Find the SVD decomposition of a matrix using MALAB Use the SVD to perform Image Compression
More informationPredator - Prey Model Trajectories are periodic
Predator - Prey Model Trajectories are periodic James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 4, 2013 Outline Showing The PP Trajectories
More informationMathematical Induction Again
Mathematical Induction Again James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University January 12, 2017 Outline Mathematical Induction Simple POMI Examples
More informationMathematical Induction Again
Mathematical Induction Again James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University January 2, 207 Outline Mathematical Induction 2 Simple POMI Examples
More informationSolving Linear Systems of ODEs with Matlab
Solving Linear Systems of ODEs with Matlab James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 27, 2013 Outline Linear Systems Numerically
More informationMatrices and Vectors
Matrices and Vectors James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 11, 2013 Outline 1 Matrices and Vectors 2 Vector Details 3 Matrix
More informationTaylor Polynomials. James K. Peterson. Department of Biological Sciences and Department of Mathematical Sciences Clemson University
James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 24, 2013 Outline 1 First Order Approximation s Second Order Approximations 2 Approximation
More informationFourier Series Code. James K. Peterson. April 9, Department of Biological Sciences and Department of Mathematical Sciences Clemson University
Fourier Series Code James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University April 9, 2018 Outline 1 We will need to approximate Fourier series expansions
More informationProject Two. James K. Peterson. March 26, Department of Biological Sciences and Department of Mathematical Sciences Clemson University
Project Two James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University March 26, 2019 Outline 1 Cooling Models 2 Estimating the Cooling Rate k 3 Typical
More informationProject Two. Outline. James K. Peterson. March 27, Cooling Models. Estimating the Cooling Rate k. Typical Cooling Project Matlab Session
Project Two James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University March 27, 2018 Outline Cooling Models Estimating the Cooling Rate k Typical Cooling
More informationNew Mexico Tech Hyd 510
Vectors vector - has magnitude and direction (e.g. velocity, specific discharge, hydraulic gradient) scalar - has magnitude only (e.g. porosity, specific yield, storage coefficient) unit vector - a unit
More informationHomework 1 Solutions
18-9 Signals and Systems Profs. Byron Yu and Pulkit Grover Fall 18 Homework 1 Solutions Part One 1. (8 points) Consider the DT signal given by the algorithm: x[] = 1 x[1] = x[n] = x[n 1] x[n ] (a) Plot
More informationCable Convergence. James K. Peterson. May 7, Department of Biological Sciences and Department of Mathematical Sciences Clemson University
Cable Convergence James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University May 7, 2018 Outline 1 Fourier Series Convergence Redux 2 Fourier Series
More informationIntroduction to Computer Tools and Uncertainties
Experiment 1 Introduction to Computer Tools and Uncertainties 1.1 Objectives To become familiar with the computer programs and utilities that will be used throughout the semester. To become familiar with
More informationLearning MATLAB by doing MATLAB
Learning MATLAB by doing MATLAB December 10, 2005 Just type in the following commands and watch the output. 1. Variables, Vectors, Matrices >a=7 a is interpreted as a scalar (or 1 1 matrix) >b=[1,2,3]
More informationLab #10 Atomic Radius Rubric o Missing 1 out of 4 o Missing 2 out of 4 o Missing 3 out of 4
Name: Date: Chemistry ~ Ms. Hart Class: Anions or Cations 4.7 Relationships Among Elements Lab #10 Background Information The periodic table is a wonderful source of information about all of the elements
More informationProject 2: Using linear systems for numerical solution of boundary value problems
LINEAR ALGEBRA, MATH 124 Instructor: Dr. T.I. Lakoba Project 2: Using linear systems for numerical solution of boundary value problems Goal Introduce one of the most important applications of Linear Algebra
More informationMachine Learning 9/2/2015. What is machine learning. Advertise a customer s favorite products. Search the web to find pictures of dogs
9//5 What is machine learning Machine Learning CISC 58 Dr Daniel Leeds Finding patterns in data Adapting program behavior Advertise a customer s favorite products Search the web to find pictures of dogs
More informationUniform Convergence Examples
Uniform Convergence Examples James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 13, 2017 Outline 1 Example Let (x n ) be the sequence
More informationUpper and Lower Bounds
James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University August 30, 2017 Outline 1 2 s 3 Basic Results 4 Homework Let S be a set of real numbers. We
More informationAMS 27L LAB #6 Winter 2009
AMS 27L LAB #6 Winter 2009 Symbolically Solving Differential Equations Objectives: 1. To learn about the MATLAB Symbolic Solver 2. To expand knowledge of solutions to Diff-EQs 1 Symbolically Solving Differential
More informationHow many states. Record high temperature
Record high temperature How many states Class Midpoint Label 94.5 99.5 94.5-99.5 0 97 99.5 104.5 99.5-104.5 2 102 102 104.5 109.5 104.5-109.5 8 107 107 109.5 114.5 109.5-114.5 18 112 112 114.5 119.5 114.5-119.5
More informationOctave. Tutorial. Daniel Lamprecht. March 26, Graz University of Technology. Slides based on previous work by Ingo Holzmann
Tutorial Graz University of Technology March 26, 2012 Slides based on previous work by Ingo Holzmann Introduction What is? GNU is a high-level interactive language for numerical computations mostly compatible
More informationDay 2 Notes: Riemann Sums In calculus, the result of f ( x)
AP Calculus Unit 6 Basic Integration & Applications Day 2 Notes: Riemann Sums In calculus, the result of f ( x) dx is a function that represents the anti-derivative of the function f(x). This is also sometimes
More informationMotion II. Goals and Introduction
Motion II Goals and Introduction As you have probably already seen in lecture or homework, and if you ve performed the experiment Motion I, it is important to develop a strong understanding of how to model
More informationEEE161 Applied Electromagnetics Laboratory 1
Dr. Milica Marković Applied Electromagnetics Laboratory page 1 EEE161 Applied Electromagnetics Laboratory 1 Instructor: Dr. Milica Marković Office: Riverside Hall 3028 Email: milica@csus.edu Web:http://gaia.ecs.csus.edu/
More informationA First Course on Kinetics and Reaction Engineering Example S5.1
Example S5.1 Problem Purpose This example illustrates the use of the MATLAB template file SolvBVDif.m to solve a second order boundary value ordinary differential equation. Problem Statement Solve the
More informationRiemann Integrals and the Fundamental Theorem of Calculus
Riemnn Integrls nd the Fundmentl Theorem of Clculus Jmes K. Peterson Deprtment of Biologicl Sciences nd Deprtment of Mthemticl Sciences Clemson University September 16, 2013 Outline Grphing Riemnn Sums
More informationEEL2216 Control Theory CT1: PID Controller Design
EEL6 Control Theory CT: PID Controller Design. Objectives (i) To design proportional-integral-derivative (PID) controller for closed loop control. (ii) To evaluate the performance of different controllers
More informationThe First Derivative and Second Derivative Test
The First Derivative and Second Derivative Test James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University April 9, 2018 Outline 1 Extremal Values 2
More informationThe First Derivative and Second Derivative Test
The First Derivative and Second Derivative Test James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 8, 2017 Outline Extremal Values The
More informationLecture 10: Powers of Matrices, Difference Equations
Lecture 10: Powers of Matrices, Difference Equations Difference Equations A difference equation, also sometimes called a recurrence equation is an equation that defines a sequence recursively, i.e. each
More informationHölder s and Minkowski s Inequality
Hölder s and Minkowski s Inequality James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 1, 218 Outline Conjugate Exponents Hölder s
More informationLinear Systems of ODE: Nullclines, Eigenvector lines and trajectories
Linear Systems of ODE: Nullclines, Eigenvector lines and trajectories James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 6, 203 Outline
More informationTemperature measurement
Luleå University of Technology Johan Carlson Last revision: July 22, 2009 Measurement Technology and Uncertainty Analysis - E7021E Lab 3 Temperature measurement Introduction In this lab you are given a
More informationLab 5: Nonlinear Systems
Lab 5: Nonlinear Systems Goals In this lab you will use the pplane6 program to study two nonlinear systems by direct numerical simulation. The first model, from population biology, displays interesting
More informationLab 1 Uniform Motion - Graphing and Analyzing Motion
Lab 1 Uniform Motion - Graphing and Analyzing Motion Objectives: < To observe the distance-time relation for motion at constant velocity. < To make a straight line fit to the distance-time data. < To interpret
More informationJanuary 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,
Introduction to MATLAB January 18, 2008 Steve Gu Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB, Part I: Basics MATLAB Environment Getting Help Variables Vectors, Matrices, and
More informationMath 1526 Excel Lab 2 Summer 2012
Math 1526 Excel Lab 2 Summer 2012 Riemann Sums, Trapezoidal Rule and Simpson's Rule: In this lab you will learn how to recover information from rate of change data. For instance, if you have data for marginal
More informationUniform Convergence Examples
Uniform Convergence Examples James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 13, 2017 Outline More Uniform Convergence Examples Example
More informationLinear Systems of ODE: Nullclines, Eigenvector lines and trajectories
Linear Systems of ODE: Nullclines, Eigenvector lines and trajectories James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 6, 2013 Outline
More informationLAB 2: Orthogonal Projections, the Four Fundamental Subspaces, QR Factorization, and Inconsistent Linear Systems
Math 550A MATLAB Assignment #2 1 Revised 8/14/10 LAB 2: Orthogonal Projections, the Four Fundamental Subspaces, QR Factorization, and Inconsistent Linear Systems In this lab you will use Matlab to study
More informationMAT 275 Laboratory 4 MATLAB solvers for First-Order IVP
MATLAB sessions: Laboratory 4 MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP In this laboratory session we will learn how to. Use MATLAB solvers for solving scalar IVP 2. Use MATLAB solvers for
More informationLab 2: Static Response, Cantilevered Beam
Contents 1 Lab 2: Static Response, Cantilevered Beam 3 1.1 Objectives.......................................... 3 1.2 Scalars, Vectors and Matrices (Allen Downey)...................... 3 1.2.1 Attribution.....................................
More informationChemical reaction networks and diffusion
FYTN05 Fall 2012 Computer Assignment 2 Chemical reaction networks and diffusion Supervisor: Erica Manesso (Office: K217, Phone: +46 46 22 29232, E-mail: erica.manesso@thep.lu.se) Deadline: October 23,
More informationMA 580; Numerical Analysis I
MA 580; Numerical Analysis I C. T. Kelley NC State University tim kelley@ncsu.edu Version of October 23, 2016 NCSU, Fall 2016 c C. T. Kelley, I. C. F. Ipsen, 2016 MA 580, Fall 2016 1 / 43 Contents 1 Introduction
More informationMAT137 - Term 2, Week 2
MAT137 - Term 2, Week 2 This lecture will assume you have watched all of the videos on the definition of the integral (but will remind you about some things). Today we re talking about: More on the definition
More informationLAB 1: MATLAB - Introduction to Programming. Objective:
LAB 1: MATLAB - Introduction to Programming Objective: The objective of this laboratory is to review how to use MATLAB as a programming tool and to review a classic analytical solution to a steady-state
More informationCE 365K Exercise 1: GIS Basemap for Design Project Spring 2014 Hydraulic Engineering Design
CE 365K Exercise 1: GIS Basemap for Design Project Spring 2014 Hydraulic Engineering Design The purpose of this exercise is for you to construct a basemap in ArcGIS for your design project. You may execute
More informationThe Existence of the Riemann Integral
The Existence of the Riemann Integral James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University September 18, 2018 Outline The Darboux Integral Upper
More information2D Plotting with Matlab
GEEN 1300 Introduction to Engineering Computing Class Meeting #22 Monday, Nov. 9 th Engineering Computing and Problem Solving with Matlab 2-D plotting with Matlab Script files User-defined functions Matlab
More informationRunge - Kutta Methods for first and second order models
Runge - Kutta Methods for first and second order models James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 3, 2013 Outline 1 Runge -
More informationThe Quantizing functions
The Quantizing functions What is quantizing? Quantizing in its fundamental form is a function that automatically moves recorded notes, positioning them on exact note values: For example, if you record
More informationMath 151a week 1 discussion notes
Math 151a week 1 discussion notes Jean-Michel Maldague January 1, 017 Logistics I am your TA! My name is Jean-Michel Maldague. Welcome to numerical analysis. OH: Tuesdays 11-1, Thursdays 1-1, and by appointment,
More informationLaboratory handout 1 Mathematical preliminaries
laboratory handouts, me 340 2 Laboratory handout 1 Mathematical preliminaries In this handout, an expression on the left of the symbol := is defined in terms of the expression on the right. In contrast,
More informationMathematica Project 3
Mathematica Project 3 Name: Section: Date: On your class s Sakai site, your instructor has placed 5 Mathematica notebooks. Please use the following table to determine which file you should select based
More informationMathematical Induction
Mathematical Induction James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University January 12, 2017 Outline Introduction to the Class Mathematical Induction
More informationUsing Matlab for Laboratory Data Reduction
Data Collected Using Matlab for Laboratory Data Reduction Munson, Young, and Okiishi [1] provide laboratory data for the measurement of the viscosity of water with a capillary tube viscometer. The viscometer
More informationMath 515 Fall, 2008 Homework 2, due Friday, September 26.
Math 515 Fall, 2008 Homework 2, due Friday, September 26 In this assignment you will write efficient MATLAB codes to solve least squares problems involving block structured matrices known as Kronecker
More informationPHYSICS 3266 SPRING 2016
PHYSICS 3266 SPRIG 2016 Each problem is worth 5 points as discussed in the syllabus. For full credit you must include in your solution a copy of your program (well commented and listed any students that
More informationMath 414 Lecture 1. Reading assignment: Text: Pages 1-29 and Scilab Users Guide: Sections 1-3.
Math 414 Lecture 1 Homework assignments are always due at the beginning of the next lecture. Operations Research studies linear programming and associated algorithms. Businesses use it to find resource
More informationIntroduction to ArcMap
Introduction to ArcMap ArcMap ArcMap is a Map-centric GUI tool used to perform map-based tasks Mapping Create maps by working geographically and interactively Display and present Export or print Publish
More informationExperiment 1: The Same or Not The Same?
Experiment 1: The Same or Not The Same? Learning Goals After you finish this lab, you will be able to: 1. Use Logger Pro to collect data and calculate statistics (mean and standard deviation). 2. Explain
More informationRead through A Graphing Checklist for Physics Graduate Students before submitting any plots in this module. See the course website for the link.
Module C2: MatLab The Physics and Astronomy Department has several copies of MATLAB installed on computers that can be accessed by students. MATLAB is a highly developed software package that allows the
More informationLab 6: Linear Algebra
6.1 Introduction Lab 6: Linear Algebra This lab is aimed at demonstrating Python s ability to solve linear algebra problems. At the end of the assignment, you should be able to write code that sets up
More informationConsequences of Continuity
Consequences of Continuity James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 4, 2017 Outline 1 Domains of Continuous Functions 2 The
More informationBUILDING BASICS WITH HYPERCHEM LITE
BUILDING BASICS WITH HYPERCHEM LITE LAB MOD1.COMP From Gannon University SIM INTRODUCTION A chemical bond is a link between atoms resulting from the mutual attraction of their nuclei for electrons. There
More informationHölder s and Minkowski s Inequality
Hölder s and Minkowski s Inequality James K. Peterson Deartment of Biological Sciences and Deartment of Mathematical Sciences Clemson University Setember 10, 2018 Outline 1 Conjugate Exonents 2 Hölder
More informationWhy This Class? James K. Peterson. August 22, Department of Biological Sciences and Department of Mathematical Sciences Clemson University
Why This Class? James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University August 22, 2013 Outline 1 Our Point of View Mathematics, Science and Computer
More informationMath 231E, Lecture 13. Area & Riemann Sums
Math 23E, Lecture 3. Area & Riemann Sums Motivation for Integrals Question. What is an integral, and why do we care? Answer. A tool to compute a complicated expression made up of smaller pieces. Example.
More informationAssignment 1b: due Tues Nov 3rd at 11:59pm
n Today s Lecture: n n Vectorized computation Introduction to graphics n Announcements:. n Assignment 1b: due Tues Nov 3rd at 11:59pm 1 Monte Carlo Approximation of π Throw N darts L L/2 Sq. area = N =
More informationMatlab Section. November 8, 2005
Matlab Section November 8, 2005 1 1 General commands Clear all variables from memory : clear all Close all figure windows : close all Save a variable in.mat format : save filename name of variable Load
More informationPredator - Prey Model Trajectories and the nonlinear conservation law
Predator - Prey Model Trajectories and the nonlinear conservation law James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 28, 2013 Outline
More information18.06 Problem Set 1 - Solutions Due Wednesday, 12 September 2007 at 4 pm in
18.6 Problem Set 1 - Solutions Due Wednesday, 12 September 27 at 4 pm in 2-16. Problem : from the book.(5=1+1+1+1+1) (a) problem set 1.2, problem 8. (a) F. A Counterexample: u = (1,, ), v = (, 1, ) and
More informationSCIENTIFIC COMPUTING 7P-100-SCI
Engineering cycle, 2nd year 1 SCIENTIFIC COMPUTING 7P-100-SCI Lesson 1: General introduction and reminder on Matlab Hervé Sauer, Charles Bourassin-Bouchet, Mondher Besbes Ludivine Emeric, Léo Wojszvzyk
More informationPart III: A Simplex pivot
MA 3280 Lecture 31 - More on The Simplex Method Friday, April 25, 2014. Objectives: Analyze Simplex examples. We were working on the Simplex tableau The matrix form of this system of equations is called
More informationGetting Started With The Predator - Prey Model: Nullclines
Getting Started With The Predator - Prey Model: Nullclines James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University October 28, 2013 Outline The Predator
More informationUsing Microsoft Excel
Using Microsoft Excel Objective: Students will gain familiarity with using Excel to record data, display data properly, use built-in formulae to do calculations, and plot and fit data with linear functions.
More informationECE382/ME482 Spring 2005 Homework 1 Solution February 10,
ECE382/ME482 Spring 25 Homework 1 Solution February 1, 25 1 Solution to HW1 P2.33 For the system shown in Figure P2.33 on p. 119 of the text, find T(s) = Y 2 (s)/r 1 (s). Determine a relationship that
More informationCalculus at Rutgers. Course descriptions
Calculus at Rutgers This edition of Jon Rogawski s text, Calculus Early Transcendentals, is intended for students to use in the three-semester calculus sequence Math 151/152/251 beginning with Math 151
More informationSometimes the domains X and Z will be the same, so this might be written:
II. MULTIVARIATE CALCULUS The first lecture covered functions where a single input goes in, and a single output comes out. Most economic applications aren t so simple. In most cases, a number of variables
More informationMA 137 Calculus 1 with Life Science Applications. (Section 6.1)
MA 137 Calculus 1 with Life Science Applications (Section 6.1) Alberto Corso alberto.corso@uky.edu Department of Mathematics University of Kentucky December 2, 2015 1/17 Sigma (Σ) Notation In approximating
More informationDeveloping a Scientific Theory
Name Date Developing a Scientific Theory Equipment Needed Qty Equipment Needed Qty Photogate/Pulley System (ME-6838) 1 String (SE-8050) 1 Mass and Hanger Set (ME-8967) 1 Universal Table Clamp (ME-9376B)
More informationPhysics 241 Class #10 Outline (9/25/2013) Plotting Handle graphics Numerical derivatives and functions Next time numerical integrals
Physics 241 Class #10 Outline (9/25/2013) Plotting Handle graphics Numerical derivatives and functions Next time numerical integrals Announcements HW4 grades are up. HW5a HW5 revised Same problems, now
More informationLab #8: The Unbalanced Wheel
Lab #8: The Unbalanced Wheel OBJECTIVE Use observations to calculate the radius of gyration of a wheel. Apply energy models to the dynamics of an unbalanced rotating wheel. Learn new computing skills.
More information