Docsity

Homework Assignment #2 - Computing Techniques | ME 2016, Assignments of Computer Science

Toggle sidebar
bg1
ME2016, Fall 2008, Dr. Ferri
Homework Assignment 2
Due Wednesday, September 3, 2008
Problem 1. (3 points)
Consider a computer that uses 8 bits to represent floating-point numbers. Rather than using the text
convention, it uses a scheme similar to the IEEE standard. Specifically, it stores numbers using the
convention:
(
)
(1)(1. )2
s
cb
xf
−
=−
where s is the sign bit, f is the fraction, c is the characteristic, and b is the bias. The 8-bits are allocated
as follows: the first bit is the sign bit, the next 4 bits relate to the characteristic, and the last 3 give the
fraction. In accordance with the IEEE standard, it will be assumed that 2
(1 1 1 1)c
=
corresponds to
infinity and that 2
(0000)c= corresponds to zero.
(a) What value of bias should we use?
(b) What is the smallest positive number that can be represented on this machine?
(c) What is machine-epsilon for this machine?
Problem 2. (4 points)
Consider the function () ln()
f
xx=.
(a) Derive a 4-term Taylor series expansion for f(x) about the point x = 1.
(b) Derive an expression for the remainder term, 4
R
.
(c) Estimate the derivative of f(x) at x = 1 using the first forward difference and h = 0.5. Give the true
relative percent error of this answer, t
ε
(d) Resolve part (c) using h = 0.25. Give the new value of t
ε
(e) Re-do parts (c) and (d) using the centered difference approx. for the derivative of f(x) at x = 1.
Problem 3. (3 points)
A car travels around a circle of radius r = 50m. As a function of the arclength along the circle, s, the
speed of the vehicle varies according to the relation: 2
0.5 0.0025vs s=− , where s is in meters. It can
be shown that the tangential component of the acceleration is given by tdv
av
ds
= and the normal
component of the acceleration is given by 2/
n
avr=. Due to the friction coefficient of the tires, the
car will slip when the total acceleration exceeds 0.6g, or 5.89 m/s2. Thus, slip occurs when
22 2
5.89
tn
aa+≥ .
(a) Use a graphical approach to estimate the value of s at which slip occurs.
(b) Perform 5 iterations of the bisection approach to estimate the true value of s. Start with an interval
from s = 0 to s = 50m. Show your steps

Partial preview of the text

Download Homework Assignment #2 - Computing Techniques | ME 2016 and more Assignments Computer Science in PDF only on Docsity!

ME2016, Fall 2008, Dr. Ferri Homework Assignment 2 Due Wednesday, September 3, 2008

Problem 1. (3 points) Consider a computer that uses 8 bits to represent floating-point numbers. Rather than using the text convention, it uses a scheme similar to the IEEE standard. Specifically, it stores numbers using the convention:

x = − s^ f c b −

where s is the sign bit, f is the fraction, c is the characteristic, and b is the bias. The 8-bits are allocated as follows: the first bit is the sign bit, the next 4 bits relate to the characteristic, and the last 3 give the fraction. In accordance with the IEEE standard, it will be assumed that c = (1 1 1 1) 2 corresponds to

infinity and that c = (0 0 0 0) 2 corresponds to zero.

(a) What value of bias should we use? (b) What is the smallest positive number that can be represented on this machine? (c) What is machine-epsilon for this machine?

Problem 2. (4 points) Consider the function f ( ) x = ln( ) x.

(a) Derive a 4-term Taylor series expansion for f(x) about the point x = 1. (b) Derive an expression for the remainder term, R 4.

(c) Estimate the derivative of f(x) at x = 1 using the first forward difference and h = 0.5. Give the true

relative percent error of this answer, ε t

(d) Resolve part (c) using h = 0.25. Give the new value of ε t

(e) Re-do parts (c) and (d) using the centered difference approx. for the derivative of f(x) at x = 1.

Problem 3. (3 points) A car travels around a circle of radius r = 50m. As a function of the arclength along the circle, s , the

speed of the vehicle varies according to the relation: v = 0.5 s − 0.0025 s^2 , where s is in meters. It can

be shown that the tangential component of the acceleration is given by (^) t

dv a v ds

= and the normal

component of the acceleration is given by an = v^2 / r. Due to the friction coefficient of the tires, the

car will slip when the total acceleration exceeds 0.6g, or 5.89 m/s^2. Thus, slip occurs when

(^2 2) 5.89 2 at + an ≥.

(a) Use a graphical approach to estimate the value of s at which slip occurs. (b) Perform 5 iterations of the bisection approach to estimate the true value of s. Start with an interval from s = 0 to s = 50m. Show your steps