Tspan = linspace(0,1600,1000);

[t u] = ode15s('diff', Tspan, [0.5 0 0 1 0]);


figure(2)
clf
T = 0:100:max(t);
plot(t,u,T,0.5*exp(-4.5e-4*T),'k+')
hold on
legend('CH_3Cl','CH_3^+','Cl^-','OH^-','CH_3OH','c_0e^-^k^t')
xlabel('Tid (s)')
ylabel('Koncentration (M)')
grid

figure(1)
k11 = 4.5e-4; k31 = 1e-3;
plot(t,k11*u(:,1),'--',t,k31*u(:,1).*u(:,4),'-.')
legend('S_N1 (r11)','S_N2 (r31)')
ylabel('Reaktionshastighet (M s^-^1)')
xlabel('Tid (s)')
grid




