University of Alberta 2016

Size: px
Start display at page:

Download "University of Alberta 2016"

Transcription

1 University of Alberta 2016 Equation Solving and Newton s Method Railroad track problem English Units Version: Somewhere in Alberta, there is a one mile stretch of rail with fixed ends over a flat bed. Someone welds in 1 foot of additional rail and the rail buckles upward into a circular arc. How high above the original bed is the lengthened rail? Metric Version: Somewhere in Alberta, there is a one kilometer stretch of rail over a (nearly) flat bed. Someone welds in 1 meter of additional rail and the rail buckles upward into a circular arc with its ends in their original positions. How high above the original bed is the lengthened rail? In[1]:= a = 2640; ϵ = 1 / 2 / a {6 ϵ // N, 6 ϵ / (1 + ϵ) // N} R = Sqrt (1 + ϵ)^3 6 ϵ // N X = Sqrt[R^2-1] // N d = a (R - X) Out[2]= Out[3]= { , } Out[4]= Out[5]= Out[6]= Introduction to equation solving for one equation One of the most important problems in mathematics and applied mathematics is solving (systems of) equations, which might be linear equations, nonlinear equations, differential equations, and so on. The simplest case should be familiar: solving a single equation such as a x=b or x^2+b x+c=0, where a, b, and c are supposed to represent given real numbers and the problem is to solve for the variable x. In elementary mathematics, we learn how to solve some of these equations. Indeed many problems reduce to solving the two types just mentioned---a single linear equation or a single quadratic equation. At least, these are the most common algebraic equations that are solvable by hand. As you might know, cubic and quartic polynomial equatipons can be solved by formulas discovered during the Italian renaissance (circa 1530). But, mathematicians have proved that there is no formula for finding roots of quintic polynomials or polynomials of higher degree.

2 2 UAlberta.nb By now you would have been introduced to transcendental functions (trig functions, exponential functions, logarithms, and perhaps some special functions). Most equations that involve such functions are not solvable with pencil and paper. For example, there are no formulas for solving equations such as tan(x)=2 x, exp(x)=x+2, or log(x)= a x+1. Thus, even for one equation in one real unknown, the best we can do is to approximate solutions. Let s have some fun and see what Mathematica can do when asked to solve equations. As in several modern computer algebra systems, Mathematica can solve all the equations for which formulas exist. Let s try ax=b. [To run the next cell click on the innermost square bracket along the right-hand side of the page and then press shift+return] In[7]:= Solve[a x b, x] Out[7]= x b 2640 No surprise here. Mathematica returns the correct answer. But, note that it does not tell us that there is no solution when a=0. It seems that there is still room for some education in mathematics. How about quadratics? In[8]:= Solve[a x^2 + b x + c 0, x] Out[8]= x -b - b c 5280, x -b + b c 5280 Not bad. Clearly, Mathematica knows the quadratic formula. Cubics? Let s try a special type of cubic: In[9]:= Solve[a x^3 + b x + c 0, x] Out[9]= x b 55 1/3-990 c + 55 b c 2 1/ c + 55 b c 2 1/3 55 2/3, x 1 + i 3 b /3-990 c + 55 b c 2 1/3-1 - i c + 55 b c 2 1/ /3, 1 - i 3 b x /3-990 c b c 2 1/3 1 + i c + 55 b c 2 1/ /3 The formulas are complicated, especially by the appearance of the complex number i. As mentioned

3 UAlberta.nb 3 The formulas are complicated, especially by the appearance of the complex number i. As mentioned before, cubics and quartics are solvable by formulas---usually called Cardano s formula; quintics are not: In[10]:= Solve[a x^5 + b x + c 0, x] Out[10]= x Root c + b # #1 5 &, 1, x Root c + b # #1 5 &, 2, x Root c + b # #1 5 &, 3, x Root c + b # #1 5 &, 4, x Root c + b # #1 5 &, 5 Mathematica says the roots are the roots! Even when formulas for roots exist (which is a wonderful theoretical fact), these formulas are not always practical for determining the nature of the roots. For example, Cardano s formula for solving cubics does not always give the real root in a form where it is easy to tell if it is positive or negative, greater than 7, and so on. Of course, computations with complicated formulas is practical on a computer at least when the computation is only needed once. When the computation must be done many times, the time it takes the computer to finish can become a major consideration. Putting these issues aside for the moment, the exact roots returned from Cardano s formula are evaluated numerically in the next code block. There is one real and two complex roots. Note that the computer must extract square and cube roots to obtain numerical values. How does the computer accomplish this task? [The Mathematica command Q//N asks the computer to evaluate the quantity Q on the left to a numerical value] In[11]:= ans = Solve[ x^3 - x + 1 0, x] ans // N Out[11]= x / /3 2 -, 3 2/3 x 1 + i / i /3 2 2/ /3, x 1 - i / i /3 2 2/ /3 Out[12]= {{x }, {x i}, {x i}} To extract a real cube root of some real number a, the problem is to find the real root of the cubic equation x^3=a. For definiteness, let s take the number 88. What is its cube root? The answer is obviously some number between 4 and 5. One way to do this is to draw a graph to see where the root resides. This could be done roughly by hand with pencil and paper and some graph paper. Of course, Mathematica can make a beautiful graph:

4 4 UAlberta.nb In[13]:= Plot[x^3-88, {x, 4, 5}, Frame True] Out[13]= By cubing numbers when no computer is available, or by graphing over a smaller interval, the search can continue. One way to proceed is to check the number halfway between 4 and 5 to see if the value of the function f(x)=x^3-88 is positive or negative. In fact, f(4.5)>0. Using this fact, the root must be between 4 and 4.5; or in other words, the root must lie in the interval (4,4.5). The process can be repeated to better approximate the root. We could take the current approximation of the root to be 4.5. The next approximation is obtained by taking the number halfway between 4 and 4.5 (which is(4+4.5)/2=4.25) and proceeding in the obvious way. The next approximation is So far, the sequence of computed approximations are 4.5, 4.25, and What is the next approximation? It is not too difficult to write a computer program to continue what is called the bisection method for approximating the root of an equation. This algorithm is guaranteed to converge to a root---maybe not the desired root; and at each step, the error of the approximation is no larger than half of the length of the interval where the root resides. This algorithm is viable; but the method is slow to converge. You can play with this process by hand as in the next few Mathematica cells or you could try to write a program to do the computations for you. In[14]:= ( ) / 2 Out[14]= 4.25 In[15]:= (4.25)^3-88 Out[15]= In[16]:= ( ) / 2 Out[16]= In[17]:= 88^(1 / 3) // N Out[17]= In[18]:= 4.375^3-88 Out[18]=

5 UAlberta.nb 5 In[19]:= ( ) / 2 Out[19]= Is there a faster algorithm to compute this root? As you might expect there are many possible ways to proceed. The most famous (and usually the best) method is one that you might have learned when studying first semester calculus: Newton s method. Newton s idea for inventing this algorithm was probably from a geometric interpretation. But, a simple way to derive the basic formula is to consider a Taylor approximation (which Newton surely understood before Taylor s or Maclaurin s name was attached). In any case, suppose we desire to find a zero of the function f; that is, we wish to solve the equation f(x)=0. Let us suppose a zero x=a exists so that f(a)=0. For some x near a, Taylor s formula is f(a)=f(x)+f (x) (a-x)+f (ξ) (a-x)^2, where ξ is some number between x and a. Assume x is so close to a that the term f (ξ) (x-a)^2 can be neglected in the equation. This gives the approximation f(a)=f(x)+ f (x)(a-x). Because f(a)=0 by assumption, solving for a gives an approximation of a with respect to the point x: a=x-f(x)/f (x). In other words, Newtons approximation of the desired and unknown root a is x-f(x)/f (x). Clearly the process can be repeated. Starting from some approximation x 0, the (n+1)th iterate is x n+1 = x n - f(x n )/f (x n ). How does this work in practice? To test out a new method, a good idea is to choose a problem where the answer is known. Let s approximate the cube root of 125. For the function f(x)=x^3-125, and starting value x 0 =4, the iterates are obtained easily in Mathematica using the function F(x):=x+f(x)/f (x): [Mathematica functions use square brackets f[x], not f(x) and the defintion of a function requires specifying the variable by the underscore mark. In the next formula the variable is x and it is designated by x_. The second command used to define the function F uses f [x] on the right hand side. Mathematica understands f to mean the derivative of the function f already defined. In particular, Mathematica knows how to compute derivatives.] In[20]:= f[x_] := x^3-125; F[x_] := x - f[x] f'[x]; In[22]:= {F[4], F[F[4]], F[F[F[4]]]} // N Out[22]= { , , } We are not taking advantage of the computer yet. Too much handwork. Computers are really good at iteration! One way to take advantage of this fact is embodied in the next code block, which uses a doloop. [Do-loops are not always the best way to program interations in Mathematica, but they are easy to understand. An empty list is defined by iterates={}. Every time a new iterate is computed it is appended as a new entry in the existing list. Simply typing the name of the variable, in this case iterates, causes

6 6 UAlberta.nb as a new entry in the existing list. Simply typing the name of the variable, in this case iterates, causes Mathematica to print out the list.] In[23]:= f[x_] := x^3-125; F[x_] := x - f[x] f'[x]; x = 4; iterates = {}; Do[{y = F[x], AppendTo[iterates, y // N], x = y}, {n, 1, 4}] iterates Out[28]= { , , , 5.} Note that Newton s method converges very rapidly to the exact solution. For the original problem, the same code can be used to approximate the cube root of 88: In[29]:= f[x_] := x^3-88; F[x_] := x - f[x] f'[x]; x = 4; iterates = {}; Do[{y = F[x], AppendTo[iterates, y // N], x = y}, {n, 1, 4}] iterates Out[34]= {4.5, , , } Compare the convergence rate to the bisection method. Do you see the difference: Newton s method is much faster. After just two iterates the approximation is correct to 2 decimal points and after three iterates it is correct to 5 decimal points. Newton s method is applicable whenever f is a differentiable function such that the derivative of f does not vanish at the desired root. Of course, it works for transcendental equations as well. For example, to approximate a solution of the equation tan(x)= 2 x, we proceed as follows: In[35]:= f[x_] := Tan[x] - 2 x; F[x_] := x - f[x] f'[x]; x = 0.2; iterates = {x}; Do[{y = F[x], AppendTo[iterates, y // N], x = y}, {n, 1, 5}] iterates Out[40]= 0.2, , , , 0., 0. The iterations are converging to 0, which is indeed a zero of the function f. How about finding x such that of tan(x)=x? From trigonometry x=0 is again a solution. In[41]:= f[x_] := Tan[x] - x; F[x_] := x - f[x] f'[x]; x = 0.2; iterates = {x}; Do[{y = F[x], AppendTo[iterates, y // N], x = y}, {n, 1, 5}] iterates Out[46]= {0.2, , , , , } The iterates seem to be converging to zero, as they should, but the convergence is slow. What is wrong with applying Newton s method in this case? A perhaps more interesting problem is to find the zero of f that lies between 0 and π/2. The problem is

7 UAlberta.nb 7 A perhaps more interesting problem is to find the zero of f that lies between 0 and π/2. The problem is to start close enough to this root. In[47]:= f[x_] := Tan[x] - 2 x; F[x_] := x - f[x] f'[x]; x = 1.5; iterates = {x}; Do[{y = F[x], AppendTo[iterates, y // N], x = y}, {n, 1, 7}] iterates Out[52]= {1.5, , , , , , , } We can check the values of f on the computed iterates to see that they are indeed converging to zero. In[53]:= residuals = Table[f[iterates[[i]]], {i, 1, 7}] Out[53]= { , , , , , , } We can also make a plot to see the convergence of the iterates. In[54]:= ListPlot[iterates] Out[54]= The residuals are plotted next using a few fancy additional commands. In[55]:= ListPlot[residuals, Frame True, PlotRange {{0, 8}, {-1, 12}}, PlotStyle {Red}] Out[55]= Approximate the solution of the equation cos x=x that lies in the interval [0,π/2]. Are you convinced that Newton s method is useful?

8 8 UAlberta.nb Are you convinced that Newton s method is useful? The fast convergence of Newton s method can be explained using calculus without too much difficulty. This is done in the course notes that accompany this Notebook. Equation solving for more than one equation Many real world applications involve solving a system of equations for more than one unknown. This subject is often called solving simultaneous equations. The most important special case is solving simultaneous linear equations, for example, the system of three equations in three unknowns x+y+z=1 2 x+y+z=2 x+2y+z=3 Mathematica can solve this system exactly. In[56]:= Clear[x, y, z] Solve[{x + y + z 1, 2 x + y + z == 2, x + 2 y + z == 3}, {x, y, z}] Out[57]= {{x 1, y 2, z -2}} Can you solve the system by hand? As you might know, there is a beautiful and useful algorithm for solving a system of linear equations called Gaussian elimination. Its analysis, usefulness, and limitations is one of the main problems that leads to a vast and important subject called numerical linear algebra. This subject will be considered later in your education. This section is about solving nonlinear systems of equations. But, as we will see, sometimes solving linear systems is part of the algorithm for solving nonlinear systems. We will avoid too much complication by solving only a few equations in a few unknowns and using black box linear solvers Via satellite (for example) elevations are mapped over a region of the earth s surface and a function is fit to this data to produce an approximation to the three-dimensional terrain. (How do you suppose the fitting is done?) The result is the function given in the next cell, where a=0.01 and b=0.01. A 3D plot of the function is also provided.

9 UAlberta.nb 9 In[58]:= F[x_, y_, a_, b_] := (a x)^3-3 a x b^2 y^2-0.1 a^4 x^4 + b^4 y^ Plot3D[F[x, y, 0.01, 0.01], {x, -1000, 1000}, {y, -1000, 1000}] Out[59]= The next cell is commented out using (* and *), a useful way to insert comments in active cells. The commands were used to export the 3-d figure for inclusion as an encapsulated postscript file in the course notes. You don t need to worry about understanding this procedure until you want to write your own documents! In[60]:= (* SetDirectory["~/Box Sync/Alberta2016"] Export["mountainterrain.eps",Out[6]]*) Let s continue work on the applied problem concerning the mapped terrain. An observer resides at the point on the terrain with coordinates (-550, 10, ), where all distances are measured in meters. The first coordinate measures the east-west direction with the positive direction pointing east. Likewise, the second coordinate measures north-south with the positive direction pointing north. Here are some problems: (1) Determine the curve of points that are 700 meters away via laser shots in three dimensions from this observation point and lie farther north. A much harder problem is to determine the curve of points that is 700 meters away when distance is measured along the terrain. This would make a nice future project. (2) Is there a point on the terrain equidistant via laser shots from the first observation point, the second observation point (-900, 990, ), and third observation point (-300, 250, )? If so, give the coordinates of such a point. (3) How many solutions of (2) exist within the mapped terrain? (4) What happens for (2) in case the third observation point is (1000, 0, 1501)? (5) What is the distance from observation point 1 to observation point 2 along the terrain? Questions (1), (3), (4) and (5) are left as exercises. Exercise (5) requires some new ideas that are not presented in this Notebook. The second question boils down to solving a system of two equations. They state the equality of distances from the observation points to the desired location with unknown coordinates (x,y,z). Well almost. In such problems the distance involves a square root. Usually the best idea is to measure the

10 10 UAlberta.nb almost. In such problems the distance involves a square root. Usually the best idea is to measure the square of the distance to avoid computing the square root. In this problem there are three unknown x, y, and z. But, the desired point is on the terrain. So, only two equations are needed: the difference of the distances from the unknown point to observation points 1 and 2 set to zero and likewise for observation points 1 and 3. To use Newton s method, the left-hand sides of the two equations are defined as functions g and h so that the problem is converted to finding a zero of the function (x,y)->(g(x,y),h(x,y)). The functions g and h are defined in the next cell. In[61]:= g[x_, y_] := (x + 550)^2 + (y - 10)^2 + (F[x, y, 0.01, 0.01] )^2 - (x + 900)^2 + (y - 990)^2 + (F[x, y, 0.01, 0.01] )^2 h[x_, y_] := (x + 550)^2 + (y - 10)^2 + (F[x, y, 0.01, 0.01] )^2 - (x + 300)^2 + (y - 250)^2 + (F[x, y, 0.01, 0.01] - F[-300, 250, 0.01, 0.01])^2 We have not yet discussed how to apply Newton s method when there is more than one equation. To do this requires the notion of a partial derivative. You should have already learned to use partial derivatives in your calculus class, but if not, don t worry. The idea is very simple: Consider a function f that depends on the two variables x and y. Its partial derivative with respect to x is simply the derivative of the function x->f(x,y) with y held fixed. Likewise the partial derivative of f with respect to y is the derivative of the function y -> f(x,y) with x held fixed. One notation for the partial derivative is to use subscripts corresponding to the name of the variable with respect to which the derivative is taken. So, f x denotes the partial derivative of the function f with respect to x and f y its partial derivative with respect to y. The values of these functions at some point (x,y) are of course denoted by f x (x,y) and f y (x,y), respectively. For example, let f(x,y)=x^2+ 2 y^3. For this function f x (x,y)=2 x and f y (x,y)=6 y. Can you imagine how to define partial derivatives for a function of three or more variables? What is f w (2,1,-1,1) in case f(x,y,z,w)=x y+e^z -zw+w^2? Newton s method in several variables applies when we seek a simultaneous zero for n functions of n variables. In the case at hand we have two functions of two variables. Just like for one variable functions where f(a)=f(x)+f (x) (a-x) gives the linear approximation for f(a), for functions of two variables the linear approximation (of g(a,b) with respect to a nearby point (x,y) is g (a, b) = g (x, y) + g x (x, y) (a - x) + g y (x,y)(b-y) and likewise for h we have h (a, b) = h (x, y) + h x (x, y) (a - x) + h y (x,y)(b-y). As before, suppose that the desired simultaneous zero is (a,b) so that g(a,b)=0 and h(a,b)=0. Then Newton s approximation for this unknown point with respect to some nearby point (x,y) is obtained by solving the two equations g (x, y) + g x (x, y) (a - x) + g y (x,y)(b-y)=0 h (x, y) + h x (x, y) (a - x) + h y (x,y)(b-y)=0 for a and b. For the one variable case, the corresponding equation f(x)+ f (x)(a-x)=0 is solved for a to obtain the formula for Newton iterations. Likewise, an explicit solution can be obtained in the multivariate case because the simultaneous equations are linear equations for the unknowns a and b. As remarked

11 UAlberta.nb 11 because the simultaneous equations are linear equations for the unknowns a and b. As remarked earlier, methods for solving linear equations are important. As an exercise, you should solve these equations by hand. The notebook s author has solved the equations by hand at least once in his life! So, to show you the answer, he will use the computer to display the answer. [ Note: Subscripts do not denote partial derivatives in Mathematica, but they can be used as parts of function names as in the next cell.] In[63]:= Clear[g, h, a, b] eqs = { g [x, y] + g x [x, y] (a - x) + g y [x, y] (b - y) 0, h [x, y] + h x [x, y] (a - x) + h y [x, y] (b - y) == 0} vars = {a, b} Solve[eqs, vars] Out[64]= {g[x, y] + (a - x) g x [x, y] + (b - y) g y [x, y] 0, h[x, y] + (a - x) h x [x, y] + (b - y) h y [x, y] 0} Out[65]= {a, b} Out[66]= a - h[x, y] g y[x, y] - x g y [x, y] h x [x, y] - g[x, y] h y [x, y] + x g x [x, y] h y [x, y], g y [x, y] h x [x, y] - g x [x, y] h y [x, y] b - -h[x, y] g x[x, y] + g[x, y] h x [x, y] - y g y [x, y] h x [x, y] + y g x [x, y] h y [x, y] g y [x, y] h x [x, y] - g x [x, y] h y [x, y] As you can see the explicit solution is complicated. It gets worse as the number of variables is increased. In practice, when approximations are sought, the explicit solution is almost never used. Applied mathematicians have developed fast, efficient and stable methods for approximating solutions of linear equations. The best idea is to use these methods when employing Newton s method. The usual algorithm is set up as follows. (1) Define a new variables X=x-a and Y=y-b. (2) Rearrange the linear equations to the form g x (x, y) X + g y (x, y) Y = g(x, y), h x (x, y) X + h y (x, y) Y = h(x, y). (3) Pick a starting value x 0, y 0 ) and suppose n-1 iterations have already been computed. The nth iteration is performed by solving the linear system g x (x n-1, y n-1 ) X + g y (x n-1, y n-1 ) Y = g(x n-1, y n-1 ), h x (x n-1, y n-1 ) X + h y (x n-1, y n-1 ) Y = h(x n-1, y n-1 ), for X and Y. Note that the linear system (once the functions are evaluated) is in the standard form a 11 X + a 12 Y= b 1, a 21 X + a 22 Y= b 2.

12 12 UAlberta.nb Using the computed values X and Y, the updated iterate is (x^n, y^n) = x n-1 -X, y n-1 -Y). Here a and b are replaced by the last approximations of these values. The algorithm is not complicated in principle. In practice, the main difficulty is computing the partial derivatives. This can sometimes be done by hand. One alternative is to use the computer to perform this task. In some situations the equations to be solved are so complicated that it is not feasible to compute derivatives. When faced with this problem, alternatives to Newton s method are used. The next few cells in this Mathematica Notebook implement Newton s method using a black box to solve the linear equations at each step of the iteration. You will have to eventually fill in this gap by learning the algorithms used by the programmers to approximate solutions of systems of linear equations on a computer. As usual, the code is first tested on an example where the answer is known. Don t forget this important step when you write your own programs. The code presented here is meant to be easy to understand. Much more efficient code can be written in the Mathematica programming language. Of course, there is a built in Mathematica function (called FindRoot) that can be used to approximate the desired solution using one line of code. But, don t forget that someone had to write a program using Newton s method (or one of its variants) to make this user friendly black box command. We are not interested in the answer; instead, the idea is to learn methods that are used to make these black boxes. The next cells are used to define a test problem and to implement Newton s method. [The command D[g[x,y],x] computes the partial derivative of g(x,y) with respect to x. Semicolons tell Mathematica to not print out the result of the assignment or computation. The variable sol is assigned to the output of the Mathematica command black box linear equation solver LinearSolve, where the coefficients of the linear equations and their right-hand sides are specified. The output is a list called sol, denoted by curly brackets in Mathematica, with two elements. The notation sol[[1]] specifies the first element of the list. ] Here we go... In[67]:= Clear[g, h, x0, y0] g[x_, y_] := x^2 + y^2-1 h[x_, y_] := x - y a11[x_, y_] = D[g[x, y], x]; a12[x_, y_] = D[g[x, y], y]; a21[x_, y_] = D[h[x, y], x]; a22[x_, y_] = D[h[x, y], y];

13 UAlberta.nb 13 In[74]:= x0 = 0.5; y0 = 0.5; list = {{x0, y0}}; Do[{ sol = LinearSolve[{{a11[x0, y0], a12[x0, y0]}, {a21[x0, y0], a22[x0, y0]}}, {g[x0, y0], h[x0, y0]}], x0 = x0 - sol[[1]], y0 = y0 - sol[[2]], AppendTo[list, {x0, y0}]}, {n, 1, 7}] list Out[78]= {{0.5, 0.5}, {0.75, 0.75}, { , }, { , }, { , }, { , }, { , }, { , }} In[79]:= The code produces the correct result, which should be one of the two solutions (1/Sqrt[2],1/Sqrt[2]) or (-1/Sqrt[2],-1/Sqrt[2]). Both solutions can be found via Newton s method by judicious choices of starting values. What about the order of convergence? The Mathematica command Norm computes the distance between points for us. exact = {1 / Sqrt[2], 1 / Sqrt[2]}; Table Norm[list[[i + 1]] - exact] Norm[list[[i]] - exact], {i, 1, Length[list] - 1} Power::infy: Infiniteexpression 1 0. encountered.. Out[80]= , , , , , 0., ComplexInfinity The sequence of ratios seems to be converging to zero at least over the first 4 elements. After that the approximations are so good that the denominator is almost zero and the ratios are not reliable. There is a lesson here in numerical analysis: noise sets in when errors are close to machine precision. Let s see about 2nd order convergence discussed in the course notes. In[81]:= Table Norm[list[[i + 1]] - exact] Norm[list[[i]] - exact]^2, {i, 1, Length[list] - 1} Power::infy: Infiniteexpression 1 0. encountered.. Out[81]= , , , , , 0., ComplexInfinity The convergence seems to be toward a number close to 0.5 over the first 4 iterations until the suspected noise sets in. This would indicate 2nd order convergence as predicted by the theory in the class notes. Of course, this interpretation is not rigorous. Maybe the convergence is to zero before the noise sets in and this particular example has higher-order convergence. How could we tell? The answer is we can NEVER tell by numerical experiments alone. The results of the experiments might provide evidence for some conclusion as they do here. To be sure of the convergence order requires a mathematical proof. Two comments: (1) We could compute in multiple precision (that is, by carrying a lot of digits after the decimal point in the calculations) so that the onset of noise is delayed in the interation process). (2) We could check convergence rates from multiple starting values.

14 14 UAlberta.nb Continuing with the applied problem, we can go after the point equidistant from the three observation points. Before we do, there is something important to consider: Does a solution exist? As a general rule, we should not try to approximate the solution of a problem unless we know that a solution exists. Also, in most physical problems---but not this one---there should be no more than one solution. For this reason, applied mathematicians put a lot of effort into showing that unique solutions exist for their model equations. This is the ideal situation. In real life, proving that a unique solution exists is often beyond present understanding. When this occurs, numerical experiments can be used to explore for solutions. When reliable algorithms are used, numerical experiments can provide useful information. For example, when approximate solutions are found, there is strong evidence to believe that solutions actually exist. Often the importance of the problem determines whether numerical evidence is sufficient. To be sure, a mathematical proof is required. In[82]:= Clear[F, g, h, x0, y0] F[x_, y_, a_, b_] := (a x)^3-3 a x b^2 y^2-0.1 a^4 x^4 + b^4 y^ g[x_, y_] := (x + 550)^2 + (y - 10)^2 + (F[x, y, 0.01, 0.01] )^2 - (x + 900)^2 + (y - 990)^2 + (F[x, y, 0.01, 0.01] )^2 h[x_, y_] := (x + 550)^2 + (y - 10)^2 + (F[x, y, 0.01, 0.01] )^2 - (x + 300)^2 + (y - 250)^2 + (F[x, y, 0.01, 0.01] - F[-300, 250, 0.01, 0.01])^2 a11[x_, y_] = D[g[x, y], x]; a12[x_, y_] = D[g[x, y], y]; a21[x_, y_] = D[h[x, y], x]; a22[x_, y_] = D[h[x, y], y]; In[90]:= x0 = 0.0; y0 = 0.0; list = {{x0, y0}}; Do[{ sol = LinearSolve[{{a11[x0, y0], a12[x0, y0]}, {a21[x0, y0], a22[x0, y0]}}, {g[x0, y0], h[x0, y0]}], x0 = x0 - sol[[1]], y0 = y0 - sol[[2]], AppendTo[list, {x0, y0}]}, {n, 1, 5}] list Out[94]= {{0., 0.}, { , }, { , }, { , }, { , }, { , }} Newton iterations seem to converge rapidly, which strongly suggests that the location with coordinates ( , , ) is equidistant from the three observation sites. Also, this application of the algorithm does not seem to be very sensitive to the choice of the starting value. This is not always the case. You should try some other starting values to see that the method converges to the same point. Using the graphical power of Mathematica, additional evidence for the correctness of the result is provided by the graphs shown in the next cell where g, h, and the function whose value is zero are plotted together.

15 UAlberta.nb 15 In[95]:= Plot3D[{g[x, y], 0, h[x, y]}, {x, -797, -794}, {y, 590, 597}, PlotRange All] Out[95]= As mentioned, Mathematica has a built in black box root finder. Just for fun, let s note that it produces exactly the same result. In[96]:= FindRoot[{g[x, y] 0, h[x, y] 0}, {x, 0.0}, {y, 0.0}] Out[96]= {x , y } The Mathematica command FindRoot is a much more sophisticated program than our simple implementation of Newton s method. The documentation for FindRoot says: If you specify only one starting value of x, RootFind searches for a solution using Newton methods. At least this should make you feel that the method you are learning in this course is the method of choice for state-of-the-art commercial software. Diffusion and the Heat Equation We would like to approximate solutions of the heat equation u t =κ u xx, defined on a finite spatial interval with boundary conditions and initial data. As discussed in the course notes, the basic idea is to discretize space and then time-step forward using Euler s method. In doing this, the boundary data must be taken into account. In the literature of numerical analysis, the idea just described is called the method of lines. You should know that Euler s method is the simplest possible choice for timestepping. Many other methods for approximating solutions of ordinary differential equations are known. For a simple example, consider an insulated rod where no heat flows in or out along the rod or through its ends. The rod is heated to some temperature profile, the heat source is removed and the rod is left to cool. What will happen? Our physical intuition is strong. Since no heat leaves the system, the amount of heat---whatever that is---must remain constant. Also, becasue heat diffuses from higher to lower temperatures, after a long time has passed all points on the rod will have the same temperature. Maybe we can prove these facts are predicted by Fourier s model using pencil and paper. Always remember that mathematical models are not exact representations of reality. But, to be a useful model, we certainly want our basic physical intuition to agree with predictions derived from the model.

16 16 UAlberta.nb Let s see if numerical experiments agree with our intuition. Assume our rod is one unit long. By choosing coordinates, we may as well make life simple by assuming the rod is coordinatized by the unit interval [0,1]. We can and should try a range of initial data. Because we might wish to compare our numerical experiments with Fourier series solutions, let s take the initial temperature to be given by the function f given by f(x)=2+cos π x defined for x in [0,1]. A reasonable model for no heat flow at the ends of the rod is provided by zero Neumann boundary conditions. Again for simplicity, the initial data is chosen to agree with these boundary conditions; indeed, the derivative of f vanishes at the end points of the interval. As a basic rule of numerical computation, code should be tested on examples where the exact answer is known. There are other rules! Don t start with a discretization that is too fine. It is better to start with a coarse discretization, then make refinements to see if the numerical algorithm produces results that converge to some numerical approximation as the discretization is refined. There are lots of different ways to implement the basic finite difference algorithm that has been discussed. Remember that the spatial second derivative is approximated by a second-order accurate approximation. Using Euler s method for time-stepping reduces the accuracy of the numerical method because it uses a first-order approximation to the time derivative. Undetered, let s try thes approximations to see what happens. One more thing before we do: To implement the zero Neumann boundary conditions let s try to make the temperature constant near the end points so that its spatial derivative would vanish. The discrete approximation of the temperature is called U. It is a vector of some finite length n+1. The value U[1] corresponds to the temperature at x=0 and U[n+1] is the temperature at x=1. In the algorithm, the set of values U[i], for i=2,3,4,..,n, is updated at each time step. When U[1] is needed in a calculation it is replaced by U[2] to respect the zero Neumann boundary condition, and for the same reason, U[n+1] is replaced by U[n]. After each timestep the new U[1] is replaced by U[2] and U[n+1] by U[n]. In the next code block n=15. The time step is taken to be rather small Δt= so that the flow of heat is not too fast to see in an animation. At least that was one of the reasons for this choice. There is another reason why Δt should not be chosen too large: the numerical computations (as discussed in the course notes) become unstable; that is, the the approximation vector U will not follow the true solution and large values of its components might appear. The exact bound for Δt is given by the CFL condition discussed in the course notes. Each step of the following code should be read and understood. In esssence a vector function of a vector variable is iterated at each time step and the values of the vector U at each step are stored in the list called Solution. The variable L (set to L=1 in the program) is the length of the rod. It could be changed

17 UAlberta.nb 17 In[97]:= L = 1; n = 15; Δx = 1.0 L / n; Δt = ; f[x_] = 2 + Cos[ π / L x]; (* Initial Data *) (* f[x_]=2+cos[ π/l x]+3 Cos[2 π /L x];*) (* f[x_]:=piecewise[{{2.0,x<0.2},{0.0,x>=0.2}}]*) Solution = {}; κ = 1; CFL = κ Δt Δx^2; Print "The CFL condtion requires κ Δt/Δx^2<1. Here this number is ", κ Δt Δx^2 tmax = 1500; (* Number of timesteps *) xvec = Table i - 1 Δx, {i, 1, n + 1} ; (* Discretized positions on rod *) U = Table[f[xvec[[i]]], {i, 1, n + 1}]; (* Initial discrete temperature distribution *) (* Position,Temperature initial data*) Udata = Table[{xvec[[i]], U[[i]]}, {i, 1, n + 1}]; AppendTo[Solution, Udata]; (* Udata as first element of Solution list *) Do (* Update U[[2]] as first element of a list called Utemp*) Utemp = U[[2]] + κ Δt Δx^2 ( U[[2]] - 2 U[[2]] + U[[3]]), Utable = Table U[[i]] + κ Δt Δx^2 U[[i - 1]] - 2 U[[i]] + U[[i + 1]], {i, 3, n - 1}, Utemp = Flatten[Append[Utemp, Utable]], Utemp = Append Utemp, U[[n]] + κ Δt Δx^2 (U[[n - 1]] - 2 U[[n]] + U[[n]]), Utemp = Append[Utemp, U[[n]]], (* U[[n+1]] set to U[[n]] for Neumann BC *) U = Prepend[Utemp, U[[2]]], (* U[[1]] set to U[[2]] *) (* Updated discrete temperature distribution *) Udata = Table[{xvec[[i]], U[[i]]}, {i, 1, n + 1}], (* Udata saved as next element of Solution list *) AppendTo[Solution, Udata], {j, 1, tmax} The CFL condtion requires κ Δt/Δx^2<1. Here this number is The next cell might execute slowly depending on the speed of your computer. It plots and animates the changing temperature distribution.

18 18 UAlberta.nb In[112]:= ListAnimate[Table[ListPlot[Solution[[j]], Frame True, Axes False, PlotRange {{0, L}, {0, 3}}], {j, 1, tmax}]] Out[112]= The animation of the changing approximate temperature along the rod seems to agree with intuition. At least the temperature distribution along the rod seems to converge to a constant function whose value is about 2. The number, 2, must have something to do with the amount of heat in the rod. The average temperature is, of course, the integral of the temperature over the interval representing the rod divided by the length of the interval. This quantity remains constant over time. Can you prove this fact? When you want to show that a changing quantity is actually a constant, calculus sometimes comes to the rescue. In fact, if the derivative of a function is the zero function, then the original function is constant. Check that the average value of the intial data is 2. Just for fun, what if we added another term, say 3 Cos[ 2 π / L x], to the initial data? By the above reasoning, the temperature of the rod should again settle down to a constant temperature of 2 units. Does it? Using slight modifications to our code, which you may wish to translate to another programming language, you should try to see what happens when the temperature at one or both ends is held constant. This type of boundary condition is called a Dirichlet boundary condition. Additional Interesting Exercise: Rod heated periodically at one end and insulated at the other. Imagine heat flow in and out of one of the ends of an insulated rod according to some preassigned function of time. For example, consider a periodic function of time that specifies a changing temperature at one end of the rod and suppose the other end of the rod is insulated. We woud expect the temperature in the rod to fluctuate periodically. How does the temperature at the insulated end fluctuate? Perform some numerical experiments and try to make some general statement about how the input

19 UAlberta.nb 19 Perform some numerical experiments and try to make some general statement about how the input temperature affects the (output) temperature at the other end of the rod. Can you prove your conjecture(s) about the temperature fluctuation at the insulated end using Fourier series or by other means? The most basic quesiton you might ask: Is the output temperature periodic? An interesting question that you might ask: Can the maximum temperature at the insulated end of the rod ever exceed the maximum input temperature? The following code is set up to begin working on the exercise. The idea is that you can make changes in the code to perform other numerical experiments. In[113]:= L = 1.0; n = 15; dc = 100; (* Data is saved every dc steps *) Δx = 1.0 L / n; Δt = 0.001; g[x_] = 0.0; (* Initial data *) f[t_] = Sin[2 t]; (* Temperature at the left end of the rod x=0 *) Solution = {}; κ = 1.0; CFL = κ Δt Δx^2; Print "The CFL condtion requires κ Δt/Δx^2<1. Here this number is ", κ Δt Δx^2 tmax = ; (* Number of timesteps *) Print["The final time is ", Δt tmax] xvec = Table i - 1 Δx, {i, 1, n + 1} ; U = Table[g[xvec[[i]]], {i, 1, n + 1}]; Udata = Table[{xvec[[i]], U[[i]]}, {i, 1, n + 1}]; AppendTo[Solution, Udata]; Do U1 = f Δt j - 1, Utemp = U1 + κ Δt Δx^2 ( U1-2 U1 + U[[2]]), Utable = Table U[[i]] + κ Δt Δx^2 U[[i - 1]] - 2 U[[i]] + U[[i + 1]], {i, 2, n}, Utemp = Flatten[AppendTo[Utemp, Utable]], U = AppendTo Utemp, U[[n + 1]] + κ Δt Δx^2 (U[[n - 1]] - 2 U[[n]] + U[[n]]), Udata = Table[{xvec[[i]], U[[i]]}, {i, 1, n + 1}], If[Mod[j, dc] 0, AppendTo[Solution, Udata]], {j, 1, tmax} (* The input function f (blue) and the temperature at the right end (green) are plotted. The time interval for the plot is specified in PlotRange.*) ListPlot Table j - 1 dc Δt, f j - 1 dc Δt, {j, 1, Length[Solution]}, Table j - 1 dc Δt, Solution[[j, n + 1, 2]], {j, 1, Length[Solution]}, Frame True, PlotRange {{90, 100}, {-1.5, 1.5}}, PlotStyle {Blue, Green}

20 20 UAlberta.nb The CFL condtion requires κ Δt/Δx^2<1. Here this number is The final time is Out[131]= In[132]:= (* The computed points in this plot are connected with smooth curves. *) ListPlot Table j - 1 dc Δt, f j - 1 dc Δt, {j, 1, Length[Solution]}, Table j - 1 dc Δt, Solution[[j, n + 1, 2]], {j, 1, Length[Solution]}, Frame True, Joined True, PlotRange {{0, 1}, {-1.5, 1.5}}, PlotStyle {Blue, Green} Out[132]= Additional Interesting Exercise: Diffusion Coefficient for Molecules in Liquid Put some sugar at the bottom of a jar of water and don t stir the mixture. How long does it take for water drawn from the top of the jar to taste sweet? In reality, diffusion is a very slow process. This exercise is about some diffusion measurements. Sugar molecules are large; they diffuse very slowly. So we will consider some chemical element that diffuses faster---think copper sulfate, for example. The data discussed here is not accurate to experimental standards, but the sizes of the numbers involved are physically realistic. To be more precise, imagine a chemical element that dissolves in water and a mixture of 50 grams per liter of this element poured into the bottom of a round cylindrical flask. Pure water is added on top of the fluid mixture in a very careful manner so that no stirring takes place. The pure water has a depth of 10 centimeters above the surface Σ of the mixture. The flask has a small hole located exactly 2 centimeters above Σ that allows small samples to be extrated and tested for the chemical concentrations every 24 hours for 10 days. Here are the results given in the form (days, grams/liter of the chemical element)

21 UAlberta.nb 21 flask. Pure water is added on top of the fluid mixture in a very careful manner so that no stirring takes place. The pure water has a depth of 10 centimeters above the surface Σ of the mixture. The flask has a small hole located exactly 2 centimeters above Σ that allows small samples to be extrated and tested for the chemical concentrations every 24 hours for 10 days. Here are the results given in the form (days, grams/liter of the chemical element) In[133]:= data = {{1, 0.0}, {2, 0.0}, {3, 0.096}, {4, 0.594}, {5, 1.484}, {6, 2.598}, {7, 3.806}, {8, 5.031}, {9, 6.23}, {10, 7.382}} Out[133]= {{1, 0.}, {2, 0.}, {3, 0.096}, {4, 0.594}, {5, 1.484}, {6, 2.598}, {7, 3.806}, {8, 5.031}, {9, 6.23}, {10, 7.382}} The problem: What is the diffusion coefficient for the dissolved chemical element? Remember our diffusion model is u t =κ u xx, where is the concentration that can be taken in units of g/l. The diffusion coefficient is κ. It has units of area/time and is usually expressed in the units cm^2/sec. The answer to our problem should be given in these units. Hints: Set up boundary conditions for the diffusion equation and think about how the data would be obtained by solving your model system were the diffusion coefficient known. Then try to find the choice of diffusion coeffiient that produces concentrations that best fit the data. Ans: Approximately ^-6 cm^2/sec.

Solution of Algebric & Transcendental Equations

Solution of Algebric & Transcendental Equations Page15 Solution of Algebric & Transcendental Equations Contents: o Introduction o Evaluation of Polynomials by Horner s Method o Methods of solving non linear equations o Bracketing Methods o Bisection

More information

Differentiation 1. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

Differentiation 1. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. Differentiation 1 The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996. 1 Launch Mathematica. Type

More information

Algebra & Trig Review

Algebra & Trig Review Algebra & Trig Review 1 Algebra & Trig Review This review was originally written for my Calculus I class, but it should be accessible to anyone needing a review in some basic algebra and trig topics. The

More information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER / Lines and Their Equations ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 017/018 DR. ANTHONY BROWN. Lines and Their Equations.1. Slope of a Line and its y-intercept. In Euclidean geometry (where

More information

Math 253 Homework due Wednesday, March 9 SOLUTIONS

Math 253 Homework due Wednesday, March 9 SOLUTIONS Math 53 Homework due Wednesday, March 9 SOLUTIONS 1. Do Section 8.8, problems 11,, 15, 17 (these problems have to do with Taylor s Inequality, and they are very similar to what we did on the last homework.

More information

Stephen F Austin. Exponents and Logarithms. chapter 3

Stephen F Austin. Exponents and Logarithms. chapter 3 chapter 3 Starry Night was painted by Vincent Van Gogh in 1889. The brightness of a star as seen from Earth is measured using a logarithmic scale. Exponents and Logarithms This chapter focuses on understanding

More information

CHAPTER 10 Zeros of Functions

CHAPTER 10 Zeros of Functions CHAPTER 10 Zeros of Functions An important part of the maths syllabus in secondary school is equation solving. This is important for the simple reason that equations are important a wide range of problems

More information

MATH 1130 Exam 1 Review Sheet

MATH 1130 Exam 1 Review Sheet MATH 1130 Exam 1 Review Sheet The Cartesian Coordinate Plane The Cartesian Coordinate Plane is a visual representation of the collection of all ordered pairs (x, y) where x and y are real numbers. This

More information

2.1 Definition. Let n be a positive integer. An n-dimensional vector is an ordered list of n real numbers.

2.1 Definition. Let n be a positive integer. An n-dimensional vector is an ordered list of n real numbers. 2 VECTORS, POINTS, and LINEAR ALGEBRA. At first glance, vectors seem to be very simple. It is easy enough to draw vector arrows, and the operations (vector addition, dot product, etc.) are also easy to

More information

Main topics for the First Midterm Exam

Main topics for the First Midterm Exam Main topics for the First Midterm Exam The final will cover Sections.-.0, 2.-2.5, and 4.. This is roughly the material from first three homeworks and three quizzes, in addition to the lecture on Monday,

More information

Math 5a Reading Assignments for Sections

Math 5a Reading Assignments for Sections Math 5a Reading Assignments for Sections 4.1 4.5 Due Dates for Reading Assignments Note: There will be a very short online reading quiz (WebWork) on each reading assignment due one hour before class on

More information

AIMS Exercise Set # 1

AIMS Exercise Set # 1 AIMS Exercise Set #. Determine the form of the single precision floating point arithmetic used in the computers at AIMS. What is the largest number that can be accurately represented? What is the smallest

More information

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software

Practical Algebra. A Step-by-step Approach. Brought to you by Softmath, producers of Algebrator Software Practical Algebra A Step-by-step Approach Brought to you by Softmath, producers of Algebrator Software 2 Algebra e-book Table of Contents Chapter 1 Algebraic expressions 5 1 Collecting... like terms 5

More information

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions

Math 308 Midterm Answers and Comments July 18, Part A. Short answer questions Math 308 Midterm Answers and Comments July 18, 2011 Part A. Short answer questions (1) Compute the determinant of the matrix a 3 3 1 1 2. 1 a 3 The determinant is 2a 2 12. Comments: Everyone seemed to

More information

Zeros of Functions. Chapter 10

Zeros of Functions. Chapter 10 Chapter 10 Zeros of Functions An important part of the mathematics syllabus in secondary school is equation solving. This is important for the simple reason that equations are important a wide range of

More information

Mathematics 102 Fall 1999 The formal rules of calculus The three basic rules The sum rule. The product rule. The composition rule.

Mathematics 102 Fall 1999 The formal rules of calculus The three basic rules The sum rule. The product rule. The composition rule. Mathematics 02 Fall 999 The formal rules of calculus So far we have calculated the derivative of each function we have looked at all over again from scratch, applying what is essentially the definition

More information

SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS BISECTION METHOD

SOLUTION OF ALGEBRAIC AND TRANSCENDENTAL EQUATIONS BISECTION METHOD BISECTION METHOD If a function f(x) is continuous between a and b, and f(a) and f(b) are of opposite signs, then there exists at least one root between a and b. It is shown graphically as, Let f a be negative

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Basic Concepts Paul Dawkins Table of Contents Preface... Basic Concepts... 1 Introduction... 1 Definitions... Direction Fields... 8 Final Thoughts...19 007 Paul Dawkins i http://tutorial.math.lamar.edu/terms.aspx

More information

8.5 Taylor Polynomials and Taylor Series

8.5 Taylor Polynomials and Taylor Series 8.5. TAYLOR POLYNOMIALS AND TAYLOR SERIES 50 8.5 Taylor Polynomials and Taylor Series Motivating Questions In this section, we strive to understand the ideas generated by the following important questions:

More information

Chapter 1 Review of Equations and Inequalities

Chapter 1 Review of Equations and Inequalities Chapter 1 Review of Equations and Inequalities Part I Review of Basic Equations Recall that an equation is an expression with an equal sign in the middle. Also recall that, if a question asks you to solve

More information

Physics 212E Spring 2004 Classical and Modern Physics. Computer Exercise #2

Physics 212E Spring 2004 Classical and Modern Physics. Computer Exercise #2 Physics 212E Spring 2004 Classical and Modern Physics Chowdary Computer Exercise #2 Launch Mathematica by clicking on the Start menu (lower left hand corner of the screen); from there go up to Science

More information

Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur

Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur Computational Fluid Dynamics Prof. Dr. SumanChakraborty Department of Mechanical Engineering Indian Institute of Technology, Kharagpur Lecture No. #11 Fundamentals of Discretization: Finite Difference

More information

CHAPTER 1. INTRODUCTION. ERRORS.

CHAPTER 1. INTRODUCTION. ERRORS. CHAPTER 1. INTRODUCTION. ERRORS. SEC. 1. INTRODUCTION. Frequently, in fact most commonly, practical problems do not have neat analytical solutions. As examples of analytical solutions to mathematical problems,

More information

Lies My Calculator and Computer Told Me

Lies My Calculator and Computer Told Me Lies My Calculator and Computer Told Me 2 LIES MY CALCULATOR AND COMPUTER TOLD ME Lies My Calculator and Computer Told Me See Section.4 for a discussion of graphing calculators and computers with graphing

More information

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013

Number Systems III MA1S1. Tristan McLoughlin. December 4, 2013 Number Systems III MA1S1 Tristan McLoughlin December 4, 2013 http://en.wikipedia.org/wiki/binary numeral system http://accu.org/index.php/articles/1558 http://www.binaryconvert.com http://en.wikipedia.org/wiki/ascii

More information

19. TAYLOR SERIES AND TECHNIQUES

19. TAYLOR SERIES AND TECHNIQUES 19. TAYLOR SERIES AND TECHNIQUES Taylor polynomials can be generated for a given function through a certain linear combination of its derivatives. The idea is that we can approximate a function by a polynomial,

More information

Figure 1: Doing work on a block by pushing it across the floor.

Figure 1: Doing work on a block by pushing it across the floor. Work Let s imagine I have a block which I m pushing across the floor, shown in Figure 1. If I m moving the block at constant velocity, then I know that I have to apply a force to compensate the effects

More information

Sequences and Series

Sequences and Series Sequences and Series What do you think of when you read the title of our next unit? In case your answers are leading us off track, let's review the following IB problems. 1 November 2013 HL 2 3 November

More information

Study skills for mathematicians

Study skills for mathematicians PART I Study skills for mathematicians CHAPTER 1 Sets and functions Everything starts somewhere, although many physicists disagree. Terry Pratchett, Hogfather, 1996 To think like a mathematician requires

More information

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane.

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane. Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Spring 2018 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 2018 3 Lecture 3 3.1 General remarks March 4, 2018 This

More information

PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435

PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435 PART I Lecture Notes on Numerical Solution of Root Finding Problems MATH 435 Professor Biswa Nath Datta Department of Mathematical Sciences Northern Illinois University DeKalb, IL. 60115 USA E mail: dattab@math.niu.edu

More information

Chapter 11 - Sequences and Series

Chapter 11 - Sequences and Series Calculus and Analytic Geometry II Chapter - Sequences and Series. Sequences Definition. A sequence is a list of numbers written in a definite order, We call a n the general term of the sequence. {a, a

More information

COSMOS: Making Robots and Making Robots Intelligent Lecture 3: Introduction to discrete-time dynamics

COSMOS: Making Robots and Making Robots Intelligent Lecture 3: Introduction to discrete-time dynamics COSMOS: Making Robots and Making Robots Intelligent Lecture 3: Introduction to discrete-time dynamics Jorge Cortés and William B. Dunbar June 3, 25 Abstract In this and the coming lecture, we will introduce

More information

Math Precalculus I University of Hawai i at Mānoa Spring

Math Precalculus I University of Hawai i at Mānoa Spring Math 135 - Precalculus I University of Hawai i at Mānoa Spring - 2013 Created for Math 135, Spring 2008 by Lukasz Grabarek and Michael Joyce Send comments and corrections to lukasz@math.hawaii.edu Contents

More information

Optimization and Calculus

Optimization and Calculus Optimization and Calculus To begin, there is a close relationship between finding the roots to a function and optimizing a function. In the former case, we solve for x. In the latter, we solve: g(x) =

More information

Algebra 1 S1 Lesson Summaries. Lesson Goal: Mastery 70% or higher

Algebra 1 S1 Lesson Summaries. Lesson Goal: Mastery 70% or higher Algebra 1 S1 Lesson Summaries For every lesson, you need to: Read through the LESSON REVIEW which is located below or on the last page of the lesson and 3-hole punch into your MATH BINDER. Read and work

More information

2 Systems of Linear Equations

2 Systems of Linear Equations 2 Systems of Linear Equations A system of equations of the form or is called a system of linear equations. x + 2y = 7 2x y = 4 5p 6q + r = 4 2p + 3q 5r = 7 6p q + 4r = 2 Definition. An equation involving

More information

MEI Core 1. Basic Algebra. Section 1: Basic algebraic manipulation and solving simple equations. Manipulating algebraic expressions

MEI Core 1. Basic Algebra. Section 1: Basic algebraic manipulation and solving simple equations. Manipulating algebraic expressions MEI Core Basic Algebra Section : Basic algebraic manipulation and solving simple equations Notes and Examples These notes contain subsections on Manipulating algebraic expressions Collecting like terms

More information

7.5 Partial Fractions and Integration

7.5 Partial Fractions and Integration 650 CHPTER 7. DVNCED INTEGRTION TECHNIQUES 7.5 Partial Fractions and Integration In this section we are interested in techniques for computing integrals of the form P(x) dx, (7.49) Q(x) where P(x) and

More information

Parabolas and lines

Parabolas and lines Parabolas and lines Study the diagram at the right. I have drawn the graph y = x. The vertical line x = 1 is drawn and a number of secants to the parabola are drawn, all centred at x=1. By this I mean

More information

2.2 Graphs of Functions

2.2 Graphs of Functions 2.2 Graphs of Functions Introduction DEFINITION domain of f, D(f) Associated with every function is a set called the domain of the function. This set influences what the graph of the function looks like.

More information

A Few Concepts from Numerical Analysis

A Few Concepts from Numerical Analysis 2 A Few Concepts from Numerical Analysis A systematic treatment of numerical methods is provided in conventional courses and textbooks on numerical analysis. But a few very common issues, that emerge in

More information

Maps and differential equations

Maps and differential equations Maps and differential equations Marc R. Roussel November 8, 2005 Maps are algebraic rules for computing the next state of dynamical systems in discrete time. Differential equations and maps have a number

More information

8.7 MacLaurin Polynomials

8.7 MacLaurin Polynomials 8.7 maclaurin polynomials 67 8.7 MacLaurin Polynomials In this chapter you have learned to find antiderivatives of a wide variety of elementary functions, but many more such functions fail to have an antiderivative

More information

PLC Papers. Created For:

PLC Papers. Created For: PLC Papers Created For: Algebra and proof 2 Grade 8 Objective: Use algebra to construct proofs Question 1 a) If n is a positive integer explain why the expression 2n + 1 is always an odd number. b) Use

More information

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky What follows is Vladimir Voevodsky s snapshot of his Fields Medal work on motivic homotopy, plus a little philosophy and from my point of view the main fun of doing mathematics Voevodsky (2002). Voevodsky

More information

Math (P)Review Part II:

Math (P)Review Part II: Math (P)Review Part II: Vector Calculus Computer Graphics Assignment 0.5 (Out today!) Same story as last homework; second part on vector calculus. Slightly fewer questions Last Time: Linear Algebra Touched

More information

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course

SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING. Self-paced Course SCHOOL OF MATHEMATICS MATHEMATICS FOR PART I ENGINEERING Self-paced Course MODULE ALGEBRA Module Topics Simplifying expressions and algebraic functions Rearranging formulae Indices 4 Rationalising a denominator

More information

Lecture 7. Root finding I. 1 Introduction. 2 Graphical solution

Lecture 7. Root finding I. 1 Introduction. 2 Graphical solution 1 Introduction Lecture 7 Root finding I For our present purposes, root finding is the process of finding a real value of x which solves the equation f (x)=0. Since the equation g x =h x can be rewritten

More information

MIT (Spring 2014)

MIT (Spring 2014) 18.311 MIT (Spring 014) Rodolfo R. Rosales May 6, 014. Problem Set # 08. Due: Last day of lectures. IMPORTANT: Turn in the regular and the special problems stapled in two SEPARATE packages. Print your

More information

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1

2tdt 1 y = t2 + C y = which implies C = 1 and the solution is y = 1 Lectures - Week 11 General First Order ODEs & Numerical Methods for IVPs In general, nonlinear problems are much more difficult to solve than linear ones. Unfortunately many phenomena exhibit nonlinear

More information

We have seen that the symbols,,, and can guide the logical

We have seen that the symbols,,, and can guide the logical CHAPTER 7 Quantified Statements We have seen that the symbols,,, and can guide the logical flow of algorithms. We have learned how to use them to deconstruct many English sentences into a symbolic form.

More information

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2

Final Review Sheet. B = (1, 1 + 3x, 1 + x 2 ) then 2 + 3x + 6x 2 Final Review Sheet The final will cover Sections Chapters 1,2,3 and 4, as well as sections 5.1-5.4, 6.1-6.2 and 7.1-7.3 from chapters 5,6 and 7. This is essentially all material covered this term. Watch

More information

Chapter 3: Root Finding. September 26, 2005

Chapter 3: Root Finding. September 26, 2005 Chapter 3: Root Finding September 26, 2005 Outline 1 Root Finding 2 3.1 The Bisection Method 3 3.2 Newton s Method: Derivation and Examples 4 3.3 How To Stop Newton s Method 5 3.4 Application: Division

More information

Slope Fields: Graphing Solutions Without the Solutions

Slope Fields: Graphing Solutions Without the Solutions 8 Slope Fields: Graphing Solutions Without the Solutions Up to now, our efforts have been directed mainly towards finding formulas or equations describing solutions to given differential equations. Then,

More information

Taylor series. Chapter Introduction From geometric series to Taylor polynomials

Taylor series. Chapter Introduction From geometric series to Taylor polynomials Chapter 2 Taylor series 2. Introduction The topic of this chapter is find approximations of functions in terms of power series, also called Taylor series. Such series can be described informally as infinite

More information

Linear Algebra, Summer 2011, pt. 2

Linear Algebra, Summer 2011, pt. 2 Linear Algebra, Summer 2, pt. 2 June 8, 2 Contents Inverses. 2 Vector Spaces. 3 2. Examples of vector spaces..................... 3 2.2 The column space......................... 6 2.3 The null space...........................

More information

Finite Differences TEACHER NOTES MATH NSPIRED

Finite Differences TEACHER NOTES MATH NSPIRED Math Objectives Students will be able to recognize that the first set of finite differences for a linear function will be constant. Students will be able to recognize that the second set of finite differences

More information

Chapter 1. Root Finding Methods. 1.1 Bisection method

Chapter 1. Root Finding Methods. 1.1 Bisection method Chapter 1 Root Finding Methods We begin by considering numerical solutions to the problem f(x) = 0 (1.1) Although the problem above is simple to state it is not always easy to solve analytically. This

More information

MATH 415, WEEKS 14 & 15: 1 Recurrence Relations / Difference Equations

MATH 415, WEEKS 14 & 15: 1 Recurrence Relations / Difference Equations MATH 415, WEEKS 14 & 15: Recurrence Relations / Difference Equations 1 Recurrence Relations / Difference Equations In many applications, the systems are updated in discrete jumps rather than continuous

More information

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2018

ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER /2018 ACCESS TO SCIENCE, ENGINEERING AND AGRICULTURE: MATHEMATICS 1 MATH00030 SEMESTER 1 2017/2018 DR. ANTHONY BROWN 1. Arithmetic and Algebra 1.1. Arithmetic of Numbers. While we have calculators and computers

More information

5.4 Continuity: Preliminary Notions

5.4 Continuity: Preliminary Notions 5.4. CONTINUITY: PRELIMINARY NOTIONS 181 5.4 Continuity: Preliminary Notions 5.4.1 Definitions The American Heritage Dictionary of the English Language defines continuity as an uninterrupted succession,

More information

= 5 2 and = 13 2 and = (1) = 10 2 and = 15 2 and = 25 2

= 5 2 and = 13 2 and = (1) = 10 2 and = 15 2 and = 25 2 BEGINNING ALGEBRAIC NUMBER THEORY Fermat s Last Theorem is one of the most famous problems in mathematics. Its origin can be traced back to the work of the Greek mathematician Diophantus (third century

More information

Introduction to Vectors

Introduction to Vectors Introduction to Vectors K. Behrend January 31, 008 Abstract An introduction to vectors in R and R 3. Lines and planes in R 3. Linear dependence. 1 Contents Introduction 3 1 Vectors 4 1.1 Plane vectors...............................

More information

Infinite series, improper integrals, and Taylor series

Infinite series, improper integrals, and Taylor series Chapter 2 Infinite series, improper integrals, and Taylor series 2. Introduction to series In studying calculus, we have explored a variety of functions. Among the most basic are polynomials, i.e. functions

More information

MSM120 1M1 First year mathematics for civil engineers Revision notes 4

MSM120 1M1 First year mathematics for civil engineers Revision notes 4 MSM10 1M1 First year mathematics for civil engineers Revision notes 4 Professor Robert A. Wilson Autumn 001 Series A series is just an extended sum, where we may want to add up infinitely many numbers.

More information

Resonance and response

Resonance and response Chapter 2 Resonance and response Last updated September 20, 2008 In this section of the course we begin with a very simple system a mass hanging from a spring and see how some remarkable ideas emerge.

More information

INTRODUCTION TO DIFFERENTIATION

INTRODUCTION TO DIFFERENTIATION INTRODUCTION TO DIFFERENTIATION GRADIENT OF A CURVE We have looked at the process needed for finding the gradient of a curve (or the rate of change of a curve). We have defined the gradient of a curve

More information

AP Physics 1 Summer Assignment Packet

AP Physics 1 Summer Assignment Packet AP Physics 1 Summer Assignment Packet 2017-18 Welcome to AP Physics 1 at David Posnack Jewish Day School. The concepts of physics are the most fundamental found in the sciences. By the end of the year,

More information

Calculus at Rutgers. Course descriptions

Calculus 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 information

Design and Optimization of Energy Systems Prof. C. Balaji Department of Mechanical Engineering Indian Institute of Technology, Madras

Design and Optimization of Energy Systems Prof. C. Balaji Department of Mechanical Engineering Indian Institute of Technology, Madras Design and Optimization of Energy Systems Prof. C. Balaji Department of Mechanical Engineering Indian Institute of Technology, Madras Lecture - 09 Newton-Raphson Method Contd We will continue with our

More information

Math 111, Introduction to the Calculus, Fall 2011 Midterm I Practice Exam 1 Solutions

Math 111, Introduction to the Calculus, Fall 2011 Midterm I Practice Exam 1 Solutions Math 111, Introduction to the Calculus, Fall 2011 Midterm I Practice Exam 1 Solutions For each question, there is a model solution (showing you the level of detail I expect on the exam) and then below

More information

MATH 320, WEEK 6: Linear Systems, Gaussian Elimination, Coefficient Matrices

MATH 320, WEEK 6: Linear Systems, Gaussian Elimination, Coefficient Matrices MATH 320, WEEK 6: Linear Systems, Gaussian Elimination, Coefficient Matrices We will now switch gears and focus on a branch of mathematics known as linear algebra. There are a few notes worth making before

More information

Numerical Methods of Approximation

Numerical Methods of Approximation Contents 31 Numerical Methods of Approximation 31.1 Polynomial Approximations 2 31.2 Numerical Integration 28 31.3 Numerical Differentiation 58 31.4 Nonlinear Equations 67 Learning outcomes In this Workbook

More information

Introduction. So, why did I even bother to write this?

Introduction. So, why did I even bother to write this? Introduction This review was originally written for my Calculus I class, but it should be accessible to anyone needing a review in some basic algebra and trig topics. The review contains the occasional

More information

Intro to Scientific Computing: How long does it take to find a needle in a haystack?

Intro to Scientific Computing: How long does it take to find a needle in a haystack? Intro to Scientific Computing: How long does it take to find a needle in a haystack? Dr. David M. Goulet Intro Binary Sorting Suppose that you have a detector that can tell you if a needle is in a haystack,

More information

Chapter 9: Roots and Irrational Numbers

Chapter 9: Roots and Irrational Numbers Chapter 9: Roots and Irrational Numbers Index: A: Square Roots B: Irrational Numbers C: Square Root Functions & Shifting D: Finding Zeros by Completing the Square E: The Quadratic Formula F: Quadratic

More information

A DEEPER LOOK AT USING FUNCTIONS IN MATHEMATICA

A DEEPER LOOK AT USING FUNCTIONS IN MATHEMATICA A DEEPER LOOK AT USING FUNCTIONS IN MATHEMATICA In "Getting Started with Mathematica" we learned the basics of plotting and doing computations in this platform. In this document, I will delve a little

More information

Secondary Math 3 Honors Unit 10: Functions Name:

Secondary Math 3 Honors Unit 10: Functions Name: Secondary Math 3 Honors Unit 10: Functions Name: Parent Functions As you continue to study mathematics, you will find that the following functions will come up again and again. Please use the following

More information

Modeling Data with Functions

Modeling Data with Functions Chapter 11 Modeling Data with Functions 11.1 Data Modeling Concepts 1 11.1.1 Conceptual Explanations: Modeling Data with Functions In school, you generally start with a function and work from there to

More information

Students should read Sections of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section.

Students should read Sections of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section. Chapter 3 Differentiation ü 3.1 The Derivative Students should read Sections 3.1-3.5 of Rogawski's Calculus [1] for a detailed discussion of the material presented in this section. ü 3.1.1 Slope of Tangent

More information

Homework 5: Sampling and Geometry

Homework 5: Sampling and Geometry Homework 5: Sampling and Geometry Introduction to Computer Graphics and Imaging (Summer 2012), Stanford University Due Monday, August 6, 11:59pm You ll notice that this problem set is a few more pages

More information

Computational Methods CMSC/AMSC/MAPL 460. Solving nonlinear equations and zero finding. Finding zeroes of functions

Computational Methods CMSC/AMSC/MAPL 460. Solving nonlinear equations and zero finding. Finding zeroes of functions Computational Methods CMSC/AMSC/MAPL 460 Solving nonlinear equations and zero finding Ramani Duraiswami, Dept. of Computer Science Where does it arise? Finding zeroes of functions Solving functional equations

More information

The Methods of Science

The Methods of Science 1 The Methods of Science What is Science? Science is a method for studying the natural world. It is a process that uses observation and investigation to gain knowledge about events in nature. 1 The Methods

More information

Real Analysis Prof. S.H. Kulkarni Department of Mathematics Indian Institute of Technology, Madras. Lecture - 13 Conditional Convergence

Real Analysis Prof. S.H. Kulkarni Department of Mathematics Indian Institute of Technology, Madras. Lecture - 13 Conditional Convergence Real Analysis Prof. S.H. Kulkarni Department of Mathematics Indian Institute of Technology, Madras Lecture - 13 Conditional Convergence Now, there are a few things that are remaining in the discussion

More information

SECTION 1-5 Integer Exponents

SECTION 1-5 Integer Exponents 42 Basic Algebraic Operations In Problems 45 52, imagine that the indicated solutions were given to you by a student whom you were tutoring in this class. (A) Is the solution correct? If the solution is

More information

Solving simple equations, a review/primer

Solving simple equations, a review/primer ucsc supplementary notes ams/econ 11a Solving simple equations, a review/primer c 2012 Yonatan Katznelson Differential and integral calculus do not replace algebra, they build on it When working problems

More information

2. FUNCTIONS AND ALGEBRA

2. FUNCTIONS AND ALGEBRA 2. FUNCTIONS AND ALGEBRA You might think of this chapter as an icebreaker. Functions are the primary participants in the game of calculus, so before we play the game we ought to get to know a few functions.

More information

AP Calculus. Derivatives.

AP Calculus. Derivatives. 1 AP Calculus Derivatives 2015 11 03 www.njctl.org 2 Table of Contents Rate of Change Slope of a Curve (Instantaneous ROC) Derivative Rules: Power, Constant, Sum/Difference Higher Order Derivatives Derivatives

More information

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way EECS 16A Designing Information Devices and Systems I Fall 018 Lecture Notes Note 1 1.1 Introduction to Linear Algebra the EECS Way In this note, we will teach the basics of linear algebra and relate it

More information

Finite Mathematics : A Business Approach

Finite Mathematics : A Business Approach Finite Mathematics : A Business Approach Dr. Brian Travers and Prof. James Lampes Second Edition Cover Art by Stephanie Oxenford Additional Editing by John Gambino Contents What You Should Already Know

More information

Complex numbers, the exponential function, and factorization over C

Complex numbers, the exponential function, and factorization over C Complex numbers, the exponential function, and factorization over C 1 Complex Numbers Recall that for every non-zero real number x, its square x 2 = x x is always positive. Consequently, R does not contain

More information

Project 2: Using linear systems for numerical solution of boundary value problems

Project 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 information

AP Calculus (Mr. Surowski)

AP Calculus (Mr. Surowski) AP Calculus Mr. Surowski) Lesson 14 Indeterminate forms Homework from Chapter 4 and some of Chapter 8) 8.2) l Hôpital s rule and more on its; see notes below.) 5 30, 35 47, 50, 60. 1 8.3): 1 12, 13 28,

