Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Engineering LibreTexts

7.4: Exercises

( \newcommand{\kernel}{\mathrm{null}\,}\)

Before you go on, you might want to work on the following exercises.

Exercise 7.1
  1. Write a function called cheby6 that evaluates the sixth Chebyshev polynomial. It should take an input variable, x, and return

    32x648x4+18x21

  2. Use ezplot to display a graph of this function in the interval from 1 to 1. Estimate the location of any zeros in this range.
  3. Use fzero to find as many different roots as you can. Does fzero always find the root that is closest to the initial value?
Exercise 7.2

When a duck is floating on water, how much of its body is submerged?1

To estimate a solution to this problem, we’ll assume that the submerged part of a duck is well approximated by a section of a sphere. If a sphere with radius r is submerged in water to a depth d, the volume of the sphere below the water line is

V=π3(3rd2d3)as long asd<2r

We’ll also assume that the density of a duck is ρ=0.3 g/cm3 (0.3 times the density of water) and that its mass is 43πr3ρ g.

Finally, according to the law of buoyancy, an object floats at the level where the weight of the displaced water equals the total weight of the object.

Here are some suggestions for how to proceed:

  1. Write an equation relating ρ, d, and r.
  2. Rearrange the equation so the right-hand side is zero. Our goal is to find values of d that are roots of this equation.
  3. Write a MATLAB function that evaluates this function. Test it, then make it a quiet function.
  4. Make a guess about the value of d0 to use as an initial value.
  5. Use fzero to find a root near d0.
  6. Check to make sure the result makes sense. In particular, check that d<2r, because otherwise the volume equation doesn’t work!
  7. Try different values of ρ and r and see if you get the effect you expect. What happens as ρ increases? Goes to infinity? Goes to zero? What happens as r increases? Goes to infinity? Goes to zero?

1 This exercise is adapted from C. F. Gerald and P. O. Wheatley, Applied Numerical Analysis, 4th edition (Boston: Addison-Wesley, 1989).


This page titled 7.4: Exercises is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?