Ideas for a physics or math programming project?

In summary, a student is looking for ideas for a programming project in their physics and math class. They are open to using any programming language and want the project to be challenging and demonstrate the use of computing resources. Some initial ideas were shared, such as implementing DFT with pseudo-potentials or using tight-binding to compute bands in solids. Another suggestion was to find a project to work on with others, such as solving a dog scramble puzzle using C#. The student is also open to helping others with their programming problems if they are interested.
  • #1
JorgeM
30
6
Hello!

I am going to make a project for my programming class.
So I am just looking for some ideas about what can I make my project about. I mean, I try to make something that would have an special significance for PHYSICS or even MATH (Modeling or solving) , and something that would be a challenge for myself and really represent the really advantages of using computing resources (Not something like a calculator for parabolic movements or whatever).
I can use most of the programming languages .
Hope that you would help me because I haven´t realized yet something interesting... :/
Thanks for your advice.

JorgeM.
 
Technology news on Phys.org
  • #2
Welcome to the PF. :smile:

Can you share some of you initial ideas so far? What areas of Physics and Math interest you the most? It's hard to make suggestions without knowing more about your interests, and your experience with various numerical methods used in modeling software...
 
  • Like
Likes QuantumQuest and scottdave
  • #3
What type of application is it supposed to be... a program that somebody would run and give some inputs? A real time simulation? An app that somebody can install on their phone?
 
  • #4
What ideas for deciding on a programming project, from my own viewpoint, depends on your own actual-life experiences, especially if you have worked in a job. When life comes at you and YOU want a good efficient way to handle information or data, then you imagine your own goals or aims or objectives for what YOU want to be able to do.

My own experience was only very very slight regarding computer programming and I only knew some BASIC. I only had ONE introductory course formally and nothing more - NOTHING MORE! Three decades after graduating, I finally came up with and created a word-lister and word-frequency categorizing program, but nobody asked me for it. It was just an idea that came to me while I had briefly returned to school for an isolated semester while taking a culture&humanities course. I also created a lab-session time counter, text-menu controlled which would take user input of lab time for each lab session attended and count the time in hours - meant for individual student-as-user usage. (The idea was to be able to keep track of lab-time and count it all, in case the institution itself did not count the lab time correctly - and at the time, I did not know how to do this with Excel).

I should also include that about two decades after graduating, I spent time relearning BASIC in a somewhat popular , easy-to-learn form of BASIC with the help of a online community and some of its tutorials and a couple of OLD books on BASIC. This relearning itself took a few years. I needed to do this new and re-learning before I could create some useful programs. (The form of BASIC works in Windows.)
 
  • #5
Well, you should be more specific about what you want. For example, what's your level? What's the programming class about?
You can get some ideas from my blog: https://compphys.go.ro
The described projects are open source and available on GitHub.

There are a lot of things you could do, depending on your level. Just a couple of hints, among countless possibilities:

Implement DFT with pseudo-potentials to compute a molecule.
Use tight-binding to compute bands in some solids.
 
  • #6
Some of my friends and I are currently working on solving a “dog scramble puzzle” using C#. The puzzle is a commercially available item available on Amazon. The puzzle features 9 squares laid out in tic- tac-tie fashion. There are upper and lower halves of 4 different dog breeds, one along each edge of each square. The idea is to lay the squares out so that upper and lower halves of the dogs match up on all adjacent edges. The answer to this puzzle is unique, and there are 10s of billions of possible layouts, so working out a direct explicit algorithm is challenging.
 
  • Like
Likes JorgeM
  • #7
You might scan through the computer questions in this forum and see if there is someone working on a problem that you can help with. Contact them and see if they can use some help, but make sure that you are ready to put in the effort that they will expect.
 
  • #8
