Документ взят из кэша поисковой машины. Адрес оригинального документа : http://star.arm.ac.uk/~csj/movies/povray/merger.pov
Дата изменения: Fri Mar 29 18:07:14 2002
Дата индексирования: Tue Oct 2 07:55:03 2012
Кодировка:

Поисковые слова: antarctica
/* Merger

A movie illustrating the merger and subsequent evolution of
2 white dwarfs

Created with POVRAY

Dr C. Simon Jeffery
Armagh Observatory
2001 July

*/

/* Global Definitions

Normalized unit system :
Units of Mass (mass) : 1 Solar Mass
Units of Time (clock) : 1 hour
Units of distance : 1/100 of a Solar Radius

*/

#include "colors.inc"

background { color Black } // the sky is black - Olber's paradox



/* INPUT PARAMETERS */

/*

We have a starting period of 6 hours at which the (semi-)orbital
separation should be ~0.1 Rsun.

We assume an exaggerated orbital decay occurring over some 20 orbits.
Normally some 10^9 years would be required....

At contact, the orbital separation is 0.01 Rsun, the orbital period is
approx 10 min (or 0.15 hr) so time resolution should be 0.05 hr

*/

#declare Mass_WD1 = 0.6; // Mass of Primary White Dwarf
#declare Mass_WD2 = 0.3; // Mass of Secondary White Dwarf
#declare Initial_Period = 6; // Initial period of orbit (in hours)
#declare Decay_Time = 10*Initial_Period; // Number periods for spiral in



/* Properties of stars */

#declare Mass_Ratio = Mass_WD2 / Mass_WD1; // Mass ratio of stars
#declare Mass_Sum = Mass_WD2 + Mass_WD1; // Total mass of stars
#declare Mass_Red = Mass_WD2 / Mass_Sum; // Reduce mass of stars

#declare Rad_WD1 = 100 * 0.01 / sqrt(Mass_WD1/0.6); // Radius of white dwarf / core
#declare Rad_WD2 = 100 * 0.01 / sqrt(Mass_WD2/0.6); // Radius of white dwarf / core
#declare Contact = (Rad_WD1+Rad_WD2) / 100.; // Contact distance



/* Properties of Orbit */

#declare Initial_OrbSep_1 = pow( 0.0134 * (Mass_Sum) * pow(Mass_Red,3) * pow(Initial_Period/24.,2) ,1./3.);
#declare Init_Sep = Initial_OrbSep_1 * ( 1. + 1./Mass_Ratio );


/* Orbital Decay */
#declare Ttd = clock / Decay_Time;
#declare clock_merge = Decay_Time * sqrt ( 1. - pow (( Contact / Init_Sep ),1.5) ) ;
#declare t_merge = clock - clock_merge ;


/* Semimajor axes */
#declare Orbital_Radius_1 = Initial_OrbSep_1 * pow((1.-pow(Ttd,2)),2./3.);
#declare Orbital_Radius_2 = Orbital_Radius_1 / Mass_Ratio;
#declare Orbital_Sep = Orbital_Radius_1 + Orbital_Radius_2;

/* Periods and phases */
#declare Orbital_Period = Initial_Period * pow(Orbital_Radius_1/Initial_OrbSep_1,1.5);
#declare Ph0 = 2*pi/Initial_Period;

#if ( t_merge < 0 )

/* Orbital Phase */
#declare Phi = Ph0 * Decay_Time/2 * log( abs( (1+Ttd)/(1-Ttd) ) );

/* Positions of stars */
#declare wd1x = 100 * Orbital_Radius_1 * sin(Phi);
#declare wd1y = 0;
#declare wd1z = 100 * Orbital_Radius_1 * cos(Phi);
#declare wd2x = 100 * -Orbital_Radius_2 * sin(Phi);
#declare wd2y = 0;
#declare wd2z = 100 * -Orbital_Radius_2 * cos(Phi);

#end

/* Move CoM to WD1 */

#if ( t_merge > 0 )
#declare wd1x = 0;
#declare wd1y = 0;
#declare wd1z = 0;
#end



/* Surfaces of stars */

#declare CoM = sphere {
<0,0,0>, 0.1 hollow off
pigment { rgb <1.0,0.0,0.0> transmit 0.0 }
no_shadow
}

#include "stars.inc"



/* Compute size and position of fragments */

#if ( t_merge > 0 & t_merge < Initial_Period / 6 )
#declare R0 = seed (0);
#macro Make_Fragment (R0)
#declare F0_rad = 4 * pow( rand(R0),2 ) + Rad_WD1;
#declare F0_ext = 1.5 * rand(R0) + 1.0;
#declare F0_ang = 360 * (rand(R0) + t_merge / (Initial_Period * pow(F0_rad*F0_ext/Init_Sep/100,1.5)) );
// #warning concat("frag_radius =",str(F0_rad,5,2),"\n")
// #warning concat("frag_extent =",str(F0_ext,5,2),"\n")
// #warning concat("frag_angle =",str(F0_ang,5,2),"\n")
object { Accretion_Fragment scale F0_rad* rotate <0,F0_ang,0> }
#end
#end



/* Compute radius of merger envelope */

#if ( t_merge > 0 )
#declare Rad_Star = min ( pow(t_merge,2), 1000 );
#declare Rad_Env = max(0,min(1,(64-t_merge)/32)); // TOO ARBITRARY

