function that applies the secant method to iteratively approximate the nth root of a constant given n, the constant, and two initial guesses--x0 and x1.
What will be an ideal response?
```
double secant( double c, double n, double x0, double x1 )
{
int i;
double tmp, tmpn, tmpd;
for( i = 2; (x0-x1) > TOLERANCE && i <= MAX_ITERATIONS; i++)
{
tmpn = ( x0 * ( pow(x1, n) - c ) - x1 * ( pow(x0, n) - c ) );
tmpd = ( (pow(x1 ,n) - c) - (pow(x0, n) - c) );
tmp = tmpn / tmpd;
x0 = x1;
x1 = tmp;
}
//if no convergence after MAX_ITERATIONS iterations,
//display error message and return 0
if( x0 - x1 > TOLERANCE)
{
cerr << "Error in function 'secant'...no convergence" << endl;
return 0;
}
return x1;
}
```
You might also like to view...
This problem illustrates utilization of GFT in sensor malfunction detection. You will first create anomalous data and then validate the anomaly in the data by utilizing GFT. Using GSPBox (see Appendix G for additional information on GSPBox), create a 50-node random sensor network and define a signal f on the graph as
where c is a constant and d (i, j) is the distance between nodes i and j (can be found using
Dijkstra’s shortest path algorithm). This signal can be thought of as temperature values in
a geographical area, since the variations in temperature values are not high if the sensors are
placed densely.
(a) Plot the graph signal and its spectrum for c = 0.1. Now assume that sensors 31 and 42
are anomalous and show temperature values of zero.
(b) Plot the spectrum of this anomalous data. Can we conclude that the data generated by
the sensor network is anomalous?
(c) Can we find the location of anomalous sensors using GFT? Explain why or why not.
The Zoom control is displayed within the _____.
A. Quick Access toolbar B. status bar C. title bar D. ribbon
The ________ suggests functions that match the initial characters being entered by a user
A) AutoSum arrow B) Formula AutoComplete C) Formula Preview D) Formula AutoFill
Compacting a database rearranges the data and objects in a database to decrease its file size. _________________________
Answer the following statement true (T) or false (F)