Chestermiller said:
Some of my friends and I are currently working on solving a “dog scramble puzzle” using C#. The puzzle is a commercially available item available on Amazon. The puzzle features 9 squares laid out in tic- tac-tie fashion. There are upper and lower halves of 4 different dog breeds, one along each edge of each square. The idea is to lay the squares out so that upper and lower halves of the dogs match up on all adjacent edges. The answer to this puzzle is unique, and there are 10s of billions of possible layouts, so working out a direct explicit algorithm is challenging.
There were several puzzles like that years ago and I wrote a Perl program to solve them. I don't know if I still have it.

PS. I just looked up the program and the first test case was a dog puzzle. I bet it's the same one. Looking at the code, I now wish that I had documented it better.
 
Last edited:
  • #9
Post #4: I misunderstood. Question was about Physics or Mathematics programming.

I made a prime-number factorization program, many years ago.
 
  • #10
Maybe something to do with optics? Since your profile information says, "Favorite Area of Science: Optics/Computing".
 
  • #11
Chestermiller said:
Some of my friends and I are currently working on solving a “dog scramble puzzle” using C#. The puzzle is a commercially available item available on Amazon. The puzzle features 9 squares laid out in tic- tac-tie fashion. There are upper and lower halves of 4 different dog breeds, one along each edge of each square. The idea is to lay the squares out so that upper and lower halves of the dogs match up on all adjacent edges. The answer to this puzzle is unique, and there are 10s of billions of possible layouts, so working out a direct explicit algorithm is challenging.
For me, the hardest part was representing the problem in a way that a computer language could deal with it. I would be interested in seeing how you end up doing it in C#. I can send you my Perl code if you like, but I need to add some comments first so that I understand what I did.
 
  • #12
FactChecker said:
For me, the hardest part was representing the problem in a way that a computer language could deal with it. I would be interested in seeing how you end up doing it in C#. I can send you my Perl code if you like, but I need to add some comments first so that I understand what I did.
Before discussing this fun problem in detail, I would like to get some assurance from the OP that this will not be the project he selects. The last time this member was seen on PF was on Tues at 8 am. I'm hoping he will respond soon. Let's give him until Sunday, and, if he doesn't respond by then, we can begin to discuss. I will start a new thread called Dog Scramble puzzle.

Here is some background. My grandson is a junior in HS with a keen interest in computer programming. He has taught himself C#, and has lately been solving some interesting problems involving extracting desired data out of online data bases. My son is a banking executive who has been learning R. I am new to this (my background is in Fortran), but they have been describing to me what they are doing in their codes, and my head has been spinning. So I decided to try to learn C# in order to better follow them. We all thought it would be fun to work on the Dog Puzzle in order to sharpen our skills on a focus problem. So my grandson and I each decided to try to solve it using C#, and my son decided to try to solve it in R.

I did not feel my C# skills were anywhere close to the level where I could attack the problem deterministically (I'm still struggling with the syntax), so I decided to try a random approach. My son solved it with R deterministically (and, might I add, very skillfully). My grandson has still to implement his attack on the problem, but he is currently working on converting my son's R program to C#.
 
  • Like
Likes FactChecker
  • #13
Chestermiller said:
My grandson is a junior in HS with a keen interest in computer programming. He has taught himself C#, and ... my head has been spinning.
Ha! Those young whipper-snappers really run rings around old people like me. I'm surprised that your son solved it with R. I can't imagine how. I would be very interested in that.
 
  • #14
FactChecker said:
For me, the hardest part was representing the problem in a way that a computer language could deal with it. I would be interested in seeing how you end up doing it in C#. I can send you my Perl code if you like, but I need to add some comments first so that I understand what I did.
Regardless of choice of language, a person at the beginning of learning programming might/would/should make a flow-diagram and convert this directly into code. I wonder if this method or technique has gone out-of-fashion?
 
  • #15
symbolipoint said:
Regardless of choice of language, a person at the beginning of learning programming might/would/should make a flow-diagram and convert this directly into code. I wonder if this method or technique has gone out-of-fashion?
I agree. However, in this example problem, I think that the trick is to represent the geometry of the cards and the pictures in a way that the computer can understand and work with. That is not the same as a flowchart of the code. Once I figure out how I represented the geometry, the code should be fairly straightforward.

