Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
EGM 3344
Homework 4 Solutions
Assigned: January 31, 2014
Due: before start of class, February 7, 2014
Your Name Here (Print Neatly)
Student UF ID Number
Course Section Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should b
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
EGM 3344
Homework 4
Assigned: January 31, 2014
Due: before start of class, February 7, 2014
Your Name Here (Print Neatly)
Student UF ID Number
Course Section Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should be stapled
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2010
Homework  112
ME 431 Homework
A crankrocker mechanism with a time ratio of 1.4 and a rocker oscillation angle of 70 degrees is
to be designed. Draw the mechanism in any position. If the length of the base link is 2 inches,
give the lengths of the other
INTRODUCTION TO NUMERICAL METHODS OF ENGINEERING ANALYSIS
EGM 3344

Fall 2010
Solution to HW3
EGM3344
FALL 2010
Problem 4.1
Problem 4.3
function ep = macheps
% determines the machine epsilon
e = 1;
while (1)
if e+1<=1, break, end
e = e/2;
end
ep = 2*e;
> macheps
ans =
2.2204e016
> eps
ans =
2.2204e016
Problem 4.4
function s = sma
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
EGM 3344
Homework 3 Solutions
Assigned: January 24, 2014
Due: before start of class, January 31, 2014
Your Name Here (Print Neatly)
Student UF ID Number
Course Section Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should b
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
EGM 3344
Homework 12 Solutions
Assigned: April 14, 2014
Due: before start of class, April 21, 2014
Your Name Here (Print Neatly)
Student UF ID Number
Course Section Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should be s
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Fall 2015
EGM 3344
Homework 1
Assigned: September 1, 2015
Due: Beginning of the lecture, September 9, 2015
Your Name Here (Print Neatly)
Student UF ID Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should be stapled to the rst page o
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
EGM 3344
Homework 3
Assigned: January 24, 2014
Due: before start of class, January 31, 2014
Your Name Here (Print Neatly)
Student UF ID Number
Course Section Number
University of Florida
Gainesville, FL 326116250
Instructions
Your work should be stapled
22308
Name:
EGM 3344 Introduction to Numerical Methods of Engineering Analysis
SECOND INTERM EXAM
In this exam you may use only one 8.5x11 formula page, and a pen or a pencil (no
computers or calculators). Please sign a pledge that you have not violate
First some leftover from Monday. We ran into difficulty using the forward function.
function der=forward(f,x,h,varargin) %Calculates the derivative of the function f with respect to x using a 0orward difference approximation with step size h. varargin in
Taylor series expansion of f=cos(x) about x=0.
f '(0) =  sin(0) = 0, f (3) (0) = sin(0) = 0, f "(0) =  cos(0) = 1 f (4) (0) = cos(0) = 1, etc.
So Taylor series expansion is (as given in Problem 4.10)
cos( x) = 1  x 2 x 4 x 6 x8 +  + + 2! 4! 6! 8!
1232009
Roundoff and Truncation errors. Discussion of accuracy and precision in textbook. Note that I do not agree that Figure 4.1 (b) is a good example of improved accuracy compared to Figure 4.1(a). In fact, 4.1(d) shows results that are substantially
4308
Name:
EGM 3344 Introduction to Numerical Methods of Engineering Analysis
THIRD INTERM EXAM
In this exam you may use only one 8.5x11 formula page, and a pen or a pencil (no
computers or calculators). Please sign a pledge that you have not violated
Anonymous functions allow us to create simple functions without using Mfile. The format is Fhandle=@(arglist) expression For example, assume that you need to calculate the derivative of arcsin(x) for different values of x and you do not remember the analy
1/14/09
The most basic operator for making decisions is the if statement. We will use it to implement the bisection method of Section 5.4. In this method we start with a function that is positive at x=xl and negative at x=xu (or vice versa) and we evalua
1/12/09
Script files. In the process of zooming on the solution we have repeatedly used certain lines. We might as well put them into a file using the Matlab editor. So I save the following lines
y=cos(x) plot(x,y) grid xlabel('x') ylabel('cos(x)')
In
Problem 9.3
1.1x1+10x2=120 2x1+17.4x2=174 (a) Solve it graphically. To solve graphically we express x2 in terms of x1 for both equations, plot the two lines and see where they intersect. x2=@(x1) (120+1.1*x1)/10 x2 = @(x1) (120+1.1*x1)/10 And for the se
2608
Name:
EGM 3344 Introduction to Numerical Methods of Engineering Analysis
FIRST INTERM EXAM
In this exam you may use only one 8.5x11 formula page, and a pen or a pencil (no
computers or calculators). Please sign a pledge that you have not violated
Fixedpoint iteration:
The principle of fixed point iteration is that we convert the problem of finding root for f(x)=0 to an iterative method by manipulating the equation so that we can rewrite it as x=g(x). Then we use the iterative procedure xi+1=g(xi)
GaussSeidel method ( Philipp Ludwig von Seidel [zah'edl] (23 October 1821, Zweibrcken, Germany 13 August 1896, Munich) Fixed point iteration for solving linear equation, where the terms in the diagonal are left side and the rest are moved to the right sid
We often needs to fit a straight line to data in order to get a physical constant. An example is when we fit stress and strain data in order to get Young's modulus. Consider, for example, testing of aluminum. Assume that the modulus is E=10 million psi. S
The norm of a vector is a generalization of the concept of its length. The default norm is the Euclidean norm which corresponds to our notion of length > a=[3 4]; > norm(a) ans = 5 However, instead of the square root of the sum of the squares, it is possi
Let the number of components be denoted as c1, c2 and c3. Then we can get an approximate solution by solving.
15c1 + 17c2 + 19c3 = 3890 0.3c1 + 0.4c2 + 0.55c3 = 95 c1 + 1.2c2 + 1.5c3 = 282
With Matlab a=[15 17 19; 0.3 0.4 0.55; 1.0 1.2 1.5]; > b=[389
Problem 33 in the textbook asks us to find the shortest ladder that will reach the wall given the obstacle in between. We denote the horizontal distance of the foot of the ladder as x, and the height at the wall as y, and then the length that we want to
We can fit the stress strain data with a quadratic polynomial instead of a linear one. Let us compare the two. Here is the data again > strain=[0:1:5] strain = 0 1 2 3 4 5 > stress=[0:10:50] stress = 0 10 20 30 40 50 > randn('state',0) > error_m=randn(1,6
PROGRAMMING TIPS AND .M FILES EGM 4344 Programming Tips Key concepts: Divide and conquer Be organized Modularity/Portability Break complicated tasks into more manageable chunks performed in separate functions. Benefits Simplifies the development and under
The golden search method is good when you are far away from the solution, and when you have the solution bounded. In other cases, parabolic interpolation is preferable, provided that you do not allow it to take you too far away. Consider for example findi
With the NewtonRaphson Method we had
xi +1 = xi 
f ( xi ) f '( xi )
If we do not have an explicit expression for the derivative, we can approximate it using the last two iterates as
xi +1 = xi  f ( xi )( xi1  xi ) f ( xi1 )  f ( xi )
Consider pr
Introduction to Numerical Methods of Engineering Analysis
EGM 3344

Spring 2014
Ross Perry
50910645
Problem 4.4
Matlab script
function ep = macheps
0etermines the machine epsilon
e = 1;
while (1)
if e+1<=1, break, end
e = e/2;
end
ep = 2*e
> macheps
ep =
2.2204e16
ans =
2.2204e16
Ross Perry
50910645
Problem 4.5
Matlab Script
t =