Want to learn Mathematica programming

In summary, you should use Mathematica 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.
  • #1
Ishika_96_sparkles
57
22
TL;DR Summary
Self-learning to program for physics.
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?
 
Physics news on Phys.org
  • #2
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
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
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
jedishrfu said:
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
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
jedishrfu said:
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
jedishrfu said:
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
Ishika_96_sparkles said:
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 member 428835
  • #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
Ishika_96_sparkles said:
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
Ishika_96_sparkles said:
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
Dale said:
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
  • Like
Likes member 428835, Ishika_96_sparkles and Dale
  • #18
JD_PM said:
I am also new using Mathematica and Mathematica Stack Exchange looks like a great website to learn from! :smile:

Hi @JD_PM
gR8!
yes i know about the stackexchange.
What are you learning Mathematica for? Physics of some other subject?
:)
 
  • #19
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 Ishika_96_sparkles, JD_PM and Dale
  • #20
joshmccraney said:
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
  • Love
Likes Ishika_96_sparkles and JD_PM
  • #21
joshmccraney said:
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!

Thanks Josh for such encouraging words. Yeah, I stuck to Dale's advise and was happily moving ahead till i got the shock of my life (below). Yes was self -learning using the problems of quantum mechanics and was trying to build the complexity of the program with time.

[Off -topic] Struggling atm with another problem...a few days ago my SSD crashed for no reason. Most of my data was on it as i thought SSDs don't crash! Guess what?! Backup is never a bad idea. So now the only way is data recovery! all my programs and other things are stuck in that black hole of a drive.
 
  • #22
Oh, no. What a terrible feeling. I have been there before, so I empathize
 
  • Sad
Likes Ishika_96_sparkles
  • #23
Dale said:
Oh, no. What a terrible feeling. I have been there before, so I empathize
A very tough lesson to learn, but this is one of those lessons you'll never have to learn twice.
 
  • Like
Likes Ishika_96_sparkles
  • #24
Dale said:
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.

That's why I switched from mathematica to python
As long as you get results you are enthusiastic of mathematica
The problem is when something goes wrong then you are lost
Of course with 25 years experience you can sort it out but for an occasional user it is a nightmare
Python programming is redundant but you grasp any detail so it is easier to find out a solution
 

1. What is Mathematica programming?

Mathematica programming is a high-level computer language used for technical computing and data analysis. It is commonly used in fields such as mathematics, physics, engineering, and finance.

2. Why should I learn Mathematica programming?

Learning Mathematica programming can greatly increase your efficiency and productivity in tackling complex mathematical and computational problems. It also has a wide range of applications in various industries, making it a valuable skill for any scientist.

3. Is Mathematica programming difficult to learn?

Like any programming language, there is a learning curve to mastering Mathematica. However, it has a user-friendly interface and comprehensive documentation, making it accessible to beginners. With practice and dedication, anyone can learn Mathematica programming.

4. Can Mathematica be used for data analysis?

Yes, Mathematica has powerful built-in functions and libraries for data analysis, making it a popular tool among scientists and researchers. It can handle large datasets and perform complex statistical analyses with ease.

5. Are there resources available for learning Mathematica programming?

Yes, there are plenty of resources available for learning Mathematica programming, such as online tutorials, books, and even official training courses offered by Wolfram, the company behind Mathematica. It is also helpful to join online communities and forums for support and to learn from others' experiences.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • STEM Academic Advising
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Programming and Computer Science
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • STEM Academic Advising
Replies
12
Views
1K
Back
Top