Vous êtes sur la page 1sur 2

CEE 291 - Homework 5 Non-linear Equations, Regression, & Numerical Math

Due Data: Not required to hand-in Problem 1: Non-linear system of equations (a) Solve the following system of non-linear equations using the MATLAB symbolic tools. 5 = y sin(x) + z 10 = x2 4* y 7 = x3 y2 + z2

Problem 2: Numerical Integration Many integration techniques can be used to compute the definite integral like the one below

1 1 x 2 dx

In this problem, we will both trapezoidal rule and Simpson rule to calculate F. a.) Compute F for the definite integral above. Assume the constant of integration is 0. b.) Use Matlab to make a plot of 1/(1+x2) with x limits over the limits of the integral. Label the equation in the plot. c.) Write a script Matlab program (xxx.m) to computes the integral of the above equation by using the trapezoidal rule. Do not use any built-in Matlab functions. Make a table comparing the approximated solution for different spacing. d.) Use Matlab built-in function trapz to verify your algorithm. e.) Use Matlab built-in function, quad, that is based upon the Simpson rule. This function returns the Simpson rule approximation over an interval specified. Compare the approximations with the trapezoidal rule. f.) Use Matlab symbolic command to write a Matlab script program that compute F.

Problem 3: Ordinary Differential Equation Spherical Tank Problem The figure below shows a spherical tank for storing water. The tank is filled through a hole in the top and drained through a hole in the bottom. If the tanks radius is r, you can use integration to show that the volume of water in the tank as a function of its height h is given by Equation 1
V (h) rh 2 h3 3

Torricellis principle states that the liquid flow rate through the hole is proportional to the square root of the height h. Further studies in fluid mechanics have identified the relation more precisely, and the result is that the volume flow rate through the hole is given by Equation 2

q Cd A 2gh
Where A is the area of the hole, g is the acceleration due to gravity, and Cd is an experimentally determined value that depends partly on the type of liquid. For water, Cd = 0.6 is a common value. We can use the principle of conservation of mass to obtain a differential equation for the height h. Applied to this tank, the principle says that the rate od change of liquid volume in tank must equal the flow rate out of the tank; that is, (Equation 3)
dV q dt

From Equation 1

dV dh dh dh 2rh h 2 h(2r h) dt dt dt dt

Substituting this and Equation 2 into Equation 3 gives the required equation for h

(2rh h 2 )

dh Cd A 2gh dt

Use MATLAB to solve this equation to determine how long it will take for the tank to empty if the initial height is 9ft. The tank has a radius of r = 5 ft and has a 1-in.-diameter hole in the bottom. Use g = 32.2 ft/sec2. Discuss how to check the solution

Figure of a Draining Tank Note: For your practice, you should also use Matlab symbolic built-in function dsolve to solve the last equation. 2

Vous aimerez peut-être aussi