clc
close all
clear

sim('midterm2017_Exercise2')
tau = 5;
theta = 7;
tstep = 3;
a = tau+theta+tstep;
y63 = (y(end)-y(1))*0.63;

figure
plot(t,u,'b')
hold on
plot(t,y,'r')
plot([0 a],[y63 y63],'--k')
plot([a a],[0 y63],'--k')
ax = gca;
ax.FontSize = 14;
ax.TickLabelInterpreter = 'latex';
ax.XTick = [0:5:40];
ax.YTick = [0:12];
xlabel('Time (s)','Interpreter','latex')
H = drawbrace([3 0], [10 0], 20, 'Color', 'k');
K = drawbrace([10 0], [15 0], 20, 'Color', 'k');
thetatxt = text(6.1790, 1.45, {'$\theta$'},'Interpreter','latex','FontSize',14,'Color','k');
tautxt = text(12.5, 1.45, {'$\tau$'},'Interpreter','latex','FontSize',14,'Color','k');
u = text(24,5.3, {'$u(t)$'},'Interpreter','latex','FontSize',14,'Color','k');
y = text(16.3, 9, {'$y(t)$'},'Interpreter','latex','FontSize',14,'Color','k');
y2 = text(3,6.8, {'$0.63\Delta y_{\infty}$'},'Interpreter','latex','FontSize',14,'Color','k');
yinf = text(36, 9.5, {'$y_{\infty}$'},'Interpreter','latex','FontSize',14,'Color','k');