PS. In deference to @Chestermiller 's request to not discuss this problem in too much detail now, I don't want to describe what I did at this time. And I don't know if my description would make much sense to anyone who has not seen the puzzle.
 
Last edited:
  • #16
Chestermiller said:
Before discussing this fun problem in detail, I would like to get some assurance from the OP that this will not be the project he selects. The last time this member was seen on PF was on Tues at 8 am. I'm hoping he will respond soon. Let's give him until Sunday, and, if he doesn't respond by then, we can begin to discuss. I will start a new thread called Dog Scramble puzzle.

Here is some background. My grandson is a junior in HS with a keen interest in computer programming. He has taught himself C#, and has lately been solving some interesting problems involving extracting desired data out of online data bases. My son is a banking executive who has been learning R. I am new to this (my background is in Fortran), but they have been describing to me what they are doing in their codes, and my head has been spinning. So I decided to try to learn C# in order to better follow them. We all thought it would be fun to work on the Dog Puzzle in order to sharpen our skills on a focus problem. So my grandson and I each decided to try to solve it using C#, and my son decided to try to solve it in R.

I did not feel my C# skills were anywhere close to the level where I could attack the problem deterministically (I'm still struggling with the syntax), so I decided to try a random approach. My son solved it with R deterministically (and, might I add, very skillfully). My grandson has still to implement his attack on the problem, but he is currently working on converting my son's R program to C#.
This backtracking algorithm scramble squares solution paper includes a Java implementation. That paper is referenced in this expository paper, which discusses graph-theoretic approaches to the problem more generally.
 
  • #17
sysprog said:
This backtracking algorithm scramble squares solution paper includes a Java implementation. That paper is referenced in this expository paper, which discusses graph-theoretic approaches to the problem more generally.
These papers pretty much give away the set-up methodology that both I and my son arrived at independently. So, the OP should stay away from looking at them if he ultimately decides to make this puzzle his project.
 
  • #18
Chestermiller said:
These papers pretty much give away the set-up methodology that both I and my son arrived at independently. So, the OP should stay away from looking at them if he ultimately decides to make this puzzle his project.
I think that's a good point -- perhaps it was a bit careless or hasty of me to post those links without observing your "Let's give him until Sunday" dictum, as FactChecker did, but I did label the first paper as a solution, and I don't think that my noting the problem to be susceptible to backtracking and graph-theoretic approaches is too much of a giveaway -- kudos to you and your son on solving the problem without such hints or references, and after your grandson follows suit, I'd be interested to see your followup post.
 
  • #19
aaroman said:
Well, you should be more specific about what you want. For example, what's your level? What's the programming class about?
You can get some ideas from my blog: https://compphys.go.ro
The described projects are open source and available on GitHub.

There are a lot of things you could do, depending on your level. Just a couple of hints, among countless possibilities:

Implement DFT with pseudo-potentials to compute a molecule.
Use tight-binding to compute bands in some solids.

Hello there!. I have seen your blog and has a lot of interesting projects. I am going to check if I can figure out how may I do some of these ones because it is the kind of things I would like to program as a phycicist . Anyways, I think the ones that you describe I am going to try for my own, not for the school.
I am going to check all the projects on weeckend and tell you what I would choose.
Thanks for your help!
 
Last edited by a moderator:
  • #20
Chestermiller said:
Before discussing this fun problem in detail, I would like to get some assurance from the OP that this will not be the project he selects. The last time this member was seen on PF was on Tues at 8 am. I'm hoping he will respond soon. Let's give him until Sunday, and, if he doesn't respond by then, we can begin to discuss. I will start a new thread called Dog Scramble puzzle.

