#!/usr/bin/perl
#
# simulate observations of a variable star


$true_period = 0.101;
$false_period = 0.100;
$start = 850.650;

$start_cycle = 0;
$end_cycle = 200;
$d_cycle = 0.10;

for ($t = $start_cycle; $t <= $end_cycle; $t += $d_cycle) {

  $true_time = $start + $t*$true_period;
  $false_time = $start + $t*$false_period;

  $true_phase = 0.0 + (($true_time - $start)/$true_period);
  $true_phase = $true_phase - int($true_phase);
  $false_phase = 0.0 + (($true_time - $start)/$false_period);
  $false_phase = $false_phase - int($false_phase);

  $num_cycle = $t;


  
  $false_min = $start_cycle + $t*$false_period;
  $true_min = $start_cycle + $t*$true_period;

  $true_min = $start + $t*0.104 - 0.00005*$t*$t;

  $true_minus_false = $true_min - $false_min;

  printf " %8.3f  %12.4f %12.4f   %12.4f  %12.4f  %6.3f \n",
            $num_cycle, $true_time, $false_time,
             $false_min, $true_min, $true_minus_false;


}


exit 0;
