Simulink Dual Gravity Drained Tank
How often do you find a File Exchange submission accompanied by a video tutorial? I've only explored a small fraction of all the content on the File Exchange, but in my limited sampling, I have to say that this is the first contribution with such an achievement. The model is simple enough: a prediction of the water level of two tanks as they are filled and drained. But as John notes in his video, the model doesn't jump up and scream "I'm clearly two draining tanks!" when look you at it.
As I reviewed the model, other thoughts came to mind on how to improve it. The tank levels are calculated using a Level- 1 MATLAB S-Function. This technique is so old that MathWorks doesn't even provide a documentation page for it. The only thing available is a discussion on how to maintain them. I recommend avoiding the S-Function and instead rely on a MATLAB Function block for the derivative calculation combined with an Integrator block. Or better yet, the whole thing could be done with Simuink blocks without MATLAB code. I'd also suggest eliminating all the Muxes and Demuxes in favor of separate signal lines or buses. So there's room for improvement, but a solid model nevertheless.
In my mind, it's material like this that the File Exchange was meant for. John combines MATLAB, Simulink, Excel, and YouTube together into an interactive educational experience. It's a lot of fun, and I hope you check it out.
Comments
Let us know what you think here or leave a comment for John.
Comments
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.