clear all; close all

lw1 = 1.5; ms = 10; fs=30;

N = 4; 
T = cumsum((1/N)*ones(1,N));
dt = 1.0/770.0;
Nt = round(T/dt+eps);
t = linspace(0,T(end),Nt(end)+1);
t_point(1) = 0;
for i = 1:N-2
    t_point(i+1)=(Nt(i+1)+Nt(i))/2;
end
t_point(N)=Nt(end);

N_sig=[.95 .55 .50 .60];
new_sig=log(N_sig);
N_r=[.50 .65 .60 .95];
new_r=log(N_r);

sig_pts = N_sig;
r_pts = N_r;
sp = 0:1:Nt(end);
sig_func = interp1(t_point,sig_pts,sp);
r_func = interp1(t_point,r_pts,sp);

figure(1); clf; hold on; axis tight
set(gcf,'Position',[100 100 1000 500]);
plot(t,sig_func,'k','linewidth',lw1);

tt = [0]; 
for i = Nt
    line([1 1]*t(i),[min(new_sig)-.1 max(sig_pts)+.3],'linewidth',lw1*0.3,'linestyle','-','color','k');
    tt = [tt; t(i)];
end

plot([0 1.02],[0 0],'k-','linewidth',lw1); 
plot([0 0],[min(new_sig)-.1 max(sig_pts)+.3],'k^-','linewidth',lw1,'markersize',ms,'markerfacecolor','k','MarkerIndices',2); 
plot([0 1.05],[min(new_sig)-.1,min(new_sig)-.1],'k>-','linewidth',lw1,'markersize',ms,'markerfacecolor','k','MarkerIndices',2); 
plot([t_point*dt],[sig_pts],'ko','markersize',ms,'markerfacecolor','w');
plot([t_point*dt],[new_sig],'ko','markersize',ms,'markerfacecolor','k');

text('Interpreter','latex','String','$$\sigma(t)$$','Position',[-0.103196620583717 1.32086235962423 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\sigma_1^0$$','Position',[0.0100291858678957 1.10878609369928 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\sigma_2^0$$','Position',[0.353190476190477 0.710650696823519 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\sigma_3^0$$','Position',[0.60215821812596 0.656620803319263 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\sigma_4^0$$','Position',[0.934609831029185 0.756814031973852 1.4210854715202e-14],'FontSize',fs)

text('Interpreter','latex','String','$$\widetilde\sigma_1^0$$','Position',[0.0102227342549922 -0.218158529954761 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\widetilde\sigma_2^0$$','Position',[0.353190476190475 -0.439933369212722 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\widetilde\sigma_3^0$$','Position',[0.60357757296467 -0.532972206606578 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$\widetilde\sigma_4^0$$','Position',[0.934674347158218 -0.532357939655092 1.4210854715202e-14],'FontSize',fs)

text('Interpreter','latex','String','$$t$$','Position',[1.07428725038402 -0.789221166354512 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$0$$','Position',[-0.0380353302611371 -0.00396068445950118 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$0$$','Position',[0.00260983102918544 -0.945696904743827 1.4210854715202e-14],'FontSize',fs)

text('Interpreter','latex','String','$$T_1$$','Position',[0.223448540706605 -0.945542549949863 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$T_2$$','Position',[0.47273886328725 -0.945542549949863 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$T_3$$','Position',[0.723384024577573 -0.945542549949863 1.4210854715202e-14],'FontSize',fs)
text('Interpreter','latex','String','$$T_4$$','Position',[0.972674347158218 -0.945542549949863 1.4210854715202e-14],'FontSize',fs)

axis off

saveas(figure(1),'Schematic47','png')