Would This be a Good Programming "Physics" Project?

Click For Summary

Discussion Overview

The discussion revolves around the feasibility of a programming project that simulates population dynamics in a hypothetical populated solar system, focusing on demographic movement and density. Participants explore the potential for implementing this project using Python and other programming languages, while considering the underlying mathematical principles and computational challenges involved.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant proposes a project that models population density and movement in a future solar system, utilizing demographic gravitation concepts and visualizing the results in 3D.
  • Another participant suggests that the project is feasible on a personal computer, indicating that Python should be sufficient for handling the required computations, with the option to optimize using C or C++ if necessary.
  • Some participants express skepticism about the project's classification as "physics," noting it aligns more with sociology or social physics, which applies mathematical principles from physics to social phenomena.
  • A participant mentions the potential computational intensity of the project, highlighting that calculating forces between numerous population centers could lead to significant computational demands, suggesting the use of OpenCL for optimization.
  • One participant recommends considering the simulation of differential equations instead of tracking individual entities, while acknowledging that this approach may also be complex.
  • Concerns are raised regarding the assumptions underlying demographic gravitation, particularly its applicability in space where migration dynamics may differ significantly from terrestrial models.

Areas of Agreement / Disagreement

Participants generally agree on the technical feasibility of the project using Python, but there is disagreement regarding its classification as a physics project, with some asserting it leans more towards sociology. The discussion remains unresolved on the implications of applying demographic models to a space environment.

Contextual Notes

Participants note that the demographic gravitation equations may not hold true in a space context, as they assume symmetric migration patterns and do not account for the unique challenges of living in microgravity or the technological assumptions required for space travel.

stefan10
Messages
34
Reaction score
0
I have recently been doing a lot of programming in python for the past year or so, and consider myself to be okay with the language. I also have some experience with mathematical languages like the Wolfram language and Maple. Other than that, I am willing to learn C, C++, or Java for this project (and plan to learn them anyway soon.) I am a physics major in my senior year of undergraduate, and have had training mostly in physics. This would be a project spanning months, and mostly done in my spare time.

Lately I have had a wild imagination, and have been thinking a lot about the population density of a populated solar system in the future. Let's say that the people inhabiting this solar system can live and function well in space (they live on space stations.) The population centers would likely be around planets but maybe also areas with many resources (i.e asteroid belts, moons.) Generally though, the program would allow for somebody to select these as variable initial conditions or maybe they would be dependent on the gravitational mass somehow (disregarding things like the Sun.)

Other than the basic population growth laws, I was also interested in the way people would move from one population center to another. In my research I discovered the following.

https://en.wikipedia.org/wiki/Demographic_gravitation

After reading the article published in 1947 by John Quincy Stewart which approximates demographic movement between population centers using the following formula, I want to apply these "laws" using generalized initial conditions to create a 3D visualization (represented by dots) of population centers and vectors which represent the motion from one center to another (lets say they are low resolution, of the order of "city-stations" with populations of tens of millions and I would have a few hundred or thousands of these.) Since these laws follow a similar form to the gravitational laws I figured the calculations would be similar to gravitational calculations, which I have done in python before.

So basically my question is, do you think I would be able to pull this off with just Python/vPython on the scale I want? Would I need a supercomputer to do this, or can I accomplish this with the resources of a personal computer? I'd imagine that it would come out to be similar to an n-body problem. I haven't done any n-body simulations, and have no idea about the limitations of these. Is my assumption correct?

The following are some of the key equations (with plain English paraphrases) from his article in sociometry:

8670ba5360f5b6f75c2ea29c891ed89a.png

(Demographic Force = (population 1 multiplied by population 2) divided by (distance squared))

780c999ac8758f0ba8e1ca7335ba852e.png

