How to maintain tank water level in Matlab

11 Ansichten (letzte 30 Tage)
Anass Naoushy
Anass Naoushy am 11 Mai 2021
Beantwortet: William Rose am 11 Mai 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 Kommentare
William Rose
William Rose am 11 Mai 2021
I ran your code and it runs without any errors. I see that figures 2 and 3 show no change in tank heights. I don;t know why. But I must admit I do not understand the code, because I am not familiar with ss2tf() or with Jacobian() or with symbolic math in Matlab.
I also see that the responses of heights to flow changes in figures 1 and 4 are immediate, and do not show signs of exponential build-up and decay as I woudl expect. Therefore I am not confident about those repsonses.
William Rose
William Rose am 11 Mai 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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

William Rose
William Rose am 11 Mai 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.

Weitere Antworten (0)

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by