Note that there are some explanatory texts on larger screens.

plurals
  1. POClass or Metaclass Design for Astrodynamics Engine
    primarykey
    data
    text
    <p>Gurus out there:</p> <p>The differential equations for modeling spacecraft motion can be described in terms of a collection of acceleration terms:</p> <pre><code>d2r/dt2 = a0 + a1 + a2 + ... + an </code></pre> <p>Normally a0 is the point mass acceleration due to a body (a0 = -mu * r/r^3); the "higher order" terms can be due to other planets, solar radiation pressure, thrust, etc.</p> <p>I'm implementing a collection of algorithms meant to work on this sort of system. I will start with Python for design and prototyping, then I will move on to C++ or Fortran 95.</p> <p>I want to design a class (or metaclass) which will allow me to specify the different acceleration terms for a given instance, something along the lines of:</p> <pre><code># please notice this is meant as "pseudo-code" def some_acceleration(t): return (1*t, 2*t, 3*t) def some_other_acceleration(t): return (4*t, 5*t, 6*t) S = Spacecraft() S.Acceleration += someacceleration + some_other_acceleration </code></pre> <p>In this case, the instance S would default to, say, two acceleration terms and I would add a the other two terms I want: <code>some acceleration</code> and <code>some_other_acceleration</code>; they return a vector (here represented as a triplet). Notice that in my "implementation" I've overloaded the <code>+</code> operator.</p> <p>This way the algorithms will be designed for an abstract "spacecraft" and all the actual force fields will be provided on a case-by-case basis, allowing me to work with simplified models, compare modeling methodologies, etc.</p> <p>How would you implement a class or metaclass for handling this? </p> <p>I apologize for the rather verbose and not clearly explained question, but it is a bit fuzzy in my brain.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload