

$Fext = 0.1;
$k = 0.1;
$m = 0.01;
$b = 0.02;

$Fext /= $m;
$k /= $m;
$b /= $m;

$dt = 0.1;
$dt2 = $dt*$dt;

# En el tiempo t = 0
$xt_1 = 0;
$xt   = 0;
$xt1  = 0;
$t = 0;
print "$t $xt\n";

# En el tiempo t = 1
$xt_1 = 0;
$xt   = 0;
$xt1 = $Fext*$dt2;
$t = 1*$dt;
print "$t $xt\n";

# En el tiempo t = 2
$t = 2*$dt;
print "$t $xt\n";
print "$dt $xt\n";

for ( $i=2; $i<100; $i++ ) {
	$xt_1 = $xt;
	$xt   = $xt1;
	$xt1 = $xt + ($xt - $xt_1)*(1-$b*$dt) - $k*$dt2*$xt + $Fext*$dt2;

	$t = $i*$dt;
	print "$t $xt\n";
}