More information

LAB 3: VELOCITY AND ACCELERATION

LAB 3: VELOCITY AND ACCELERATION Lab 3 - Velocity & Acceleration 25 Name Date Partners LAB 3: VELOCITY AND ACCELERATION A cheetah can accelerate from to 5 miles per hour in 6.4 seconds. A Jaguar can accelerate from to 5 miles per hour

More information

Solving Differential Equations: First Steps

Solving Differential Equations: First Steps 30 ORDINARY DIFFERENTIAL EQUATIONS 3 Solving Differential Equations Solving Differential Equations: First Steps Now we start answering the question which is the theme of this book given a differential

More information

Chapter 1A -- Real Numbers. iff. Math Symbols: Sets of Numbers

Chapter 1A -- Real Numbers. iff. Math Symbols: Sets of Numbers Fry Texas A&M University! Fall 2016! Math 150 Notes! Section 1A! Page 1 Chapter 1A -- Real Numbers Math Symbols: iff or Example: Let A = {2, 4, 6, 8, 10, 12, 14, 16,...} and let B = {3, 6, 9, 12, 15, 18,

More information

III.A. ESTIMATIONS USING THE DERIVATIVE Draft Version 10/13/05 Martin Flashman 2005 III.A.2 NEWTON'S METHOD

III.A. ESTIMATIONS USING THE DERIVATIVE Draft Version 10/13/05 Martin Flashman 2005 III.A.2 NEWTON'S METHOD III.A. ESTIMATIONS USING THE DERIVATIVE Draft Version 10/13/05 Martin Flashman 2005 III.A.2 NEWTON'S METHOD Motivation: An apocryphal story: On our last trip to Disneyland, California, it was about 11

More information

3.5 Quadratic Approximation and Convexity/Concavity

3.5 Quadratic Approximation and Convexity/Concavity 3.5 Quadratic Approximation and Convexity/Concavity 55 3.5 Quadratic Approximation and Convexity/Concavity Overview: Second derivatives are useful for understanding how the linear approximation varies

More information

College Algebra Through Problem Solving (2018 Edition)

College Algebra Through Problem Solving (2018 Edition) City University of New York (CUNY) CUNY Academic Works Open Educational Resources Queensborough Community College Winter 1-25-2018 College Algebra Through Problem Solving (2018 Edition) Danielle Cifone

More information