/* solar-wind-ion-accel.c Simple model of an ion travelling from the transition region to 1AU. * * Tab = 4 * * Tweak initial states of some variables and compile with GCC: * * cc solar-wind-ion-accel.c -o solar-wind-ion-accel * * No command line parameters - just run it: * * ./solar-wind-ion-accel * * ./solar-wind-ion-accel > solar-wind-ion-accel.txt * * Robin Whittle Melbourne Australia 9 September 2006 rw@firstpr.com.au http://astroneu.com */ #include #include #include /*--------------------------------------------------------------------------------*/ int main(int argc, char *argv[]) { /* Trial value for how much the ion accelerates * away from the Sun when it is 1AU away. * Metres per second per second. * * Since both light brightness (at least in the * outward direction, not counting sideways * illumination near the photosphere) and gravity * scale directly with 1/radius^2, we only need * one radius dependent acceleration value. * * We assume light interaction delivers momentum * greater than gravitational attraction, by * some fraction which we later determine from * knowing the acceleration due to gravity at 1AU. * * When this is manually set to the correct value, * the final velocity at 1AU, when the program ends, * will approximate the observed velocity, * say 600 km/sec: * * http://astroneu.com/plasma-redshift-1/#Cranmer * * Some results: * * accel_1au Total seconds Final velocity km/sec * hours * * 0.001 599517 166 253 * 0.0015 489498 136 310 * 0.0018 446846 124 339 * 0.002 423914 118 358 * 0.0025 379157 105 400 * 0.003 346119 96 438 * 0.004 299744 83 506 * 0.005 268096 74 566 * 0.005626 252739 70 600.055 * 0.006 244734 68 620 * 0.007 226578 63 669 * 0.008 211942 59 716 * 0.009 199819 56 759 * 0.01 189564 52 800 */ double accel_1au = 0.005626; /* Radius of Earth's orbit, in metres. */ double radius_1au = 1.5e+11; /* Start and end distances, typically start is * radius of the transition region from the centre * of the Sun. End is typically Earth orbit = 1AU. * Metres per second. * * These are rough figures, for convenience. Real * values are 6.96e+8 and 1.496e+11. */ double radius_start = 7e+8; double radius_end = 1.5e+11; /* Variables as we step outwards from the Sun. * * Time in seconds. * Radius in metres. * Velocity in metres per second. * Acceleration in metres per second per second. */ int time = 0; double radius = radius_start; double velocity = 0; double accel = 0; /* How many seconds before generating a line of results. * Normally leave this as 1, but to generate a shorter * output, say with a line every 100 seconds, set it to * 100. */ int report_interval = 1; while ( radius <= radius_end) { /* Calculate the acceleration in this second from * the brightness of sunlight at this radius, and * from the acceleration we set for the brightness * at 1AU. */ accel = accel_1au * (radius_1au * radius_1au) / (radius * radius); /* Create new radius from previous radius, plus the * distance travelled this second due to the initial * velocity, plus the distance travelled this second * due to acceleration this second - which is half * the acceleration. */ radius += velocity + (accel /2); /* New velocity is old velocity plus acceleration. */ velocity += accel; if ( (time % report_interval) == 0) { printf ("Seconds:%7i Hours: %4.1f Radius: %9.2f Mm Vel: %6.2f km/s Accel: %9.5f ms^-2\n", time, ((double) time / 3600), (radius / 1000000), (velocity / 1000), accel); } time += 1; } printf ("\n\nInitial parameters: naccel_1au = %f radius_start = %e radius_end = %e \n", accel_1au, radius_start, radius_end); printf ("Final state: Seconds:%7i Hours: %4.1f Radius: %8.2f Mm Vel: %6.2f km/s Accel: %9.5f ms^-2\n", time, ((double) time / 3600), (radius / 1000000), (velocity / 1000), accel); exit(0); }