σ = 10;
ρ = 35;
β = 8/3;
T = 30;

    
equations  =  {x'[t] == σ (y[t] - x[t]), y'[
              t] == ρ x[t] - y[t] - x[t] z[t], z'[t] == 
            x[t] y[t] - β z[t], x[0] == 10, y[0] == 0, 
          z[0] == 10};

    
{sol} = 
        NDSolve[equations, {x[t], y[t], z[t]},  {t, 0, T}, 
          MaxSteps -> 100000];

    
$FormatType = TraditionalForm;
$TextStyle = {FontFamily -> "Times"};
phasespace = 
        ParametricPlot3D[({x[t], y[t], z[t]} /. sol), {t, 0, T}, 
          PlotPoints -> 3000, AxesLabel -> {x, y, z}, 
          Ticks -> None, BoxStyle -> Dashing[{0.005, 0.01}], 
          AxesStyle -> Dashing[{0.005, 0.01}]];

    
yplot = 
      Plot[(y[t] /. sol), {t, 0, T}, PlotLabel -> y[t], 
        Frame -> True]

    
Export["lorenzattr.eps", 
        phasespace];
Export["lorenzy.eps", yplot];

equations3 = {ξ'[
                t] == σ (η[t] - ξ[t]), η'[
                t] == ρ ξ[t] - η[t] - ξ[t] z[t], η[
                0] == 10, ξ[0] == 0} /. 
          sol;

    
{sol3} = 
        NDSolve[equations3, {ξ[t], η[t]},  {t, 0, T}, 
          MaxSteps -> 100000];

    
plot3 = 
        Plot[{(y[t] /. sol), (η[t] /. sol3)}, {t, 0, 4}, 
          Frame -> True,  
          PlotStyle  -> {{}, {Dashing[{0.005, 
                    0.01}]}}];

    
Export["z-nudging.eps", plot3]

equations4 = {ξ'[
                t] == σ (y[t] - ξ[t]), ζ'[
                t] == ξ[t] y[t] - β ζ[t], ζ[
                0] == 0, ξ[0] == 0} /. 
          sol;

    
{sol4} = 
        NDSolve[equations4, {ξ[t], ζ[t]},  {t, 0, T}, 
          MaxSteps -> 100000];

    
plot4 = 
        Plot[{(z[t] /. sol), (ζ[t] /. sol4)}, {t, 0, 3}, 
          Frame -> True,  
          PlotStyle  -> {{}, {Dashing[{0.005, 
                    0.01}]}}];

    
Export["y-nudging.eps", plot4]

T1 = 2;
n = 40;
h = T1/n;

    
observable = 
        Table[({t, x[t]} /. sol) /. t -> i h, {i, 0, 
            n - 1}];

    
ReferencePlot = 
        Plot[{x[t] /. sol, y[t] /. sol}, {t, 0, T1}, 
          DisplayFunction -> Identity];

    
Step[{plot_, η0_, ζ0_}, {t0_, ξ0_}] := 
        Block[{sol2, newplot}, 
{sol2} = 
            NDSolve[{ξ'[
                    t] == σ (η[t] - ξ[t]), η'[
                    t] == ρ ξ[t] - η[
                      t] - ξ[t] ζ[t], ζ'[
                    t] == ξ[t] η[t] - β ζ[
                        t], ζ[t0] == ζ0, η[
                    t0] == η0, ξ[t0] == ξ0}, {ξ[
                  t], η[t], ζ[t]},  {t, t0, 
                t0 + h}]; 
newplot = 
            Plot[{ξ[t] /. sol2, η[t] /. sol2}, {t, t0, t0 + h}, 
              DisplayFunction -> Identity, 
              PlotStyle  -> {{Dashing[{0.003, 
                        0.003}], {Dashing[{0.003, 
                          0.003}]}}}]; 
{Show[plot, 
              newplot], ((η[t] /. sol2) /. 
                t -> t0 + h), ((ζ[t] /. sol2) /. 
                t -> t0 + h)}];

    
result = 
        Fold[Step, {ReferencePlot, 10, 0}, 
          observable];

    
plot5 = 
        Show[result[[1]], DisplayFunction -> $DisplayFunction, 
          PlotRange -> All, Frame -> True, 
          PlotLabel -> 
            StringForm["h=``", N[h]]];

    
Export["discrete-nudging.eps", plot5]

T1 = 8;
n = 40;
h = T1/n;

    
observable = 
        Table[({t, x[t]} /. sol) /. t -> i h, {i, 0, 
            n - 1}];

    
ReferencePlot = 
        Plot[{x[t] /. sol, y[t] /. sol}, {t, 0, T1}, 
          DisplayFunction -> Identity];

    
Step[{plot_, η0_, ζ0_}, {t0_, ξ0_}] := 
        Block[{sol2, newplot}, 
{sol2} = 
            NDSolve[{ξ'[
                    t] == σ (η[t] - ξ[t]), η'[
                    t] == ρ ξ[t] - η[
                      t] - ξ[t] ζ[t], ζ'[
                    t] == ξ[t] η[t] - β ζ[
                        t], ζ[t0] == ζ0, η[
                    t0] == η0, ξ[t0] == ξ0}, {ξ[
                  t], η[t], ζ[t]},  {t, t0, 
                t0 + h}]; 
newplot = 
            Plot[{ξ[t] /. sol2, η[t] /. sol2}, {t, t0, t0 + h}, 
              DisplayFunction -> Identity, 
              PlotStyle  -> {{Dashing[{0.003, 
                        0.003}], {Dashing[{0.003, 
                          0.003}]}}}]; 
{Show[plot, 
              newplot], ((η[t] /. sol2) /. 
                t -> t0 + h), ((ζ[t] /. sol2) /. 
                t -> t0 + h)}];

    
