Want to learn Mathematica programming

  • #1

Summary:

Self-learning to program for physics.

Main Question or Discussion Point

Could anybody already working in Mathematica guide me? I want to learn how to program for physics, to be able to simple models, make graphs for equations, and finally able to solve problems especially Quantum mechanics. Where should i begin? I have never used such 'software?/language?' before. I have a basic knowledge of c++. I have seen a few videos on youtube, however, i need a proper algorithm for self-learning.

Could someone please guide me to tutorials or books for beginners?
Also, what kind of queries are allowed here?
 

Answers and Replies

  • #2
11,823
5,445
Why did you choose Mathematica?

There are other tools such as MATLAB, Python or Julia that can do numerical simulation problems too And perhaps better than Mathematica For some problems.

Unpacking your question:
- you want to learn physics especially quantum mechanics
- you want to learn mathematica
- you want to use mathematica to work through QM Problems

Each of my bullets are basically courses in themselves. There is no particular optimal order. Knowing QM won’t help you to learn programming and knowing programming won’t help you to learn QM.

i suspect you’re hoping that Mathematica will ease you into learning QM by taking away the math difficulties. Sadly, that won’t happen. However, once you know both then the third bullet doing computational physics becomes possible where you can get plots to compare against actual data and do QM research but you need to understand QM and the programming too.

if you do some Google searches you can find online courses in these that can get you jumpstarted in learning about QM. In particular, the Susskind Theoretical Minimum lectures on CM, QM ... and books can help.
 
Last edited:
  • #3
@jedishrfu
I just saw some physics/maths notes (U.S. universities) online that mentioned Mathematica as a part of learning physics. Sadly, at my university its just Matlab(engineers), Fortran and Python available. I have seen videos on youtube and felt it was more visual and perhaps easier to learn for an enthusiast. It is just a subjective feeling. Never heard of Julia. Is it easy to learn? and can make graphs?
 
  • #4
11,823
5,445
Julia is hot right now, it is similar to Matlab in a lot of ways.

in general folks choose MATLAB for number crunching, analysis and plotting. Engineers and scientists love it for that.

Other folks choose Mathematica for its symbolic math capabilities.

Power users might bounce between both depending what they are working on.
 
  • #5
11,823
5,445
Heres the Julia website.

Www.julialang.org

It’s free and it uses the Jupyter notebook approach for doing data analysis that people like. Yes Julia has packages for plotting.

A recent book called Algorithms for Optimization uses Julia examples exclusively.
 
  • Like
Likes Ishika_96_sparkles
  • #6
Julia is hot right now, it is similar to Matlab in a lot of ways.

in general folks choose MATLAB for number crunching, analysis and plotting. Engineers and scientists love it for that.

Other folks choose Mathematica for its symbolic math capabilities.

Power users might bounce between both depending what they are working on.
So, how do i start learning Julia? what would be a good programming platform? Considering the fact that i have never even worked in Matlab! and where could i find simple programs for self -learning?
 
  • #7
11,823
5,445
You can find tutorials on YouTube to get started. One you tuber is pretty good Derek Banas But I’m not sure if he has a tutorial on Julia.

Edit: looks like he has one

 
  • #8
You can find tutorials on YouTube to get started. One you tuber is pretty good Derek Banas But I’m not sure if he has a tutorial on Julia.

Edit: looks like he has one

Alrite! I shall give it a try. TUVM :)
 
  • #9
29,606
5,904
There are other tools such as MATLAB, Python or Julia that can do numerical simulation problems too And perhaps better than Mathematica For some problems.
I disagree with this recommendation. For learning physics the symbolic computations are much more important than the numerical ones. That is where Mathematica shines. Mathematica can also do all of the numerical computations too, just perhaps not as fast as Matlab.
 
  • #10
29,606
5,904
Summary:: Self-learning to program for physics.

Where should i begin? I have never used such 'software?/language?' before. I have a basic knowledge of c++. I have seen a few videos on youtube, however, i need a proper algorithm for self-learning.
Just use it. In your class use it for homework (unless that is not permitted). When you get stuck, hit F1 and read the online documentation.

Since you already have some programming experience learning a new language is easy. The basic tips to get started in Mathematica are

Built in functions are always capitalized: Cos or DiracDelta

Function calls always use [ ] lists use { } and ( ) is for order of operations.

Indexing uses [[ ]] and Mathematica is 1 indexed meaning the first element in a list is listname[[1]]. listname[[0]] returns the type of listname

That and the documentation should be enough to get started.
 
  • Like
Likes joshmccraney
  • #11
@Dale
That's what I felt about Mathematica. The symbolic calculations helps one see things more concretely (especially needed for physics) without bothering about various intricacies of programming.

Here is what i found on Google and shall be my starting point.
Anything else you would like to suggest?

Thanx a lot for encouraging words!
 
  • #12
@jedishrfu

i suspect you’re hoping that Mathematica will ease you into learning QM by taking away the math difficulties. Sadly, that won’t happen. However, once you know both then the third bullet doing computational physics becomes possible where you can get plots to compare against actual data and do QM research but you need to understand QM and the programming too.
umm...maybe i should elaborate upon my intention to study programming in a clearer way. I intend to learn things side by side. Like if i am learning wave mechanics now, then i want to be able to solve problems in 1-D potential and other such differential equations numerically and be able to plot various possibilities. Just playing around with parameter changes and see it graphically.

This is like a toddler takes a few simple steps before she learns to walk and later run.

I just want to have fun while learning programming and not a steep learning curve that makes me loose enthusiasm or deters me from doing it altogether. I am an undergrad student and want to pursue physics as a graduate too. :smile:
 
  • #13
29,606
5,904
Anything else you would like to suggest?
Make sure your keyboard has a functioning F1 key. I have been using Mathematica for 25 years and I still use the included documentation every time I sit down with it.
 
  • #14
@Dale

:biggrin: Sure will do!
Even if i have to do a key binding for that. I think its a default key. I have got hold of Mathematica 10. I think it would still have F1 key linked to Help with documentation.

Query: How do i post questions? pasting specific code lines (with a brief outline) or attaching .nb file? I shall be confronted with lots of issues once i start coding for the partial differential equations of wave mechanics. MeThinkSo.
 
  • #15
29,606
5,904
How do i post questions? pasting specific code lines (with a brief outline) or attaching .nb file?
Probably best to post specific lines of code. It should be self-contained so that it runs without external definitions, and as simple as possible to reproduce the error.

Physics Forums has a “code” tag that you can use to preserve formatting and make it look right
 
  • #16
Probably best to post specific lines of code. It should be self-contained so that it runs without external definitions, and as simple as possible to reproduce the error.

Physics Forums has a “code” tag that you can use to preserve formatting and make it look right
Got it! tnx
 
  • #17
734
68
  • Like
Likes joshmccraney, Ishika_96_sparkles and Dale
  • #19
joshmccraney
Gold Member
1,934
96
Hi Ishika

I use both, actually for the same problem: Mathematica to build matrices via some tricky numerical integration over exotic functions and MATLAB to crunch the numbers once matrices are built. Dale is one of the power-users they referenced earlier. The advice he gave is perfect: best way to learn it is use it day-to-day. Difficult to learn a language because you want to: much easier because you need it.

Good luck!
 
  • Like
Likes JD_PM and Dale
  • #20
29,606
5,904
Difficult to learn a language because you want to: much easier because you need it.
Very true. I took a programming class for c and didn't feel that I had learned c. I took a numerical methods class and used c and felt like I learned it quickly.
 
  • Like
Likes JD_PM

Related Threads on Want to learn Mathematica programming

Replies
17
Views
3K
  • Last Post
Replies
4
Views
2K
Replies
1
Views
1K
Replies
8
Views
3K
Replies
1
Views
3K
Replies
4
Views
2K
Replies
4
Views
3K
Replies
11
Views
4K
Replies
10
Views
11K
Top