Here is some background. My grandson is a junior in HS with a keen interest in computer programming. He has taught himself C#, and has lately been solving some interesting problems involving extracting desired data out of online data bases. My son is a banking executive who has been learning R. I am new to this (my background is in Fortran), but they have been describing to me what they are doing in their codes, and my head has been spinning. So I decided to try to learn C# in order to better follow them. We all thought it would be fun to work on the Dog Puzzle in order to sharpen our skills on a focus problem. So my grandson and I each decided to try to solve it using C#, and my son decided to try to solve it in R.

I did not feel my C# skills were anywhere close to the level where I could attack the problem deterministically (I'm still struggling with the syntax), so I decided to try a random approach. My son solved it with R deterministically (and, might I add, very skillfully). My grandson has still to implement his attack on the problem, but he is currently working on converting my son's R program to C#.
Hi! I am here. Friday at 11:05 am. Your project sounds really interesting because of the fact that when the computer solve something like that it starts to show how much a computer can do. Millions and millions of possibilities and the computer does not care about it. I would like to take part of this challenge as project!
 
  • Like
Likes FactChecker
  • #21
symbolipoint said:
Post #4: I misunderstood. Question was about Physics or Mathematics programming.

I made a prime-number factorization program, many years ago.
Thanks for your advise! . I have already made one of this a couple months ago as homework
 
  • #22
JorgeM said:
Hi! I am here. Friday at 11:05 am. Your project sounds really interesting because of the fact that when the computer solve something like that it starts to show how much a computer can do. Millions and millions of possibilities and the computer does not care about it. I would like to take part of this challenge as project!
OK. If you make that your project, we will refrain from discussing it here. The real challenge on this problem is to figure out how to solve it deterministically.
 
  • #23
The first program involving any math or science was a practical voltage or current source converter, too easy.
The last program involving math or science I did was a dice simulator, that gives you all possibilities for 2 and 3 die rolls. You can enter (only valid) pairs of tuples or triples that represent events and the program will calculate the probability and print them, or for sums, you can also "roll" the dice as many times as you want and outcomes are printed, some other concepts of variance, averages are also included.
I think you can try that, as it is relatively simple set theory and programming, though creating the sample space was the hardest part for me, everything else is fairly straightforward. The knowledge of data structures, data types and algorithms is essential but most things can easily be outsourced to external libraries or utils and people think they know programming and informatics based on them hehe.
TDAF92Q.png

Other simple solutions, just apply any mathematical algorithm or formula, eg SLEs, differential equations, force additions using phasors, etc.
 

Attachments

  • TDAF92Q.png
    TDAF92Q.png
    4.1 KB · Views: 1,448
Last edited:

1. What are some good project ideas for learning about physics or math through programming?

Some good project ideas for learning about physics or math through programming include creating simulations of physical systems, creating games that incorporate mathematical principles, or developing algorithms for solving complex equations.

2. What programming languages are best for a physics or math project?

The best programming languages for a physics or math project will depend on the specific project and personal preference. However, some commonly used languages in these fields include Python, MATLAB, and C++.

3. How can I make my physics or math project interactive?

You can make your physics or math project interactive by using a graphical user interface (GUI) or incorporating user input to manipulate variables or parameters in your program. This can make the project more engaging and allow for experimentation and exploration.

4. Do I need to have a strong background in physics or math to create a programming project in these fields?

While having a strong background in physics or math can certainly be helpful, it is not necessary to create a programming project in these fields. With resources such as online tutorials and documentation, you can learn the necessary concepts and apply them to your project.

5. Can I use existing libraries or code for my physics or math project?

Yes, you can use existing libraries or code for your physics or math project. In fact, many programming languages have libraries specifically designed for scientific computing and math operations. However, make sure to properly cite and credit any code you use from external sources.

Similar threads

  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
5
Views
959
  • Programming and Computer Science
Replies
11
Views
2K
  • Programming and Computer Science
Replies
1
Views
706
  • Programming and Computer Science
Replies
10
Views
1K
Replies
8
Views
350
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
1
Views
1K
Back
Top