MATLAB Answers

How to maintain tank water level in Matlab

12 views (last 30 days)
Anass Naoushy
Anass Naoushy on 11 May 2021
Answered: William Rose on 11 May 2021
Can you please help me on this, my brother asked on how to solve it but I am struggling. Thanks in advance.
The question is in the image attached.
  10 Comments
William Rose
William Rose on 11 May 2021
I simulated the system using the differential equation solver. I notice that the time constant of decay after changes is a lot shorter than 1, which means a time step size of 1 will be too long to show the exponential decay after perturbations. That could explain why you do not see exponential decays in your results, but it does not explain why yyou do not see any change in response to certain perturbations. The so-called steady state values for h1 and h2 do not seem to be consistent with the default flow rates into the system. This is evident from the rapid decline of both heights from their initial "steady state" values. See attached plots. I run the simulation to t=20 sec, since nothing happens after t=20. This is a simulation of the F1 perturbation (problem 2a). Code atached.

Sign in to comment.

Answers (1)

William Rose
William Rose on 11 May 2021
The figures show simulaitons of responses to step changes in F1 and in F4. The attached code is for the seocnd simulaiton: step in F4 (problem 2C). To simulate the step in F1 (problem 2A), adjust the lines in the functions Flow1() and Flow4(), to get the step in F1 and to remove the step from F4. Adjust the plot title to say "F1" or "F4".
I realize this is not your assignment, because you are doing this symbolically. This shows a numerical solution. See my comments separately about the "steady state" heights, which are not really steady state.

Products


Release

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!