This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

)

Assignment #1

Instructor: Dr. Tanvir Ahmed

Q1. Manning’s equation can be used to compute the velocity of water in a rectangular

open channel

3 / 2

2

⎟

⎠

⎞

⎜

⎝

⎛

+

=

H B

BH

n

S

U

Where U = velocity (m/s), S = channel slope, n = roughness coefficient, B = width (m)

and H = depth(m). The following is available for five channels:

n S B H

0.035 0.0001 10 2

0.020 0.0002 8 1

0.015 0.0010 20 1.5

0.030 0.0007 24 3

0.022 0.0003 15 2.5

Store these values in a single matrix where each row represents one of the channels and

each column represents one of the parameters. Write a single-line MATLAB statement

to compute a column vector containing the velocities bases on the values in the

parameter matrix.

Q2. The Maclaurin series expansion for the cosine is

........

! 8 ! 6 ! 4 2

1 cos

8 6 4 2

− + − + − =

x x x x

x

Use MATLAB to create a plot of the cosine (solid line) along with a plot of the series

expansion (dashed line) up to and including the term x

6

/6!. Use the built-in function

factorial in computing the series expansion. Make the range of the abscissa from x = 0 to

3π/2.

Q3. It is general practice in engineering and science that equations be plotted as lines

and discrete data as symbols. Here is some data for concentration (c) versus time (t) for

the photodegradation of aqueous bromine:

t (min) 10 20 30 40 50 60

c (ppm) 3.4 2.6 1.6 1.3 1.0 0.5

The data can be described by the following function:

t

e c

034 . 0

84 . 4

−

=

(a) Use MATLAB to create a plot displaying both the data (using square symbols) and

function (using dashed line). Plot the function for t = 0 to 70 min

(b) Use the semilogy function to plot the data and function as described in part (a).

State the nature of change in the curve from part (a) to (b) and try to explain why this

happened.

Q4. Modify plotSin function shown in class to to do the following:

- If only one input is given (f1), it only evaluates z = stn(¡

1

x) while if two inputs

are given (f1 and f2), it evaluates z = stn(¡

1

x) +¢us (¡

2

y)

The limits of both x and y are from 0 to 2π

- In the top axis of your subplot, display an image of the Z matrix. Display the

colorbar and use a hot colormap. Set the axis to xy (use these commands to

perform the tasks: imagesc, colormap, colorbar, axis)

- In the bottom axis of the subplot, plot the 3-D surface of z (use the surf

command)

[Look at the MATLAB help file for the reference of any commands not discussed

in class]

Finally execute your command for a two-input case (e.g. say, plotSin(5,4)) and

generate the plots.

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd