Martin Medro ( マーティン・メドロ ) avatar

Computational Thinking : Introduction To Mathematica

medro-martin

Published: 02 Mar 2019 › Updated: 02 Mar 2019Computational Thinking : Introduction To Mathematica

Computational Thinking : Introduction To Mathematica

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](

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@medro-martin. The copyright belongs to medro-martin@medro-martin.



    Thanks for your time.
    Keep Learning
    M.Medro

    Leave Computational Thinking : Introduction To Mathematica to:

    Written by

    Research Scholar, Artist & Wildlife Photographer. Budding 3D Artist, Singer, Musician and Linguist ( 🇪🇸, 🇩🇪, 🇯🇵, 🇮🇳) . Current favorite hobby : programming pixies! You can find one of them here : @alice-mea . Founder of DNA Project (@dna.org)

    Read more #steemstem posts


    Best Posts From Martin Medro ( マーティン・メドロ )

    We have not curated any of medro-martin's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

    More Posts From Martin Medro ( マーティン・メドロ )