Problems using numarray

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sonium

    Problems using numarray

    Hi, I am new to numarray and I'm going to use it in a nummerical
    computation of planet and probe orbits. There for I created a body
    class, representing an gravity affected mass (like a planet or a probe).
    Now I have different bodys each with it's own position, velocity and
    mass that pull each other together by gravity. Based on the previous
    position and velocity I'm now calculating the positions and velocity for
    the next timeframe and so on... So I get a quite high amout of data
    because i have to store (number-of-bodys)*(number-of-timeframe) objects.

    Now, how can I use a numaray to store the body objects? I read the docu,
    but didn't figure out how to solve my problem. In C++ I just created a
    multidimensilna l array like data = new body[objects*timefra mes] and I'm
    looking for something synonymous with numarray.

    - Sonium
  • Diez B. Roggisch

    #2
    Re: Problems using numarray

    > Now, how can I use a numaray to store the body objects? I read the docu,[color=blue]
    > but didn't figure out how to solve my problem. In C++ I just created a
    > multidimensilna l array like data = new body[objects*timefra mes] and I'm
    > looking for something synonymous with numarray.[/color]


    import Numeric
    print Numeric.zeros(( 10, 20), Numeric.Float)

    --
    Regards,

    Diez B. Roggisch

    Comment

    • beliavsky@aol.com

      #3
      Re: Problems using numarray


      Sonium <sonium@gmail.c om> wrote:[color=blue]
      >Hi, I am new to numarray and I'm going to use it in a nummerical
      >computation of planet and probe orbits. There for I created a body
      >class, representing an gravity affected mass (like a planet or a probe).
      >Now I have different bodys each with it's own position, velocity and
      >mass that pull each other together by gravity. Based on the previous
      >position and velocity I'm now calculating the positions and velocity for[/color]
      [color=blue]
      > the next timeframe and so on... So I get a quite high amout of data
      >because i have to store (number-of-bodys)*(number-of-timeframe) objects.
      >
      >Now, how can I use a numaray to store the body objects? I read the docu,[/color]
      [color=blue]
      >but didn't figure out how to solve my problem. In C++ I just created a
      >multidimensiln al array like data = new body[objects*timefra mes] and I'm[/color]
      [color=blue]
      >looking for something synonymous with numarray.[/color]

      I asked a similar question regarding Numeric a few months ago, with subject
      "Numeric array of objects" -- see http://groups.google.com/groups?hl=e...ing.google.com
      for the thread. Probably the syntax is the same for Numeric and Numarray,
      but I have not checked.



      ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
      http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
      ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---

      Comment

      Working...