
close all
clear all

rng('default');

t = linspace(0,1,1000);
dt = t(2)-t(1);

W = cumsum(sqrt(dt)*randn(3,length(t)),2);

plot(t,W)
xlabel('t')
ylabel('W')
axis([0 1 -1.5 1.5])

print('-deps2c','wiener.eps')


W = t + sin(pi*t);

plot(t,W); hold on;
N = 10;

for n = 0:N-1
  t1 = n/N;
  t2 = (n+1)/N;
  W1 = t1 + sin(pi*t1);
  plot([t1 t2], [W1 W1],'k-')
  plot([t1 t1], [0  W1],'k-')
  plot([t2 t2], [0  W1],'k-')
end

print('-deps2c','riemann.eps')
