solution

We are interested in the volume V of a cube with length L: V D L3, computed for
three different values of L.
a) Use the linspace function to compute three values of L, equally spaced on the
interval Œ1; 3Ł.
b) Carry out by hand the computation V D L3 if L is an array with three elements.
That is, compute V for each value of L.
c) In a program, write out the result V of V = L**3 when L is an array with three
elements as computed by linspace in a). Compare the resulting volumes with
your hand calculations.
d) Make a plot of V versus L. Filename: volume3cubes.py.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
Looking for a Similar Assignment? Our Experts can help. Use the coupon code SAVE30 to get your first order at 30% off!