Develop a program using a programming or macro language to implement the parabolic interpolation algorithm. Design the program so that it is expressly designed to locate a maximum and selects new points as in Example 13.2. The subroutine should have the following features:
• Base it on two initial guesses, and have the program generate the third initial value at the midpoint of the interval.
• Check whether the guesses bracket a maximum. If not, the subroutine should not implement the algorithm, but should return an error message.
• Iterate until the relative error falls below a stopping criterion or exceeds a maximum number of iterations.
• Return both the optimal x and
• Minimize the number of function evaluations.
Test your program with the same problem as Example 13.2.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Numerical Methods For Engineers, 7 Ed
- Please help, this for Matlab the image is the first question with following 2 and 3 they go together. 2. Solving the question by using bisection.m with the stopping criterion at 1%. Report the root and # of iterations. 3. by using newton-Raphson matlab script with the stopping criterion at 0.1%. Report the root and # of iterations.arrow_forwardDon't Use Chat GPT Will Upvote And Give Solution In 30 Minutes Pleasearrow_forwardSolve all points, ASAParrow_forward
- Question 4 List the steps in details to draw the shape below using AutoCAD commands 190 220 50 -90 - 50 114 81 R80 450 122 -R125 68 65 290 50 290 630arrow_forwardGIVEN: L1=20 N GIVEN: a= 4m GIVEN: L2= 20 N GIVEN: b= 5m GIVEN: L3=20 N GIVEN: c= 6m GIVEN: L4= 0 N GIVEB: e= 3m GIVEN: L5= 10 N ANSWER: (a) Ax in N (b) Ay in N (c) Ex in N (d) Ey in N PLS SOLVE IN A COMPLETE SOLUTION AND WRITE LEGIBLY AND ALSO DRAW THE FREE BODY DIAGRAMarrow_forwardWrite commands to evaluate the following three mathematical expressions and assign the results to the indicated variable names. 23.2 – 7.1 ÷ 2.2 X = (5.1 – 3.7) × (3.4 + 4.2) Assign the result for x to the variable Answer1. 35.7 x 64.1 – 6.03 y = 43 + 52 Assign the result for y to the variable Answer2. z = (2.1 + 8.0)-1/3 Assign the result for z to the variable Answer3. Be sure to use a MATLAB command to evaluate each mathematical expression rather than just entering the result calculated elsewhere (e.g. a local MATLAB session or on your calculator).arrow_forward
- Please help solve the question shown. I attempted this problem over five times and it keeps saying my answers are wrong. I typed 11.1hr, 1.11hr, 8.67hr, 6.9384hr, and 7.1152hr but it keeps saying that those are all incorrect. Can you please show how to get the correct answer so I can understand how to solve it? Thank you!arrow_forward8. What are the main stages of the FEM? 9. Make a sketch of a linear triangular finite element. Point the nodes and write the approximating polynomial. 10. Describe with one sentence what the shape functions in FEM are. 11. Special case of which method is the method of Galerkin? 12. What are the three main parts of a FEM program? 13. How can be increased the accuracy of the derivatives for linear finite elements in FEM postprocessor? 14. Specify three methods for force computation in FEM postprocessor.arrow_forwardDevelop three mass balance equations for each tank in Figure 1. Solve to determine the concentrations in each tank. Use 'np.linalg.solve' to solve the system of equations you generate. Assume the tanks are at steady-state (i.e. concentration within each tank is not changing with time) and well-mixed (i.e. the concentration flowing out of the tank is equal to the concentration within the tank). Mass can be tracked by multiplying flow rate, Q (L/s) by concentration, c (mg/L) to give mg/s. Hint: for each tank the mass coming in mg/s must equal the mass going out mg/s, set this up like our two reactor example from lecture 6. Note: Volume balances must hold in addition to mass balances. In other words, the Q entering the tank must equal the Q leaving the tank. You can use this principle to find any values for Q that are missing in the figure. 500 mg/s 221c2 21291 Q13c1 2 02392 Q33c3 500 mg/s 33 = 120 13 = 40 212 = 90 23 = 60 21 = 30arrow_forward
- Only use autocad please and show every step to create it and i will definitely like the answer. Thanks, steps are mandatory plsarrow_forwardPlease don't provide handwritten solution ......arrow_forward2. Write a MATLAB script that computes the following sum while requesting the value of x and n from the user.arrow_forward
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY