2. Complete the following questions related to Bracket methods: (a) Write a function to perform the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Complete the following questions related to Bracket methods: (a) Write a function to perform the Bisection method for any scalar nonlinear equation f(x) = 0. The inputs to your function should be: a function that calculates the nonlinear equation, the endpoints of the bracketing region, a convergence tolerance and a maximum number of iterations. The function should output the approximate root and the number of iterations. Your function should include an error check to make sure that the bracketing region is valid (a root exists). As an error measure, use both a which is related to the length of the bracketing region and ef which is related to the value of f(r). Both are defined in the problem above. Thoroughly comment your code to show you know what you are doing. (b) Write a function to perform the False Position method for any scalar nonlinear equation f(x) = 0. The instructions for this function are the same as for the Bisection method (see above). (e) Use both of your developed functions in (a) and (b) to complete the following problem: The upward velocity of a rocket can be computed by mo mo-qt, v = u In gt where v upward velocity, u = the velocity at which fuel is expelled relative to the rocket, mo = the initial mass of the rocket at time t = 0, q = the fuel consumption rate, and the downward gravitational acceleration g = 9.81 [m/s²]. If u = 1800 [m/s], mo = 160000 [kg], and q = 2600 [kg/s], compute the time at which v= 750 [m/s]. Note: t is somewhere between 10 and 50 [s]. Use a convergence tolerance of 1 x 10-5. In addition, calculate the value of f(x) at the root to show that it is indeed a root of the problem. 2. Complete the following questions related to Bracket methods: (a) Write a function to perform the Bisection method for any scalar nonlinear equation f(x) = 0. The inputs to your function should be: a function that calculates the nonlinear equation, the endpoints of the bracketing region, a convergence tolerance and a maximum number of iterations. The function should output the approximate root and the number of iterations. Your function should include an error check to make sure that the bracketing region is valid (a root exists). As an error measure, use both a which is related to the length of the bracketing region and ef which is related to the value of f(r). Both are defined in the problem above. Thoroughly comment your code to show you know what you are doing. (b) Write a function to perform the False Position method for any scalar nonlinear equation f(x) = 0. The instructions for this function are the same as for the Bisection method (see above). (e) Use both of your developed functions in (a) and (b) to complete the following problem: The upward velocity of a rocket can be computed by mo mo-qt, v = u In gt where v upward velocity, u = the velocity at which fuel is expelled relative to the rocket, mo = the initial mass of the rocket at time t = 0, q = the fuel consumption rate, and the downward gravitational acceleration g = 9.81 [m/s²]. If u = 1800 [m/s], mo = 160000 [kg], and q = 2600 [kg/s], compute the time at which v= 750 [m/s]. Note: t is somewhere between 10 and 50 [s]. Use a convergence tolerance of 1 x 10-5. In addition, calculate the value of f(x) at the root to show that it is indeed a root of the problem.
Expert Answer:
Answer rating: 100% (QA)
a Heres a Python function to perform the Bisection method def bisectionf a b tol1e5 maxiter100 Perform the Bisection method to find the root of fx 0 i... View the full 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
-
A used car dealer advertises financing at 0% interest for 3 years with monthly payments. You must pay a $500 processing fee at signing. The car you like costs $9000. a) What is your effective annual...
-
Let a, b, c, x R. Compute et a,b,c,x e R. Compate. la la+x x x x2
-
How does feedback value relate to predictive ability and accountability?
-
A car is traveling at night along a highway shaped like a parabola with its vertex at the origin (see the figure). The car starts at a point 100 m west and 100 m north of the origin and travels in an...
-
Three solar batteries are installed in each DPC communications satellite placed in orbit. Testing indicates that each of the batteries is 75% likely to remain in good working order for at least 10...
-
The plaintiffs, Lee and Yoon, were the parents of H.L., a South Korean citizen who attended high school in Idaho as part of an exchange program. With permission from both plaintiffs and his host...
-
Wayne Hills Hospital in tiny Wayne, Nebraska, faces a problem common to large, urban hospitals as well as to small, remote ones like itself. That problem is deciding how much of each type of whole...
-
how do i create a database connection in java programming?
-
Clampett Oil purchases crude oil products from suppliers in Texas (TX), Oklahoma (OK), Pennsylvania (PA), and Alabama (AL), from which it refines four end-products: gasoline, kerosene, heating oil,...
-
The demands for next four months are given by r 1 = 2 0 , r 2 = 5 0 , r 3 = 1 0 , r 4 = 5 0 . The set up cost is Rs . 1 0 0 per set up . The production cost is Rs . 1 0 per unit and the...
-
A payday loan is structured to obscure the true interest rate you are paying. For example, in Washington, you pay a $33 fee for a two-week $200 payday loan (when you repay the loan, you pay $233)....
-
Define autocorrelation. Why is it more likely to occur with the use of time series data than with cross-sectional data?
-
Explain in one or two sentences the differences between the following terms: a. Type I and Type II errors b. Run chart and histogram c. Flowchart and fishbone diagram d. XY plot and Pareto chart
-
Which of the following conditions would you use if you needed to develop an industrial process to produce ethanol from acetylene? Explain. (a) 25C and 1 bar. (b) 250C and 1 bar. (c) 25C and 150 bar....
-
Explain the difference between an opportunity and an idea.
-
The probability distribution for the number of automobiles lined up at a Lakeside Olds dealer at opening time (7:3O AM) for service is Number Probability 1 0.25 0.30 3 0.25 4 0.20 On a typical day,...
-
How is use of the word consistent helpful in fraud reports?
-
Solve the following problem (a) Using Cramers rule (b) Using Gauss elimination with partial pivoting (c) Using LU decomposition. [2][3]-[2] y 12
-
Compute the determinant of the following matrix by co-factor expansion: A = 2 1 -5 2 8 3 -4 2 11 2 11 -3 = 1 2 -1 2
-
Analyze the phase plane trajectories for the system dx == x - y - x(x + y) dt dy dt = x + y y(x + y) (5.4.12) (5.4.13)
-
In the absence of limits on the behavior of large intermediaries, how might the perception of institutions being too-big-to-fail lead to increased concentration in the banking industry?
-
One goal of the regulatory reforms that followed the 2007-2009 financial crisis was to address the too-big-to-fail problem associated with large institutions. How did the reforms try to address this...
-
Analyze how a government regulates and supervises the financial system to contain risk.
Study smarter with the SolutionInn App