Highlights
Task:
PROBLEM:
Bernoullis equation states that for an incompressible fluid the following summation is constant across the flow: v^2/2 + g*z + P/rho, where v = fluid velocity, g = gravitational constant, z = elevation, P = pressure, and rho = density (constant throughout the fluid due to incompressible nature). The values of v, z, and P change at points along the flow whereas values for g and rho are assumed constant.
Assuming all units are congruent, fill in the holes (zero values) in the given matrix of v, z, and P values, in three respective rows for n measured points (3 x n matrix). Use g = 9.81. Rho will be given for each test case. The input matrix will contain one complete set of values to calculate the constant. The completed matrix will not contain any zeros (or very small numbers).
Test 1
Code Input
%%
in = [1 0.6 0.8 1 1; 1 1.1 1.2 1.3 1.4; 10 0 0 0 0];
rho = 1.0;
out = [1 0.6 0.8 1 1; 1 1.1 1.2 1.3 1.4; 10 9.339 8.218 7.057 6.0760];
eps = 1e-3;
assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)
TEST 2
Code Input
%%
in = [1 0.6 0.8 1 1; 0 0 1 0 0; 10 12 10 14 8];
rho = 1.5;
out = [1 0.6 0.8 1 1; 0.9817 0.8784 1 0.7098 1.1176; 10 12 10 14 8];
eps = 1e-3;
assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)
TEST 3
CODE INPUT
%%
in = [0 0 0 1 0; 1 1.1 1.2 1.3 1.4; 10 12 10 14 8];
rho = 0.75;
out = [4.1896 3.2027 3.6917 1 3.8779; 1 1.1 1.2 1.3 1.4; 10 12 10 14 8];
eps = 1e-3;
assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)
TEST 4
CODE INPUT
%%
in = [1 1.6 0.8 1 1 0 0 1 1 1.2; 1 1.6 0 1.3 0 1.9 1.8 1.7 0 1.8; 0 12 5 0 8
7.5 7.7 0 11.1 0];
rho = 0.97;
out = [1 1.6 0.8 1 1 2.4397 2.7390 1 1 1.2; 1 1.6 2.4335 1.3 2.0999 1.9 1.8
1.7 1.7741 1.8; 18.466 12 5 15.6113 8 7.5 7.7 11.805 11.1 10.6401];
eps = 1e-3;
assert(sum(sum(abs(Bernoulli_eq(in,rho)-out))) < eps)
This Mathematics Assignment has been solved by our Mathematics Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.