Question

In: Computer Science

in Java, write a program for methods (Secant, False-Position and Modified Secant) for locating roots. Make...

in Java, write a program for methods (Secant, False-Position and Modified Secant) for locating roots. Make sure that you have clever checks in your program to be warned and stop if you have a divergent solution or stop if the solution is very slowly convergent after a maximum number of iterations.

(a) f(x) = 2x3 – 11.7x2 + 17.7x – 5 This function has 3 +ve roots, all of which lie between 0 and 4. Find the roots. Implement the methods until ea < 1%. Let the maximum iterations be 100. For the modified secant method, use δ = 0.01. Plot the graphs for the approximate % relative error for different roots. Each graph should have 5 error curves, one for each method.

(b) f(x) = x + 10 – xcosh(50/x) For this function, plot the % approximate relative error for each method similar to the part (a). Use δ = 0.01 for modified secant method. Figure out the initial points for the other methods. As a hint, the root lies in the interval [120, 130]

Solutions

Expert Solution


Related Solutions

Write a C++ program for all the methods (Bisection, Newton-Raphson, Secant, False-Position, and Modified Secant) for...
Write a C++ program for all the methods (Bisection, Newton-Raphson, Secant, False-Position, and Modified Secant) for locating roots. Make sure that you have clever checks in your program to be warned and stop if you have a divergent solution or stop if the solution is very slowly convergent after a maximum number of iterations.
write a program to make scientific calculator in java
Problem StatementWrite a program that uses the java Math library and implement the functionality of a scientific calculator. Your program should have the following components:1. A main menu listing all the functionality of the calculator.2. Your program should use the switch structure to switch between various options of the calculator. Your Program should also have the provision to handle invalidoption selection by the user.3. Your calculator SHOULD HAVE the following functionalities. You can add any other additional features. PLEASE MAKE...
Write the methods that insert and remove an element at the kth position in Java using...
Write the methods that insert and remove an element at the kth position in Java using recursion (NOT iteration) (Hint for the remove method: we have to recursive position -1 times, and each time we do the recursion, we have to create a method to move the head to the right) public void insertRecursive(int position, int data) { //enter code here } public int removeAtRecursive(int position) { //enter code here } Here is the given class for the Node: public...
Please write a java program that has the following methods in it: (preferably in order)   a...
Please write a java program that has the following methods in it: (preferably in order)   a method to read in the name of a University and pass it back a method to read in the number of students enrolled and pass it back a method to calculate the tuition as 20000 times the number of students and pass it back a method print the name of the University, the number of students enrolled, and the total tuition Design Notes: The...
CIT 149 JAVA 1 program question? Write a program that will use static methods as described...
CIT 149 JAVA 1 program question? Write a program that will use static methods as described in the specifications below. Utilizing the if and else statements, write a program which will calculate a commission based on a two-tiered commission plan of 3% and 7% paid on amounts of $15,000 or less, or over $15,000 in monthly sales by a sales force paid on a commission basis. Use the output specifications below. ? Specifications There will be two classes (separate files)...
write program that develop a Java class Dictionary to support the following public methods of an...
write program that develop a Java class Dictionary to support the following public methods of an abstract data type: public class Dictionary { // insert a (key, value) pair into the Dictionary, key value must be unique, the value is associated with the key; only the last value inserted for a key will be kept public void insert(String key, String value); // return the value associated with the key value public String lookup(String key); // delete the (key, value) pair...
Write a program in java that uses methods to input data for calculation, calculate, and display...
Write a program in java that uses methods to input data for calculation, calculate, and display the results of the calculations. That is, there are at least three methods. The problem is to write a program that calculates the area of a rectangle. This action should be repeatable.
MODIFIED TRUE OR FALSE 1.If there are not enough corporate officers, the position of President can...
MODIFIED TRUE OR FALSE 1.If there are not enough corporate officers, the position of President can be merged with that of the operations officer. 2.A person may be both Secretary and Treasurer of a corporation at the same time. 3.In all corporations, a compliance officer and/or an independent director is required. 4.Mr. Graest, a director candidate was alledged to have committed sexual assault and as such is disqualified to be elected as director. 5.Mr. Xylon, a director candidate was accused...
• 1. Write a java program using methods to find the information about a account holder...
• 1. Write a java program using methods to find the information about a account holder at bank. d) Perform the functionalities(Deposit, Withdraw and print) until the user selects to stop.
• 1. Write a java program using methods to find the information about a account holder...
• 1. Write a java program using methods to find the information about a account holder at bank. b) Show different functionalities of a bank account (Deposit, Withdrawal, Print)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT