Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
Got it working with a little help on the math from my professor! The two main changes were making j conditional so that the calculation runs only when j != i, and also i needed a sign change in front... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 03:17 PM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
Haha, alright I'll keep messing with it. Thanks for all the help so far! I'll post an update if I get anywhere with it. |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 11:17 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
(Jun-14-2017, 10:40 AM)buran Wrote: Is my understanding correct that the F force calculated for each pair, e.g. i=0, j=1 is net, i.e. no need to calculate also for i=1, j=0?Yes, its net.
It didn't o... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 10:58 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
(Jun-14-2017, 08:23 AM)buran Wrote: this way, when i=0, j will take values from 1 to 8
when i=1, j will take values from 2 to 8, etc.
Okay that makes a lot of sense. I just changed Fnet to a vector... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 10:03 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
What would using a nested loop do here? Maybe I'm missing something obvious, but won't it still need an individual calculation for each planet? **confused** |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 07:05 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
(Jun-14-2017, 05:29 AM)Skaperen Wrote: yes, you could do it with separate lists, where a common list index is your system body identification. if you already know Fortran (still in common use in phy... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 05:46 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
Sorry for not making the task clear. I need the program to account for the gravitational effects of each body on every other body. Unfortunately I'm going to have to stick with my original format si... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-14-2017, 05:18 AM |
|
|
Thread: Using an Array in a While Loop
Post: RE: Using an Array in a While Loop
(Jun-13-2017, 08:48 AM)buran Wrote: Very interesting indeed.
I changed your script a bit to make it more easy to understand and follow
from visual import * # I HATE this
myuniv = display(range=ve... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-13-2017, 10:24 PM |
|
|
Thread: Using an Array in a While Loop
Post: Using an Array in a While Loop
I'm trying to model the solar system, with the gravitational effects of each planet interacting with every other planet (including the Sun). So far I have all of the planets orbiting the Sun, but I c... |
|
JakeWitten |
Homework |
22 |
12,027 |
Jun-13-2017, 01:28 AM |
|
|
Thread: error 'ring' is not a callable object
Post: error 'ring' is not a callable object
I'm trying to get the ball to fly through a series of rings, but I keep getting this error message 'ring' is not a callable object. The strange thing is when I run the code, I get a single ring and t... |
|
JakeWitten |
Homework |
1 |
3,062 |
May-02-2017, 04:45 AM |
|
|
Thread: Object moving in a spiral
Post: RE: Object moving in a spiral
I was told by my instructor to put it at the beginning of every code. It imports the necessary module to get a visual display. I didn't know there was any other way to do it; this is my first few we... |
|
JakeWitten |
Homework |
5 |
4,883 |
May-02-2017, 04:31 AM |
|
|
Thread: Object moving in a spiral
Post: Object moving in a spiral
I'm having a hard time figuring out how to get an object (a ball in this case) to move in a spiral. I figured the best way to go about this would be to use polar coordinates for x and z, but I can't ... |
|
JakeWitten |
Homework |
5 |
4,883 |
Apr-22-2017, 04:45 AM |
|
|
Thread: Numerically determining the highest a ball travels when shot straight up
Post: RE: Numerically determining the highest a ball tra...
Thanks! This worked out perfectly. I wasn't sure how to set up an "if" statement before. **biggrin** |
|
JakeWitten |
Homework |
3 |
3,436 |
Apr-21-2017, 04:08 AM |
|
|
Thread: Numerically determining the highest a ball travels when shot straight up
Post: Numerically determining the highest a ball travels...
Hi all, I'm very new to python and I have no prior experience with other coding languages, so my main issues are with the formatting and finding the appropriate vocabulary.
My goal is to determine t... |
|
JakeWitten |
Homework |
3 |
3,436 |
Apr-21-2017, 02:42 AM |