Purchase Solution

Matlab programming

Not what you're looking for?

Ask Custom Question

Matlab programming - program and plot for water flowing in and out of a tank

Please see attachment. Thanks for your help!

Attachments
Purchase this Solution

Solution Summary

The expert plots the water flowing in and out of a tank. The Matlab programming is analyzed.

Solution Preview

Please see the attached file for detailed explanations !

BrainMass Posting Solution
_____________________________________________________________
Posting # CS7914

Solution:

First let us look at what the problem asks and then we shall see how it can be computed using MATLAB. The problem is on rate equations and uses simple calculus to solve these equations.

Simply put, what is happening is that initially the storage tank has some water (half-full) and the vertical height of the water is y (which is assumed to be y = 0 to start with.). So our "origin" is y = 0 and y changes as the water level in the tank changes. The water level in the tank will change according to the outflow (water leaving) and inflow (water entering) of water.
It is given that outflow is at the rate Q = 400m3/day and inflow is at a sinusoidal rate of 3Q sin2t m3/day. [Here d =day, a unit of time]. We are interested in computing the rate at which the water height (y) changes w.r.t. time i.e. dy/dt.
Important note: UNITS.
y = height of water level measured in meters (m).
Q= Rate at which a volume of water is entering/leaving (so its volume/time thus m3/day)
A= cross sectional area of the tank --- always constant--- measured in m2.
Please note that dy/dt has units: length/time (measured in meters/day)

The equation to compute dy/dt follows easily. The height changes due to difference in outflow and inflow rates which is exactly what the equation given states.
Note: Since we are computing dy/dt i.e. rate of change of height, the volume rate must be divided by cross-sectional area A because Volume = ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

C# variables and classes

This quiz contains questions about C# classes and variables.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C++ Operators

This quiz tests a student's knowledge about C++ operators.