6) You are stranded on a desert island and your only chance at escape depends on...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
6) You are stranded on a desert island and your only chance at escape depends on an accurate calculation of a navigation heading using the inverse sine function (sin or arcsin). Fortunately you have a small computer with a C compiler along with you, but unfortunately it has only about 30 minutes of battery charge left. Fortunately it has math library routines for the sin and cosine functions, but unfortunately its limited operating system has no library function for the inverse sine. Fortunately you have taken Physics 3340, and you can remember the simple iteration formula of the rapidly converging Newton-Raphson algorithm, but unfortunately you don't have access to the roots.c class library code. However, with a little C coding, in a few minutes you have the answer. a) Write a function of x such that when the root of this function is found, x will be equal to sin(0.75) in radians. (Assume x is an angle in the first quadrant.): b) Write a simple C program for finding the root of this function with an initial guess of x=1 and a fixed five iterations of the Newton-Raphson algorithm. (The only math function calls your code may issue are to sin ( ) and cos() functions, and you may not call any class library code such as roots.c.) The program should output the current guess for x and the corresponding function value in each iteration. After its five iterations, your program should also call the function sin(x) and print out the result, as a verification of your solution. 6) You are stranded on a desert island and your only chance at escape depends on an accurate calculation of a navigation heading using the inverse sine function (sin or arcsin). Fortunately you have a small computer with a C compiler along with you, but unfortunately it has only about 30 minutes of battery charge left. Fortunately it has math library routines for the sin and cosine functions, but unfortunately its limited operating system has no library function for the inverse sine. Fortunately you have taken Physics 3340, and you can remember the simple iteration formula of the rapidly converging Newton-Raphson algorithm, but unfortunately you don't have access to the roots.c class library code. However, with a little C coding, in a few minutes you have the answer. a) Write a function of x such that when the root of this function is found, x will be equal to sin(0.75) in radians. (Assume x is an angle in the first quadrant.): b) Write a simple C program for finding the root of this function with an initial guess of x=1 and a fixed five iterations of the Newton-Raphson algorithm. (The only math function calls your code may issue are to sin ( ) and cos() functions, and you may not call any class library code such as roots.c.) The program should output the current guess for x and the corresponding function value in each iteration. After its five iterations, your program should also call the function sin(x) and print out the result, as a verification of your solution.
Expert Answer:
Related Book For
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...
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
Refer to the Webers Data Set above. 1. Compute the direct materials efficiency variance for onion, mustard, and ketchup. 2. As a manager, what would you learn from the variances and supporting data?...
-
A variable capacitor with negligible resistance is connected to an ac voltage source. How does the current in the circuit change if the capacitance is increased by a factor of 3.0 and the driving...
-
(a) Find the functions domain, (b) Find the functions range, (c) Describe the functions level curves, (d) Find the boundary of the functions domain, (e) Determine if the domain is an open region, a...
-
In July 2008, Brian, Dale, and Sandra Allen signed a contract with East Resources, Inc., concerning 148 acres of the Allens property. East wanted to develop and exploit the oil and gas resources...
-
Accounting Changes Depreciation Robillard Inc. acquired the following assets in January of 2007. Equipment estimated service life, 5 years; salvage value , $15,000 $465,000 Building, estimated...
-
Consider the two classes represented in the following UML diagram. Implement the two classes as explained below. YouTube Channel -owner: String -nbOfVideos: int -videos: Video[] +YouTubeChannel...
-
If JTM's WACC is 7.0%, should it accept the financing offer? Why yeas or No? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 A 30 31 32 B E JTM is considering...
-
First, would it be fair to say that from the viewpoint of tech companies and their retails, consumers exist to buy and use their products? Secondly, when we talk of "progress" and "advancement," I...
-
Sam puts an ad in the newspaper stating that she wants to sell her alpaca for $500. Angela goes to Sam's home and tells her that she is interested in buying the alpaca. After petting it and...
-
Find the support reactions and draw the shear and moment diagrams for the beam. Take P= 37.5 kN, q= 3.75 kN/m and M= 10.7 kN.m. Find the maximum moment and its location. -2 m. P M -1m-1 m -1m- q -2...
-
You are offered an investment that will pay you $ 1 6 0 8 per month for next 9 years. Assuming you want to earn an 8 . 1 9 % rate of return, what is this investment worth today?
-
PQR Toys Limited (a hypothetical company) is a prominent name in the toy industry and has been the market leader in its segment in the North American region and the Southeast Asian region. The...
-
Do an assessment of the organizations current marketing activities Definition/Description of overall project: Marketers recognize the power of word-of-mouth advertising. People naturally trust the...
-
Write the given system without the use of matrices. D) - ()- d (x sin t + 8 (2+ 1)
-
Classic LEGO plastic bricks have been fixtures in homes around the world for more than 70 years. Just 15 years ago, The LEGO Group (TLG) was near bankruptcy, spiraling downward and losing money at a...
-
For a sample of data where n = 7 given below: a. Calculate the mean, median, and mode. b. Calculate the range, variance, standard deviation, and coefficient of variation. c. Calculate the Z score....
-
For a sample of data where n = 6 given below: a. Calculate the mean, median, and mode. b. Calculate the range, variance, standard deviation, and coefficient of variation. c. Calculate the Z scores....
Study smarter with the SolutionInn App