Write a Matlab function to compute f(x) = 1 - cos(x) for inputs in the range...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a Matlab function to compute f(x) = 1 - cos(x) for inputs in the range -1 <x< 1 with fractional error under 100. Check your function by verifying that, to 14 significant digits, it returns f(10-4 ) = 4.9999999958333 × 10-9 and f(0.9) = 0.37839003172934. Hint: Subtracting 1 - cos(x) directly incurs subtractive cancellation when x is close to 0, but for such values of x, the truncation error from using the first few terms of the Taylor series of cos(x) with a = 0 and cancelling out the 1 analytically is very small. Write a Matlab function to compute f(x) = 1 - cos(x) for inputs in the range -1 <x< 1 with fractional error under 100. Check your function by verifying that, to 14 significant digits, it returns f(10-4 ) = 4.9999999958333 × 10-9 and f(0.9) = 0.37839003172934. Hint: Subtracting 1 - cos(x) directly incurs subtractive cancellation when x is close to 0, but for such values of x, the truncation error from using the first few terms of the Taylor series of cos(x) with a = 0 and cancelling out the 1 analytically is very small.
Expert Answer:
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
rn rn Anushka (an Australian Tax resident) works as an employee for a child care centre, Brilliant Kids Pty Ltd, on a permanent part-time basis while she runs her business as a day carer for her own...
-
Which securities must be registered under the 1933 Act? Which must be registered under the 1934 Act? Explain.
-
Suppose that the differentiable function y = g(x) has an inverse and that the graph of g passes through the origin with slope 2. Find the slope of the graph of g -1 at the origin.
-
Define the following: a. Asset b. Liability c. Net asset
-
Compensated Absences Mathewson Company began operations on January 2, 2010. It employs 9 individuals who work 8-hour days and are paid hourly. Each employee earns 10 paid vacation days and 6 paid...
-
Assume that Twigs has hired you as a database consultant to develop it's operational database having the three tables described at the end of Chapter 6. Assume that Twigs personnel are the owner, an...
-
The September bank statement and cash T-account for Terrick Company follow: There were no deposits in transit or outstanding checks at August 31. Required: 1. Identify and list the deposits in...
-
You are drinking water through a straw of length 16cm and diameter 4mm at a flow rate of 1mL/s. You can assume density of water =999Kg/m, dynamic viscosity of water = 0.001Pas and acceleration due to...
-
Assignment Overview You are the database administrator for a small airline. You have the task of handling bookings for the airline's planes, both commercially and industrially. You will have to build...
-
Elaborate on the "Sophisticated Equity Method: Intercompany Transactions". How does this method address intercompany transactions, and what unique considerations are involved?
-
write below code (JAVA) I'm trying to make a program which is a Togo/Deriver order 1) " Choose A pickup/ B Delivery", I'd like to put If-else ( If user choose A, go to order, if choose B, take input...
-
In your personal portfolio account, not a qualified 401K retirement account, you get paid a dividend and it automatically gets reinvested, (meaning you buy more of this stock or fund), but it never...
-
How would you describe an investor who has only invested in equities, with five of their top ten holdings in blue chip companies and they are tech focused.
-
P.s: please besides the code, also include a screenshot of code, and the output to confirm code doesn't get edited out and the output satisfies the problem!! SodaCanTester.java /** A class to...
-
The liquidliquid extractor in Figure 8.1 operates at 100F and a nominal pressure of 15 psia. For the feed and solvent flows shown, determine the number of equilibrium stages to extract 99.5% of the...
-
Simplify Eq. (8.2.32) for evenly spaced data. f[x2, x1, xo]: = [f(x) - f(x) X2 - X1 2]: f(x)-f(xo) X1 - XO 1 X2 - XO (8.2.32)
-
The overall goal of this problem is to compute the PV and PT equilibrium diagramsfor a single component fluid described by the van derWaals equation of state. Let us recall the key things we need to...
-
In this problem, you are going to look at how the accuracy of the solution of an ODE depends on the time step. Consider the integration of the differential equation over the domain x [0, 1] with the...
-
A phenotypically abnormal individual has a phenotypically normal father with an inversion on one copy of chromosome 7 and a phenotypically normal mother without any changes in chromosome structure....
-
Explain how polytene chromosomes of Drosophila are produced, and describe the six-armed structure they form.
-
Male honeybees, which are haploid, produce sperm by meiosis. Explain what unusual event (compared with other animals) must occur during spermatogenesis in honeybees to produce sperm. Does this...
Study smarter with the SolutionInn App