#!/usr/bin/perl

# Arguments:
# Length of time series
# Integration step
$sigma = 10;
$rho = 28;
$beta = 8/3;

$time_length = shift(@ARGV);
$obs_start = shift(@ARGV);
$dt = shift(@ARGV);

$x = 3;
$y = 15;
$z = 1;

for ($t=0; $t < $time_length; $t+=$dt) {
  print "$t, $x, $y, $z\n" if ($t > $obs_start);
  $dx = $dt*$sigma*($y-$x);
  $dy = $dt*($x*($rho-$z)-$y);
  $dz = $dt*($x*$y - $beta*$z);
  $x += $dx;
  $y += $dy;
  $z += $dz;
}

