Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB As an engineer, you are asked to calculate the approximate surface area of a lake in your local community. To do that, you decide

MATLAB

As an engineer, you are asked to calculate the approximate surface area of a lake in your local community. To do that, you decide to use a GPS to measure the x and y coordinates at various points around the lake. You pick a starting point and calibrate your GPS position at that point to be (0,0). You begin to walk around the lake collecting the following data below and eventually return to your starting position.

Upon looking at the plot above, you realise that the best way to calculate the area of the lake is to split the data into two sets, fitting a polynomial to each data set and the integrating the polynomials to approximate the area of the lake. I.e. Calculate the area above the red line and add it to the area below the red line. However, to do this, you need to determine where the polynomial crosses the red line (i.e. the root of the function) so that the limits of the integral are known.

Write an m-file which does the following:

  1. Creates 2 sets of data for x [0 14] and x [14 0] with their corresponding y values. Fit 4th order

    polynomials to each set of data and output the equation for each fit using fprintf.

  2. Use the polynomial fit form part A to calculate the root of the polynomial that crosses zero. You

    may use the fzero function.

  3. Apply the Simpsons 1/3rd rule using 21 points on the polynomial above the red line.

  4. Apply the Simpsons 1/3rd rule using 21 points on the polynomial below the red line. You will need

    to use your result from part B here.

  5. Calculate the area of a single trapezoid found above the red line between the root crossing and

    x=14. This represents the excess area that needs to be subtracted.

  6. Calculate the approximate area of the lake.

image text in transcribed

x 0 246 8 101214 12 10 86 420 y03 5 88.57.14.9 1.7-2.6-3.8 -6.1 -5.9 -5.2-4.10 outline of lake 10 4 -6 -9 10 12 14

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

denigration of emotional outbursts; being reserved;

Answered: 1 week ago