# Simple Matlab coding and a report for the code

FSH Oct-2017

Engineering Analysis and Numerical Methods: MECH-314-02/04

Fall 2017

Programming Assignment 2

Due:  October 23th, 2017

Problem: Bernoulli’s equation can be considered to be a statement of the conservation of energy

principle appropriate for flowing fluids. It states that for an inviscid flow of a fluid, an increase in

the speed of the fluid occurs simultaneously with a decrease in pressure or a decrease in the

fluid's potential energy. The principle is named after Daniel Bernoulli who published it in his book

Hydrodynamica in 1738.

Bernoulli’s equation for fluid flow in an open channel with a small bump (Fig. 1) is

ܳଶ

2ܾ݃ଶ݄଴

ଶ ൅ ݄௢ ൌ ܳଶ

2ܾ݃ଶ݄ଶ ൅݄൅ܪ

ܳ ሺ݉ଷ⁄ ሻݏ = volume rate of flow

݃ ൌ 9.81 ሺ݉ ݏଶ ⁄ ሻ = gravitational acceleration

ܾ ൌ ሺܻ െ 1826ሻ/90) = width of channel ሺ݉ሻ, where ܻ is your birth year

݄௢ ൌ ሺܯ ൅ 92.5ሻ/110ሻ = upstream depth ሺ݉ሻ, where ܯ is your birth month

ܪ ൌ ሺܦ ൅ 209ሻ/3000ሻ = height of bump ሺ݉ሻ, where ܦ is your birth day

݄ ሺ݉ሻ= depth of water above the bump

Figure 1. Definition sketch

Write a MATLAB program to find ݄ for to five significant figures using the following methods:

Bisection, Modified False Position, Newton Raphson, and Secant.

Request the user to choose the root‐finding method and a value of ܳ between 40 and 60 ft3

/s.

Also, ask whether the user wishes to run the program again.

Have the code plot the function in the vicinity of the root and include the value of the function at

the root.

Explain your algorithm in detail in a short report. Attach a copy of your MATLAB code and sample

results to your report.  Also, submit a copy of the m‐file to Moodle.

FSH Oct-2017

Sample output:

--- Bernoulli’s Equation Program ---

--- [1]: Bisection Method

--- [2]: Modified False-position Method

--- [3]: Newton-Raphson Method

--- [4]: Secant Method

--- Enter value of Q (40 >= Q >= 60 ft^3/s): 41

--- Enter root finding technique: 3

-- Newton-Raphson Method –

--- b (m) ..... 1.8

--- h_0 (m) ... 0.9

--- H (m) ..... 0.075

-- Q(m^3/s) ... 1.161

-- Iter ....... 5

-- h(m) ....... 0.81961

-- ea(%) ...... 2.002366e-005

--- Enter 0 to STOP, 1 to REPEAT : 0

( 0 reviews ) United States

Project ID: #15414286

## Awarded to:

sasyabetro

Hi I am responsible for everything and I am responsible for the project. If you hire me, you will have nothing to lose. Relevant Skills and Experience Matlab and Mathematica, Report Writing Proposed Milestones \$25 US More

\$25 USD in 1 day
(0 Reviews)
0.0

## 5 freelancers are bidding on average \$28 for this job

jimenezluis

hello! please see some works related with numerical methods and matlab assignments in the following link [url removed, login to view] also I have knowledge about fluid me More

\$40 USD in 2 days
(27 Reviews)
4.6
saied2017

Hello Dear I'm mohamed saeed .Aerospace engineer . I have checked your hob and I'm ready to help you .I'ts advanced numerical solution using different methods Relevant Skills and Experience math Proposed Milestones More

\$25 USD in 1 day
(27 Reviews)
4.6
Mohammed099

A proposal has not yet been provided

\$25 USD in 1 day
(0 Reviews)
0.0
umair8511

I am experienced engineer worked a lot on matlab. I am sure i can help you out Relevant Skills and Experience mathematics. Matlab Proposed Milestones \$25 USD - Complete project

\$25 USD in 3 days
(0 Reviews)
0.0