result = 
        Fold[Step, {ReferencePlot, 10, 0}, 
          observable];

    
plot6 = 
        Show[result[[1]], DisplayFunction -> $DisplayFunction, 
          PlotRange -> All, Frame -> True, 
          PlotLabel -> 
            StringForm["h=``", N[h]]];

    
Export["discrete-nudging-large.eps", plot6]

T1 = 2;
n = 40;
h = T1/n;

    
observable = 
        Table[({t, x[t]} /. sol) /. t -> i h, {i, 0, 
            n - 1}];

    
ReferencePlot = 
        Plot[{}, {t, 0, T1}, 
          DisplayFunction -> Identity];

    
Step[{plot_, η0_, ζ0_}, {t0_, ξ0_}] := 
        Block[{sol2, newplot}, 
{sol2} = 
            NDSolve[{ξ'[
                    t] == σ (η[t] - ξ[t]), η'[
                    t] == ρ ξ[t] - η[
                      t] - ξ[t] ζ[t], ζ'[
                    t] == ξ[t] η[t] - β ζ[
                        t], ζ[t0] == ζ0, η[
                    t0] == η0, ξ[t0] == ξ0}, {ξ[
                  t], η[t], ζ[t]},  {t, t0, 
                t0 + h}]; 
newplot = 
            Plot[{(ξ[t] - x[t])^2 /. sol2 /. 
                  sol, (ζ[t] - z[t])^2 + (η[t] - 
                            y[t])^2 /. sol2 /. sol}, {t, t0, t0 + h}, 
              DisplayFunction -> Identity, 
              PlotStyle  -> {{}, {Dashing[{0.003, 
                        0.003}]}}]; 
{Show[plot, 
              newplot], ((η[t] /. sol2) /. 
                t -> t0 + h), ((ζ[t] /. sol2) /. 
                t -> t0 + h)}];

    
result = 
        Fold[Step, {ReferencePlot, 10, 0}, 
          observable];

    
plot7 = 
        Show[result[[1]], DisplayFunction -> $DisplayFunction, 
          PlotRange -> All, 
          Frame -> True];

    
Export["discrete-nudging-error.eps", plot7]

T1 = 0.5;
n = 10;
h = T1/n;

    
observable = 
        Table[({t, x[t]} /. sol) /. t -> i h, {i, 0, 
            n - 1}];

    
ReferencePlot = 
        Plot[{}, {t, 0, T1}, 
          DisplayFunction -> Identity];

    
Step[{plot_, η0_, ζ0_}, {t0_, ξ0_}] := 
        Block[{sol2, newplot}, 
{sol2} = 
            NDSolve[{ξ'[
                    t] == σ (η[t] - ξ[t]), η'[
                    t] == ρ ξ[t] - η[
                      t] - ξ[t] ζ[t], ζ'[
                    t] == ξ[t] η[t] - β ζ[
                        t], ζ[t0] == ζ0, η[
                    t0] == η0, ξ[t0] == ξ0}, {ξ[
                  t], η[t], ζ[t]},  {t, t0, 
                t0 + h}]; 
newplot = 
            Plot[{(ξ[t] - x[t])^2 /. sol2 /. 
                  sol, (ζ[t] - z[t])^2 + (η[t] - 
                            y[t])^2 /. sol2 /. sol}, {t, t0, t0 + h}, 
              DisplayFunction -> Identity, 
              PlotStyle  -> {{}, {Dashing[{0.003, 
                        0.003}]}}]; 
{Show[plot, 
              newplot], ((η[t] /. sol2) /. 
                t -> t0 + h), ((ζ[t] /. sol2) /. 
                t -> t0 + h)}];

    
result = 
        Fold[Step, {ReferencePlot, 10, 0}, 
          observable];

    
plot8 = 
        Show[result[[1]], DisplayFunction -> $DisplayFunction, 
          PlotRange -> All, 
          Frame -> True];

    
Export["discrete-nudging-zoom.eps", plot8]

T1 = 0.07;
n = 10;
h = T1/n;

    
observable = 
        Table[({t, x[t]} /. sol) /. t -> i h, {i, 0, 
            n - 1}];

    
ReferencePlot = 
        Plot[{}, {t, 0, T1}, 
          DisplayFunction -> Identity];

    
Step[{plot_, η0_, ζ0_}, {t0_, ξ0_}] := 
        Block[{sol2, newplot}, 
{sol2} = 
            NDSolve[{ξ'[
                    t] == σ (η[t] - ξ[t]), η'[
                    t] == ρ ξ[t] - η[
                      t] - ξ[t] ζ[t], ζ'[
                    t] == ξ[t] η[t] - β ζ[
                        t], ζ[t0] == ζ0, η[
                    t0] == η0, ξ[t0] == ξ0}, {ξ[
                  t], η[t], ζ[t]},  {t, t0, 
                t0 + h}]; 
newplot = 
            Plot[{200 (ξ[t] - x[t])^2 /. sol2 /. 
                  sol, (ζ[t] - z[t])^2 + (η[t] - 
                            y[t])^2 /. sol2 /. sol}, {t, t0, t0 + h}, 
              DisplayFunction -> Identity, 
              PlotStyle  -> {{}, {Dashing[{0.003, 
                        0.003}]}}]; 
{Show[plot, 
              newplot], ((η[t] /. sol2) /. 
                t -> t0 + h), ((ζ[t] /. sol2) /. 
                t -> t0 + h)}];

    
result = 
        Fold[Step, {ReferencePlot, 10, 0}, 
          observable];

    
plot9 = 
        Show[result[[1]], DisplayFunction -> $DisplayFunction, 
          PlotRange -> All, 
          Frame -> True];

    
Export["discrete-nudging-tiny.eps", plot9]