One of the many challenges at university, studying applied mathematics, has been finding tools for efficiently solving mathematical and algorithmic problems, and documenting them using a computer. This post covers how to improve your workflow for these kinda of problems using the capabilities of modern code editors and programming languages. These will increase your productivity and make problem-solving more fun and documenting easier.
The list of software and tools we are going to be using
- Atom is modern, cross-platform code editor built using web technologies. The use of web-technologies allows Atom to be extensible, customizable and it enables lots of useful features to work.
- Julia is high-level, a high-performance dynamic programming language for numerical computing.
- Pandoc is a tool for converting markup formats into another.
- Markdown is a lightweight markup language with plain text formatting syntax. Markdown is commonly used to write web content such as blog posts or documentation. Markdown files can be converted into HTML for web documentation or PDFs via Pandoc.
- LaTeX is a high-quality typesetting system, designed for the production of technical and scientific documentation. LaTeX is required for creating PDFs from Markdown using Pandoc. This is useful for creating handouts from assignments.
Add Julia, Pandoc, and LaTeX to the path if they were not added to the path during installation.
Packages are what gives Atom its powers. Packages can be added from
Edit > Preferences > Packages. Here is a short list of the packages that are needed:
latex-completions(This does not work with markdown files when language-markdown is enabled. I don’t yet know how to fix it. Works fine otherwise.)
hasklig(optinal but improves readability of Julia code since Julia uses similar syntax as Haskell for some operations)
markdown-preview-plususes Pandoc to preview markdown files. This enables support for equation through
mathjaxand support for citations through
Some configurations you should configure in the plugins
One of my favorite ways to practice algorithmic problem solving is Project Euler. Project Euler contains various problems that require both programming and mathematical skills to obtain a solution, especially for the harder problems.
<problem>.jl: Write the algorithm into the Julia file. Common pattern to write the
- Write the actual algorithm. Julia has a lot of useful properties for mathematical programming which can be found by reading documentation.
assert(...)to test that your algorithm works for example values that were given in the problem description.
@timemacro to receive running time and allocated memory. Be sure to do this after compiling the function once to obtain a good measurement.
<problem>.md: Write the relevant mathematics into the markdown file. Use markdown preview to preview the HTML version. This is optional but useful for complicated problems.