Computational Thinking : Introduction To Mathematica

in steemstem •  6 years ago  (edited)

Hello fellow Steemians, and budding scientists!!

Have you ever thought how simple the world would be if a program could plot complex curves in a jiffy!! ...and solve all your math problems in seconds?

It will definitely help us in understanding things better if not copying ready-made answers!

Well, welcome to the world of Wolfram Mathematica!!

Mathematica Logo

[Source : https://www.wolframalpha.com/media/, License : Public Domain]


Mathematica 8.0.0 Linux frontend

[Source : [WikiMedia Commons](), Author : By HolyCookie - Own work, CC0, https://commons.wikimedia.org/w/index.php?curid=15202544]

The thing that got me started on the science that I've been building now for about 20 years or so was the question of okay, if mathematical equations can't make progress in understanding complex phenomena in the natural world, how might we make progress?

---Stephen Wolfram---

INTRODUCTION

In the words of Wikipedia :
Wolfram Mathematica is a program which is basically a modern technical computing system spanning most areas of technical computing — including neural networks, machine learning, image processing, geometry, data science, visualizations, and others. The system is used in many technical, scientific, engineering, mathematical, and computing fields. It was conceived by Stephen Wolfram and is developed by Wolfram Research of Champaign, Illinois. The Wolfram Language is the programming language used in Mathematica.

  • History : Wolfram Mathematica built on the ideas in Cole and Wolfram's earlier Symbolic Manipulation Program (SMP). The name of the program "Mathematica" was suggested to Stephen Wolfram by Apple co-founder Steve Jobs although Wolfram had thought about it earlier and rejected it.
  • Uses (https://www.wolfram.com/language/) :
    The Wolfram Language allows programmers to operate at a significantly higher level than ever before, by leveraging built-in computational intelligence that relies on a vast depth of algorithms and real-world knowledge carefully integrated over three decades. Scaleable for programs from tiny to huge, with immediate deployment locally and in the cloud, the Wolfram Language builds on clear principles—and an elegant unified symbolic structure—to create what is emerging as the world's most productive programming language and the first true computational communication language for humans and AIs.

Step-1) Accessing the Software

The software is available as a desktop stand-alone, but can be quite costly.

Here are some of the things you can try :

  1. Buy the original complete version of the software :
  2. Try a 15-day free trial b registering here : https://www.wolfram.com/mathematica/trial/
  3. Create an account and use the free web version which has all the critical features. Here : https://www.wolfram.com/programming-lab/
  4. Start directly online (work will not be saved) : https://lab.open.wolframcloud.com/app/

Step-2) Getting Started

  1. Run Wolfram Mathematica, open a new notebook by using the shortcut keys Ctrl + N.
  2. In the front-end kernel that appears enter "2+2" (without the quotes) and press Shift + Enter to run the cell (contains the input : 2+2) you just created.
  3. Trying simple calculations like `2+2, 2*2, 3*(4+3)/2` : ![]()
  4. Using built-in functions `Sin[x], Cos[x],...` ![]()
  5. The Plot[] function, the syntax is :
    `Plot[{curve-1,curve-2,..},{var-1,min_var-1,max_var-1},{var-2,min_var-2,max_var-2},...]`

    Plotting curves :`Sin[x], x^2` ![]()

  6. Step-3) Plot Function

    1. Basic Plotting : Let's plot Sin[x] from the range [-2Pi,2Pi]once again ![]()
    2. Using the Frame attribute ![]()
    3. Using Gridlines ![]() Adding custom gridlines on x-axis at x=1,3,3.5,7 ![]() Adding custom gridlines on x-axis at y=0.2,0.5,0.7 ![]() Adding gridlines on both x and y-axis at equal intervals of 0.5 ![]()
    4. Plotting multiple curves on a single plot : Let's plot Sin[x] and x*Sin[2*x] ![]() Formatting the graph... ![]()
    5. NOTE : It's very important to tinker with the code on your own, you learn the most by trying the things hands-on!! So, go on!

    Step-4) Making 3-D plots!! : Plot3D Function

    1. Syntax : (the syntax for this function is quite similar to the `Plot` function) `Plot3D[{curve-1,curve-2,...},{var-1,min_var-1,max_var-1},{var-2,min_var-2,max_var-2}]`
    2. Let's plot `Sin[x]*Cos[x]` in the range x=[-Pi,Pi], y=[-Pi,Pi] ![]() Now let's increase our range to x=[-4Pi,4Pi], y=[-4Pi,4Pi] and see what happens! ![]()
    3. Now, let us plot Sin[xy] in the range x=[-Pi,Pi], y=[-Pi,Pi]... ![]()
    4. Now let's combine the two 3D curves we plotted into a single plot... ![]()
    5. Isn't that a very beautiful curve!!


    Now, one may ask what's the use of learning all this!!

    Let us list two uses....
    1. Let's say you are writing a scientific article and need a neat accurate plot/diagram for the article, simply plot the graph on Mathematica, export it and use it!
      ![b.gif]()
    2. Let's say, you are running short of egg-crates for your home, what to do?

      [Source : [Pixabay](https://pixabay.com/photos/eggs-market-crate-chicken-protein-3564193/), Author : Image by Kojooooooo on Pixabay, License : [Pixabay License](https://pixabay.com/service/license/)]

      Model the egg-crate using Mathematica, and print it using your 3-D printer...!!
      ![]()

      There you go!!!

      Isn't that interesting!!?


    That's all for the Introduction, more to come...in the next posts we will learn to do more with Mathematica, and the complexity of the codes will also increase significantly... <br>Don't worry.
    Keep practicing and tinkering!

Extra Help

For any extra help with the code, you can check this site :

https://www.wolfram.com/language/

References

    1. Wolfram Mathematica : https://en.wikipedia.org/wiki/Wolfram_Mathematica
    2. Wolfram Mathematica Language : https://www.wolfram.com/language/

Copyright Declarations

All the photographs, diagrams and images which have not been attributed have been generated by @medro-martin. The copyright belongs to @medro-martin.



Thanks for your time.
Keep Learning
M.Medro
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Aaaah mathematica... I use it a lot. Every single working day. It is a shame it is so expensive, but it is so useful and so powerful!

Yes...that's true.
: )

Check this if you want to see what I did with mathematica ;)

That's very complicated @lemouth!
And what do we say when something doesn't get into our head?? --> "Great Job!"
So, Great Job @lemouth - The Particle Physicist!!
Thanks for sharing...

Best
M.Medro

Ahaha! Then I can say a generic "Thanks for your nice message" as well ^^

Ha-ha!!
You are welcome...

Congratulations @medro-martin! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You published more than 30 posts. Your next target is to reach 40 posts.

Click here to view your Board
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

Carnival Challenge - Collect badge and win 5 STEEM

You can upvote this notification to help all Steem users. Learn how here!





This post has been voted on by the SteemSTEM curation team and voting trail in collaboration with @curie.

If you appreciate the work we are doing then consider voting both projects for witness by selecting stem.witness and curie!

For additional information please join us on the SteemSTEM discord and to get to know the rest of the community!