(Demographic Energy = (population 1, multiplied by population 2) divided by distance; this is also Zipf's determinant)

e4301d29ad4771bd0bfebc8f60f9c5be.png

(Demographic Potential of population at point 1 = population at point 2, divided by distance)

6f21d20d09fd69b96241f1f63cfff160.png

(Demographic Potential in general = population divided by distance, in persons per mile)

2b880681f48e0878e0f194ad57f9f542.png

(Demographic Gradient = persons per (i.e. divided by) square mile)
 
Last edited:
Technology news on Phys.org
This sounds like an interesting problem to me. With hundreds of thousands of dots, this should be well within the capabilities of Python running on a laptop. If some part of it is too slow, you could convert that part to C or C++ to speed it up, which you said you wanted to learn anyway. I suggest using Python's OOP capabilities to set it up.
 
  • Like
Likes   Reactions: stefan10
Interesting perhaps, but not really physics.
 
  • Like
Likes   Reactions: stefan10
phyzguy said:
This sounds like an interesting problem to me. With hundreds of thousands of dots, this should be well within the capabilities of Python running on a laptop. If some part of it is too slow, you could convert that part to C or C++ to speed it up, which you said you wanted to learn anyway. I suggest using Python's OOP capabilities to set it up.

Thanks. I am probably going to use a desktop with an i5 4690k and AMD r9 280 (I use this desktop for video games) so it is nice to hear that a common laptop would probably be able to do this. I was also looking into using pyopengl and pyopencl like somebody did in the following video, but I haven't used these before.

Dr. Courtney said:
Interesting perhaps, but not really physics.

Yeah that's why I used the quotation marks. Although it is described as "social physics" which I guess is a term used for sociology that uses a lot of mathematical and computational principles which were developed for physics applications, like there is a field called econo-physics which does the same but instead when applied to economics rather than sociology. The project doesn't need to be a physics one.
 
Dr. Courtney said:
Interesting perhaps, but not really physics.
stefan10 said:
Yeah that's why I used the quotation marks. Although it is described as "social physics" which I guess is a term used for sociology that uses a lot of mathematical and computational principles which were developed for physics applications, like there is a field called econo-physics which does the same but instead when applied to economics rather than sociology. The project doesn't need to be a physics one.
My thoughts were similar to those of Dr. Courtney, in that it seemed more about sociology that physics per se, but if the project doesn't have to be "physics-y" then maybe it's OK.
 
  • Like
Likes   Reactions: stefan10
Mark44 said:
My thoughts were similar to those of Dr. Courtney, in that it seemed more about sociology that physics per se, but if the project doesn't have to be "physics-y" then maybe it's OK.
Yep, the project - if I am able to get it working well, otherwise it will be just for fun - will be for a programming course I am taking this coming semester (it counts as 30% of the course grade), so as long as it fits their requirements it could be any subject. I thought it would be good practice though, because the forms of the laws are based on Newton's Laws of Gravitation, and the guy who came up with these relations was an astrophysicist. I plan to go into a computational physics field when I go to graduate school, probably in astrophysics, so I wanted my project to be somewhat relevant, but not strictly so.
 
I'm with phyzguy as well, on the suitability of Python for your project. You can get a prototype up and running pretty quickly, and then, if needed, you can code the bits that need to run faster in C or C++.

That's easy for me to say, as I have only been working with Python a few months, and haven't done anything with mixing Python and C code. The Python documentation talks about this, I believe, so that would be a good place to start.
 
  • Like
Likes   Reactions: stefan10
If you want to calculate the force between every pair of dots you'd have to solve the equation about n^2 times. So with 10,000 dots you'd need 100,000,000 calculations per simulation step which your processor is able to do in less than a second. Your graphics card however could do the same calculations 100 times faster. So if you manage to use opencl you can have 20,000 dots and still enough simulation steps per second for a smooth animation.
 
  • Like
Likes   Reactions: stefan10
You might want to look at this problem in terms of simulating a set of difference / differential equations rather than tracking individual elements.
PS. After more thought, this suggested approach may be as difficult as your original approach. It seems a lot like computational fluid dynamics, which also requires supercomputers.
 
Last edited:
  • Like
Likes   Reactions: stefan10
  • #10
Dr. Courtney said:
Interesting perhaps, but not really physics.

And the formulas may become invalid if we include physics. It seems the demographic gravitation is based on a symmetric migration in each direction but traveling in space or even from a planet into space and vice versa is highly asymmetric. This need to be included into the equations which requires assumptions about the technology. And it seems that all people are assumed to be equal (for large numbers of human beings) but living in micro gravity requires physical modifications which might result in an isolation of space populations and surface populations. This effect is very hard to estimate. However, this is a very interesting problem. I would be interested in the results for particular boundary conditions.
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
12K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
16
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
86
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
6
Views
3K
  • · Replies 10 ·
Replies
10
Views
2K