MATLAB Answers

I want to plot a graph as shown below, For that non linear system, i have written a Matlab script but i can't really identify how do i plot such graph.

4 views (last 30 days)
Yash Runwal
Yash Runwal on 23 Apr 2019
Answered: Naman Bhaia on 2 May 2019
%% WaterTank MATLAB Script
syms h(t)
Dh = diff(h);
A = 20; a = 2; b = 5; U = 0:0.1:1.0; V = 1;
watertank = 1*diff(h,t) - (1/A)*b.*V - (1/A)*a*sqrt(h) == 0;
soln = dsolve(watertank, h(0) == 0, Dh(0) == 0);
figure(1), clf
figure(2), clf
Zulauf means Inlet (denoted in the script as 'U')
Fullstand means Height of the tank (denoted in the script as 'h')


Sign in to comment.

Accepted Answer

Naman Bhaia
Naman Bhaia on 2 May 2019
Hello Yash,
If issue you are facing is in plotting the graphs in one figure, you can use the hold command while plotting.
And, to add a title to the graph and label the axes, you can visit this documentation page and see if it helps.


Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!