WaBis

walter.bislins.ch

Datei: ControlPanel: NewtonEinstein.js

Inhalt der Datei: media/NewtonEinstein.js
function NewtonEinstein() {
  this.Year = 31556925.261;     // [s] Tropisches Jahr
  this.Lj = 9460730472580800.0; // [m]
  this.c = 299792458.0;         // [m/s]
  this.d = 26000.0 * this.Lj;   // [m]
  this.a = 9.81;                // [m/s^2]
  this.TN = 0;                  // [s]
  this.TE = 0;                  // [s]
  this.TauN = 0;                // [s]
  this.TauE = 0;                // [s]
  this.SN = 0;                  // [m]
  this.SE = 0;                  // [m]
  this.VN = 0;                  // [m/s]
  this.VE = 0;                  // [m/s]
  this.AN = 0;                  // [m/s^2]
  this.AE = 0;                  // [m/s^2]
  this.DTN = 0;
  this.DTE = 0;
  this.DSN = 0;
  this.DSE = 0;
  this.TimeUnitNum = 0;
  this.LengthUnitNum = 0;
  this.TimeUnit = '';           // 1 = 'Y', 2 = 'M', 3 = 'D', 4 = 'h', 5 = 'm', 6 = 's'
  this.TimeUnitSingle = '';
  this.LengthUnit = '';         // 1 = 'LY', 2 = 'LM', 'LD', 'Lh', 'Lm', 'Ls', 'AE', 'pc', 9 = 'km'
  this.TimeMult = 1;
  this.LengthMult = 1;
  this.TimeSecPerUnit = 's/Jahre';
  this.LengthMeterPerUnit = 'm/Lj';
  this.TimeUnits = [
    'Jahre', 'Monate', 'Tage', 'h', 'min', 's' ];
  this.TimeUnitsSingle = [
    'Jahr', 'Monat', 'Tag', 'h', 'min', 's' ];
  this.LengthUnits = [
    'Lj', 'Lmon', 'Ltg', 'Lh', 'Lmin', 'Ls', 'AE', 'pc', 'km' ];
  this.TimeMults = [
    31556925.261,    // Jahre -> s (365.24219052083 * 1Tg = Tropisches- bzw. Kalenderjahr)
     2629743.77175,  // Mon -> s (Jahre/12)
       86400,        // Tg -> s (24 * 60 * 60s)
        3600,        // h -> s (60 * 60s)
          60,        // min -> s
           1
  ];
  this.LengthMults = [
    9460730472580800,   // Lj -> m (Definition nach Wikipedia: 365.25 * 1Lt, julianisches Jahr = 365.25 Tg)
     788394206048400,   // Lm -> m (Lj / 12)
      25902068371200,   // Lt -> m (24 * 60 * 60Ls)
       1079252848800,   // Lh -> m (60 * 60Ls)
         17987547480,   // Lmin -> m (60Ls)
           299792458,   // Ls -> m
        149597870700,   // AE -> m (Wikipedia)
   30856775812815000,   // pc -> m (Wikipedia, ca. 3.26Lj)
                1000    // km -> m
  ];
}

NewtonEinstein.prototype.SetUnits = function() {
  this.TimeUnit = this.TimeUnits[this.TimeUnitNum];
  this.TimeUnitSingle = this.TimeUnitsSingle[this.TimeUnitNum];
  this.TimeMult = this.TimeMults[this.TimeUnitNum];
  this.TimeSecPerUnit = 's/' + this.TimeUnitSingle;
  this.LengthUnit = this.LengthUnits[this.LengthUnitNum];
  this.LengthMult = this.LengthMults[this.LengthUnitNum];
  this.LengthMeterPerUnit = 'm/' + this.LengthUnit;
}

NewtonEinstein.prototype.Compute = function() {
  this.SetUnits();
  // Newton
  this.TN = 2.0 * this.NewtonTofS( this.d / 2.0 );
  this.TauN = this.TN;
  this.SN = this.d;
  this.VN = this.NewtonVofT( this.TN / 2.0 );
  this.AN = this.a;
  this.DTN = 1;
  this.DSN = 1;
  // Einstein
  this.TE = 2.0 * this.EinsteinTofS( this.d / 2.0 );
  this.TauE = 2.0 * this.EinsteinTAUofT( this.TE / 2.0 );
  this.SE = 2.0 * this.EinsteinSofT( this.TauE / 2.0 );
  this.VE = this.EinsteinVofT( this.TE / 2.0 );
  this.AE = this.EinsteinAofT( this.TE / 2.0 );
  this.DTE = 1.0 / this.EinsteinDTAUofT( this.TE / 2.0 );
  this.DSE = this.DTE;
}

NewtonEinstein.prototype.NewtonTofS = function( s ) {
  return Math.sqrt( 2.0 * s / this.a );
}

NewtonEinstein.prototype.NewtonVofT = function( t ) {
  return this.a * t;
}

NewtonEinstein.prototype.EinsteinTofS = function( s ) {
  var cq = this.c * this.c;
  return this.c / this.a * Math.sqrt( Math.pow( (s * this.a + cq) / cq, 2.0 ) - 1.0 );
}

NewtonEinstein.prototype.EinsteinTAUofT = function( t ) {
  var atc = this.a * t / this.c;
  return this.c / this.a * Math.log( Math.sqrt( Math.pow(atc, 2.0) + 1.0 ) + atc );
}

NewtonEinstein.prototype.EinsteinVofT = function( t ) {
  var at = this.a * t;
  return at / Math.sqrt( Math.pow( at / this.c, 2.0) + 1 );
}

NewtonEinstein.prototype.EinsteinAofT = function( t ) {
  return this.a / Math.pow( Math.pow( this.a * t / this.c, 2.0 ) + 1.0 , 1.5);
}

NewtonEinstein.prototype.EinsteinDTAUofT = function( t ) {
  return 1.0 / Math.sqrt( Math.pow( this.a * t / this.c, 2.0 ) + 1.0 );
}

NewtonEinstein.prototype.EinsteinSofT = function( tau ) {
  var x = this.a * tau / this.c;
  return (this.c * this.c / this.a) * ( Math.log( ( Math.exp( 2.0 * x ) + 1 ) / 2.0 ) - x );
}

Weitere Infos zur Seite
Erzeugt Montag, 18. August 2014
von wabis
Zum Seitenanfang
Geändert Freitag, 2. September 2016
von wabis