Homework #4 Solution
13.2 Given f ( x ) = -1.5 x 6 - 2 x 4 + 12 x (a) Plot the function. (b) Use analytical methods to prove that the function is concave for all values of x. (c) Differentiate the function and then use a root-location method to solve for
1 Write a program in a language of your choice to implement Newtons method.
derivative. Try out the Newtons method program to find a root of f ( x ) = e - ( x SOLUTION: Option Explicit Function Newton(xi, es, imax) Dim xr As Double, xrold As Double, ea As
Homework #1 Solution
1. Determine machine epsilon in both double and single precision for Excel Visual Basic.
SOLUTION:
For single precision:
Option Explicit Function MachEps() Dim eps As Single, eps1 As Single, eps2 As Single eps = 1 Do eps1 = 1 + eps ep
HW#5 Solution
21.8 Integrate the following function using the trapezoidal rule, with n = 1,2,3,4:
2
(x + 1 / x )
1
2
dx
Compute percent relative errors with respect to the true value of 4.8333 to evaluate the accuracy of the trapezoidal approximations.
2
HW#6 Solution
25.1 The analytical solution can be derived by separation of variables
dy = x 2 - 12 dx . y
ln y =
x3 - 1.2 x + C 3
Substituting the initial conditions yields C = 0. Taking the exponential give the final result
y=
x3 -1.2 x e3
The result can
University of California, Davis Department of Applied Science
Fall 2009 David M. Rocke
Numerical Methods
EAD 115 September 30, 2009
Homework Assignment 1 Due October 7, 2009
1. Determine machine epsilon in both double and single precision for Excel Visual
University of California, Davis Department of Applied Science
Spring 2004 David M. Rocke
Numerical Methods
EAD 115 April 27, 2004
Midterm Examination
NAME For all problems on this midterm examination, we will use the function f (x) = 2x3 - 3x2 - 11x + 6 .
Write a program in a language of your choice to implement Nave Gaussian Elimination. SOLUTION: Option Explicit Sub Gauss() ' ' Declarations ' Dim A() As Variant, b() As Variant, x() As Variant Dim nrows As Integer, ncols As Integer, n As Integer Dim rng1
University of California, Davis Department of Applied Science
Fall 2010 David M. Rocke
Numerical Methods
EAD 115 September 29, 2010
Homework Assignment 1 Due October 6, 2010
1. Determine machine epsilon in both double and single precision for Excel Visual