FIND A SOLUTION AT Academic Writers Bay
(h) Nonuniform grids are handy in applications where a finely-spaced grid is needed to resolve some local detail, but is not required (and therefore computationally wasteful) elsewhere. Here is a simple example. Write a script that: • Samples and plots the function tanh(2x) using 40 equispaced grid points in the interval —5 < x < 5. Use symbols for the plot, so that you can see the sample points. • Samples and plots the same function tanh(2x) using 40 nonequispaced grid points determined by first creating a vector of 40 equispaced points in the interval —1 < C < 1, then transforming them according to x = 5 + cge(e — 1) for a = 0.8. Use symbols for the plot, so that you can see the sample points. • Uses diff1 to estimate the derivative of the function tanh(2x) for the equispaced and nonequispaced cases above, then plots the absolute error against x for each case on a single plot.
- Assignment status: Already Solved By Our Experts
- (USA, AUS, UK & CA PhD. Writers)
- CLICK HERE TO GET A PROFESSIONAL WRITER TO WORK ON THIS PAPER AND OTHER SIMILAR PAPERS, GET A NON PLAGIARIZED PAPER FROM OUR EXPERTS
QUALITY: 100% ORIGINAL PAPER – NO PLAGIARISM – CUSTOM PAPER