Ch 1: Introduction to Scientific Computing

Return to all notes

Scientific Computing is

Scientific Computing is not

Where is Scientific Computing Used

Ideas needed to do Effective Scientific Computing

Scientific Computing is generally used to solve problems in Mathematics and various Science fields. There are a number of important things that you need to know to solve problems effectively.

Examples of Scientific Computing

We will look at these an other problems in this course.

Writing Code for Scientific Computing

Look back at the list of requirements for Scientific Computing projects. A general rule of thumb is to use a computing language that you know will work well for those tasks. Typically, most students have learned one or two languages and aren’t quite sure which to use. In most cases it doesn’t matter what to use, but for complex problems it will matter.

One of the best languages for scientific computing has been Matlab over the past 3 or 4 decades. It is used extensively in engineering firms throughout the world (and the headquarters is in nearby ). We won’t be using Matlab here though. One of the nice things about taking a class is exploring new languages. Here we will use Julia, which is a very new language that a lot of people in scientific computing are excited about. We will give examples using Julia, but the ideas here should be applicable to other languages.

This is a general getting started chapter with some specifics that can be run in Julia. To get started with being able to run julia on your own computer, see getting started in julia.

Variables

To get started, we first need to discuss specifics of writing Julia code. Julia has all standard language constructs except for objects, which will be discussed later. The language features include loops, conditional statements, functions. It also has important aspects that make it helpful for scientific computing include robust array functions, complex numbers and rational and higher precision floating points numbers.

The syntax of julia is similar to that of python, although there are fundmental differences in the way julia interprets. In this an later chapters, you may notice that the syntax looks familiar, but it not a assumed any knowledge of python.

Anything can be stored as a variable using the single equal sign like x=6. This is an assignment operator, which creates the number 6 and stores it under the name x.

Mathematical Functions in Julia

Here’s a list of the standard mathematical operations that Julia knows: +,-, * , /,^ (power) as well a large number of functions including: exp (natural exponential); log (natural log); the trig functions sin, cos, tan, csc, sec, cot; the inverse trig functions asin, acos, atan, acsc, asec, acot, and there is a listing of all mathematical functions in Julia

Exercise

Entering the following