#if ( Rad_Star < 1000 )
#declare Merged_Star = union {
object { Accretion_Core scale Rad_WD1 translate }
object { Shining_Dwarf_Light scale Rad_WD1 translate }
object { Accretion_Envelope }
object { Merger_Envelope scale Rad_Star }
}
#else
#if (Rad_Env > 0.2) // STRANGE LOGIC
#declare Merged_Star = union {
object { Accretion_Core scale Rad_WD1 translate }
object { Shining_Dwarf_Light scale Rad_WD1 translate }
object { Accretion_Envelope scale Rad_Env}
object { Merger_Envelope scale Rad_Star }
}
#else
#declare Merged_Star = union {
object { Accretion_Core scale Rad_WD1 translate }
object { Shining_Dwarf_Light scale Rad_WD1 translate }
object { Merger_Envelope scale Rad_Star }
}
#end
#end
#end

/* Scale */

#declare Sun_Radius = cylinder {
<-50,0,0>, <+50,0,0>, 2.5
texture { pigment {
color rgb<0,1,0> filter 0.0 }
finish { diffuse 0.6 } }
}


/* Declare Camera position as a function of time

The camera starts at a distance of 1 Rsun from the CoG and observes
for ~2 revolutions (2 * Initial_Period).

It then zooms in over a couple more orbits before watching the spiral
in phase in detail from a distance of 0.1 Rsun

To save time rendering , we use simplified stars when viewing
from a distance and more realistic ones close in. See "test_objects.pov"
for a variety of different attempts to make realistic stars.

*/

#declare InP = Initial_Period;

#if ( t_merge < 0 )
#declare Cam_Dist = max (min (100,100*(1-(clock-5*InP)/InP)),10); // pan and zoom at start
#else
#declare Cam_Dist = max ( 3*Rad_Star, 10 ); // zoom out as star expands
#end

#declare Cam_Elev = max (min (pi/2,pi/2*(1-(clock-2*InP)/InP)), pi/9);

#declare Cam_X = 0;
#declare Cam_Y = abs(Cam_Dist)*sin(Cam_Elev);
#declare Cam_Z = - abs(Cam_Dist)*cos(Cam_Elev);
#declare Rot_X = 180/pi * acos (-Cam_Z/Cam_Dist);

camera {
location <0, Cam_Y, Cam_Z>
look_at <0, 0, 0>
}



/* Create clock, period and separation labels ( NB need camera position ) */

#if ( t_merge > -Orbital_Period )
#declare Elapsed = concat( "x = ", str( t_merge,5,2 ))
#else
#declare Elapsed = concat( "t = ", str( clock,5,2 )," h")
#end
#declare Period = concat( "P = ", str( Orbital_Period,5,3 ), " h" )
#declare Separn = concat( "a = ", str( Orbital_Sep,5,3 ), " R" )


#declare Label_elapsed = union{
light_source {
<-6, +5, +5>
White
spotlight
radius 18
falloff 18
point_at <-6, +5, +15>
}
text {ttf "timrom.ttf" Elapsed 0.1, 0
pigment { Red }
finish { reflection .25 diffuse 1. }
translate <-8, +5.5, +15>
}
}

#declare Label_orbit = union{
light_source {
<+6, +5, +5>
White
spotlight
radius 18
falloff 18
point_at <+6, +5, +15>
}
text {ttf "timrom.ttf" Period 0.1, 0
pigment { Yellow }
finish { reflection .25 diffuse 1. }
translate <+4, +5.5, +15>
}
text {ttf "timrom.ttf" Separn 0.1, 0
pigment { Yellow }
finish { reflection .25 diffuse 1 }
translate <+4, +4.5, +15>
}
}

#declare Labels = union{
object {Label_elapsed}
object {Label_orbit}
}




/* Create Scenes */


/* Show CoM occasionally */

#if ( mod (clock,1) < 0.1 )
object { CoM }
#end


#if ( t_merge < 0 )

/* Show two white dwarfs */

object { Shining_Dwarf scale Rad_WD1 translate }
object { Shining_Dwarf scale Rad_WD2 translate }

/* Add clock, period and separation text to frame */

object { Labels rotate translate }

#else

/* More massive white dwarf remains */

#if ( t_merge < Initial_Period / 6 )

object { Shining_Dwarf scale Rad_WD1 translate }

#declare R0 = seed (0);
Make_Fragment (R0)
Make_Fragment (R0)
Make_Fragment (R0)
Make_Fragment (R0)
Make_Fragment (R0)
Make_Fragment (R0)

object { Label_elapsed rotate translate }


#else

#if ( Rad_Star < 10 * Rad_WD1 )

object {Merged_Star}

#else

difference {
object {Merged_Star}
box { <0,0,0> 2*Rad_Star*<1,1,-1> hollow
texture { pigment { color rgb<1,1,1> filter 1.0 } finish { reflection 0.0 } }
interior { media {absorption 0.0 } } rotate <0,+20,0>
}
}

#if ( Rad_Star < 100 * Rad_WD1 )
object { Sun_Radius scale 0.1 translate <0,0,-1.2*Rad_Star> }
#else
object { Sun_Radius scale 1.0 translate <0,0,-1.2*Rad_Star> }
#end

#end

object { Label_elapsed rotate translate }

#end

#end