Question: Write a VBA Program to apply the Secant rule. Program should include: 1. Main Sub: initialize, call Subordinate Sub 2. Subordinate Sub: NR iteration loop,
3. Given f(x)-e log10 (sin(x))-3.14 0, x in radians Write a VBA program to apply the secant rule (Xy+1-Xy-f(%)*(xn-Xn-1)(f(xn)-f(xn-1)) to find a root of this equation. You may hard-wire the starting value, x0-1.5 and x1 = 2.0, the maximum number of iterations = 150, and the tolerance on the approximate relative error 1x107. For each iteration output to your spreadsheet the iteration number, the current value of x, f(x), and the approximate relative error, EA. Specify parameters and integration limits in your main sub. Perform the Secant Rule calculations in a subordinate sub. Use a Do While loop to handle the iterations and output from the called sub. Put f(x) in a function. Use an Excel library function for log10(x) and use Option Explicit. Your program should include the following: Main sub: initialize, call subordinate sub Subordinate sub: NR iteration loop, output Function: f(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
