Attachment 'darkside0.pl'

Download

   1 #!/usr/local/bin/perl
   2 # darkside0.pl
   3 
   4 use Math::Trig;
   5 
   6 my $day     = 23*3600 + 56*60 + 4.090530833  ; # seconds per sidereal day
   7 
   8 my $comppts = 100           ; # computations per plot
   9 my $plotpts = 500           ; # plot points
  10 my $tmax    = 5000          ; # max seconds
  11 
  12 my $m0      = 24*60         ; # minutes per synodic day
  13 my $mu      = 398600.4418   ; # km^3/s^2
  14 my $pi2     = 8.0*atan(1.0) ; # 2 pi
  15 my $re      = 6378.1        ; # km
  16 my $etemp   = 250.0         ; # Earth temp in Kelvin
  17 my $stblz   = 5.6704e-08    ; # W/m2-K4 Stephan Boltzmann constant
  18 my $sun     = 1300.0        ; # Sun watts/m2
  19 my $mass    = 0.300         ; # kg/m2
  20 my $spheat  = 710.0         ; # Specific heat J/kg-K
  21 my $albedo  = 0.85          ; # serversat albedo
  22 my $celsius = -273.15       ; # kelvin to celsius
  23 
  24 my $deltat  = $tmax / ($plotpts*$comppts ) ;
  25 my $heatcap = $mass * $spheat  ;
  26 my $eshine  = $stblz*$etemp**4 ; # earth shine in watts/
  27 
  28 my @array ;
  29 
  30 for( my $n=1 ; $n < 6 ; $n++ ) {
  31    my $norb       = 6 - $n       ;
  32    my $nper       = 7 - $n       ;
  33    $nper = 1      if $nper == 2  ; 
  34    my $min        = $m0  / $norb ;
  35    my $period     = $day / $nper ;
  36    my $semimajor  = ( $mu * ( $period / $pi2 )**2.0 )**(1.0/3.0) ;
  37    my $darkangle  = 2.0 * asin( $re / $semimajor ) ;
  38    my $darktime   = $period * $darkangle / $pi2 ;
  39    my $earthsky   = 0.5 * ( 1.0 - cos( 0.5*$darkangle ) ) ;
  40    
  41    # 2 surfaces
  42    my $earthwatts = $albedo * $earthsky*$stblz*$etemp**4 ; 
  43    my $startwatts = $albedo * $sun + $earthwatts ;
  44    my $starttemp  = sqrt(sqrt($startwatts/(2.0*$albedo*$stblz) ) ) ;
  45 
  46    ## printf "m%04d%9.3f%9.1f%9.5f%9.2f\n",
  47    ##          $min, $starttemp, $semimajor, $darkangle, $darktime ;
  48 
  49    my $time  = 0           ;
  50    my $temp  = $starttemp  ;
  51    my $watts = $earthwatts ;
  52       $array[ 0][0] = $time ;
  53       $array[$n][0] = $temp + $celsius ;
  54    for( my $pt = 1 ; $pt < $plotpts ; $pt++ ) {
  55       for( my $comp = 0 ; $comp < $comppts ; $comp++ ) {
  56          my $wattsin = $watts - 2.0*$albedo*$stblz*$temp**4 ;
  57          $temp += $wattsin * $deltat / $heatcap ;
  58          $time += $deltat ;
  59          $watts = $startwatts if ( $time > $darktime ) ;
  60       }
  61       $array[ 0][$pt] = $time ;
  62       $array[$n][$pt] = $temp + $celsius ;
  63 }  }  
  64 
  65 
  66 for( my $pt = 0 ; $pt < $plotpts ; $pt++ ) {
  67    for( my $n=0 ; $n < 6 ; $n++ ) {
  68       printf "%9.3f", $array[$n][$pt] ;
  69    }
  70    printf "\n" ;
  71 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-02-12 15:26:57, 228.9 KB) [[attachment:A0_title.jpg]]
  • [get | view] (2013-02-12 15:35:39, 912.5 KB) [[attachment:B0_serversatV3a.png]]
  • [get | view] (2013-02-12 15:36:48, 1976.2 KB) [[attachment:C0_world_marble.png]]
  • [get | view] (2013-02-12 15:36:23, 1602.0 KB) [[attachment:C3_energy.png]]
  • [get | view] (2013-02-12 15:33:18, 469.6 KB) [[attachment:E0_m288xx.png]]
  • [get | view] (2013-02-12 15:32:48, 59.2 KB) [[attachment:E3_crosser.png]]
  • [get | view] (2013-02-12 15:32:06, 405.6 KB) [[attachment:H0_toroid.png]]
  • [get | view] (2013-02-12 15:34:51, 97.8 KB) [[attachment:I0_echrome.png]]
  • [get | view] (2013-02-12 15:34:08, 356.0 KB) [[attachment:J3_turn_tidal.png]]
  • [get | view] (2013-02-12 15:33:46, 281.9 KB) [[attachment:K0_lighteccentric.png]]
  • [get | view] (2013-02-12 15:31:33, 454.9 KB) [[attachment:M0_temperature.png]]
  • [get | view] (2013-02-12 15:35:14, 101.8 KB) [[attachment:M3_deploy.png]]
  • [get | view] (2013-02-12 15:30:15, 700.1 KB) [[attachment:Q0_phasedarray.png]]
  • [get | view] (2013-02-12 15:29:44, 466.0 KB) [[attachment:Q3_arrayspace.png]]
  • [get | view] (2013-02-12 15:31:06, 488.4 KB) [[attachment:R0_radiation.png]]
  • [get | view] (2013-02-12 15:30:42, 281.4 KB) [[attachment:R3_radiation.png]]
  • [get | view] (2013-02-12 15:27:28, 506.1 KB) [[attachment:S0_costdrop.png]]
  • [get | view] (2013-02-12 15:28:49, 3693.6 KB) [[attachment:U0_radar.png]]
  • [get | view] (2013-02-12 15:27:55, 416.5 KB) [[attachment:U3_rocketbody.png]]
  • [get | view] (2013-02-16 04:59:50, 14.8 KB) [[attachment:a6.c]]
  • [get | view] (2013-02-16 04:59:58, 14.6 KB) [[attachment:a7.c]]
  • [get | view] (2013-02-16 03:52:04, 16.9 KB) [[attachment:ar06.c]]
  • [get | view] (2013-02-15 23:11:57, 1.7 KB) [[attachment:crosser.gp]]
  • [get | view] (2013-02-15 23:11:40, 2.3 KB) [[attachment:crosser.pl]]
  • [get | view] (2013-02-16 04:30:17, 2.0 KB) [[attachment:darkside0.gp]]
  • [get | view] (2013-02-16 15:28:29, 2.3 KB) [[attachment:darkside0.pl]]
  • [get | view] (2013-02-16 03:38:30, 9.3 KB) [[attachment:echrome04.c]]
  • [get | view] (2013-02-16 15:29:15, 5.7 KB) [[attachment:insertrb.pl]]
  • [get | view] (2013-02-16 15:37:24, 1.9 KB) [[attachment:lj2.gp]]
  • [get | view] (2013-02-16 15:37:08, 2.3 KB) [[attachment:lj2.pl]]
  • [get | view] (2013-02-16 04:14:19, 5.1 KB) [[attachment:orbit04w.c]]
  • [get | view] (2013-02-16 04:19:08, 9.1 KB) [[attachment:pa03.c]]
  • [get | view] (2013-02-16 04:19:19, 9.1 KB) [[attachment:pa04.c]]
  • [get | view] (2013-02-12 18:22:40, 5.3 KB) [[attachment:pc02.c]]
  • [get | view] (2013-02-16 15:29:37, 2.0 KB) [[attachment:rb.gp]]
  • [get | view] (2013-02-16 02:50:27, 6.0 KB) [[attachment:sh01.c]]
  • [get | view] (2013-02-13 23:22:32, 13918.1 KB) [[attachment:ss.pdf]]
  • [get | view] (2013-02-13 23:21:58, 23.3 KB) [[attachment:ss.tex]]
  • [get | view] (2013-02-16 04:07:31, 24.1 KB) [[attachment:ss6a.c]]
  • [get | view] (2013-02-16 04:12:13, 3.4 KB) [[attachment:tor08.c]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.