Problems using numarray

S

Sonium

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
multidimensilnal array like data = new body[objects*timeframes] and I'm
looking for something synonymous with numarray.

- Sonium
 
D

Diez B. Roggisch

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
multidimensilnal array like data = new body[objects*timeframes] and I'm
looking for something synonymous with numarray.


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

beliavsky

Sonium said:
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
multidimensilnal array like data = new body[objects*timeframes] and I'm
looking for something synonymous with numarray.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top