473,406 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to append array:mass=2e30*N.ones((100,1)) to have 3 more bodies with mass 2e32?

I'm pretty new to this but i am making a program to simulate gravitationally interacting bodies. So i have 100 bodies all the same mass and i want to append it so that i have 100 bodies all the same mass and 3 bodies with 100xthe original mass i f you catch my drift? (they are to simulate dense regions such as black holes). my original code looks like this:

mass=2e30*N.ones((100,1))

and i want the new array to be 103 masses with 3 of them with mass 2e32! how do id this?

thanks!
Jan 15 '11 #1
1 1899
dwblas
626 Expert 512MB
You do not assign the same values to 100 different variables. You use the same variable 100 times, usually in a loop. And the same for the larger mass. Assign the larger mass to one variable and use it however many times you wish. Without any code posted there is no way to tell what you are trying to do, so no more can be said.
Jan 15 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Jeffrey Silverman | last post by:
Hi, all. Sorry, first off, for the kidna weird selection of crossposted groups, but this question touches on aspects of discussion in each of the groups. So I have a group of around 500 email...
5
by: Phil Endecott | last post by:
Dear All, I have some code that first populates a std::set, and subsequently does a mixture of tests-for-presence and deletions. As I understand it, populating the set will be O(N log N), since...
0
by: I am Sam | last post by:
Ok I don't know what is the problem with my code But I am trying to build a newsletter that gathers parameters from 3 textbox controls and a Listbox control. The form then queries the event table...
4
by: Frederick Gotham | last post by:
Let's say we want to write a function which calculates the force which earth's gravity exerts on an object of particular mass at sea level. We could start off with: unsigned CalcForce(unsigned...
7
by: Henrootje | last post by:
I have to run a lot of append queries. I have data in tables in old databases that has to be appended to tables in a new database. I made a new database in which I linked the old tables and the...
13
by: HMS Surprise | last post by:
Trying not to be a whiner but I sure have trouble finding syntax in the reference material. I want to know about list operations such as append. Is there a pop type function? I looked in tutorial,...
1
by: lawrence k | last post by:
I'm pulling data out of an FLAC file. There is an embedded image. I'm using the great getId3 library (http://getid3.sourceforge.net ). Among the tags I'm pulling out is a mass of binary data,...
1
by: satyajit911 | last post by:
Hello, I have to mass update 40000 records using SQL. But, this operation locks the table for some while. Can anyone suggest how I can update these records part by part say 500 records at a time....
0
by: jaad | last post by:
Hello all, I am looking for some help on creating 3 different append queries. I have enclosed a copy of my tables so it is easier for you to see what it is I have. As you will see I have a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.