introduction to

Scientific Computing

About the Course

it's kinda obvious from the course title, but here's what i hope you learn in this course

Course Goals

  1. I want you to gain a basic, enduring understanding of the core elements of Python.
  2. I want to work toward developing a careful, systematic, and effective programming style.
  3. I want you to learn about a number of ways that programming is used to solve different sorts of scientific problems.
  4. I want you to gain experience creating, implementing, and testing programs.
  5. I want you to experience the challenge and excitement of creating and implementing your own programs.
  6. I want you to leave this course with the background and skills to further your working knowledge of Python and other programming languages.

some thoughts on why you might want to learn to code, although you probably already know that programming is awesome

Why Code?

  • Programming is useful. Some basic programming skills are useful in almost any field of science, and the necessity of knowing programming will almost surely increase over time. Almost everyone I know doing good and interesting research in math or physics has at good (or better) programming skills. Programming is also very useful for some areas of the social sciences and increasingly in the humanities and arts.
  • Programming is an act of creation. A successful program involves thinking up something and making it real. The result is a thing that works and is useful. In this sense programming is much closer to engineering or art than it is to science.
  • Computer science teaches problem solving. At its core, computer science is the study of algorithms: methods of solving problems which can be automated. This study prepares students to solve all sorts of problems, not just those involving computers. The structured study of algorithms also positions students to more fully understand the limitations associated with algorithmic methods.
  • There is a tremendous value to the intellectual discipline demanded by programming. Successful programming takes patience, practice, organization, and a tremendous attention to detail. Good programmers must simultaneously have a sense of the big (or at least medium) picture about the problem they're trying to solve and also have mastered a considerable body of detailed technical information. This combination of skills will help students in many different endeavors. Also, I think the attention to detail required in programming is something that you're not likely to encounter in many other COA classes.
  • Programming is fun. The challenge of designing and implementing an algorithm is exciting. There is a great satisfaction associated with coming up with an idea and then making it work. Also, the focus demanded by programming is, for many, very healthy and almost therapeutic.
  • Programmers are fun. My experience has been that programmers are a very interesting and intellectually diverse lot.

some musings on how to learn how to code and also some general ruminations on this course

How to learn Programming

  • The only way to learn programming is to do it. A lot. I suppose that this is true about learning just about anything. But it seems somehow more true for programming than some other areas.
  • I think that a key to meeting the goals of this course is to start fast. I want to dive right in and have you do a lot of basic programming in the first few weeks.
  • This class likely will be a lot of work at times. It is difficult to estimate how long it takes to complete a programming exercise. This is the nature of programming. Sometimes a program works on the first try. Other times it may take days. Learning to struggle and cope with this is part of the course.
  • Particularly at first, you won't understand everything. I think the best thing to do is to blast ahead anyway. When learning a spoken language, it is inevitable that you'll have to use grammatical constructions that at first you don't understand. Only after you've learned quite a few things does the logic of the language come into view. I think learning a programming language is similar. Don't feel like you have to be perfectly comfortable with one chapter before going on to the next.
  • If you're not keen on python, don't worry. Once you know one language it is relatively easy to pick up an additional language. (Learning to program isn't the same thing as learning a particular language.)
  • Some of the programming exercises might be a little tedious. But this tedium should pay off; you'll gain skills and have working code that you can use and re-use.
  • A key goal of this class is to develop an organized, clear style. Having a well put together piece of code is more important than just getting the thing to work. A poorly constructed program may work once, if you're lucky, but will lead to sadness and confusion later on. Don't be this guy.
  • Programming is an art as much as a science. Effective programming involves creativity and originality; it is not simply a technical skill.
  • Programming is also a "state of mind." To program effectively requires patience, focus, and motivation.

nuts and bolts and further thoughts on the class

About this Course

  • I haven't taught this class before, so I'm not certain how it will go. I'm not worried, though. It may take us a little while to find the right pace and fine-tune class structure.
  • What we learn in this class will build on itself, so it's extremely important that you don't fall behind.
  • There will be more or less weekly assignments that you'll turn in.
  • Class time will be a mix of me presenting math and science, me presenting programming concepts, and me presenting examples that you can then try. You should bring your laptop to every class.
  • I'd like to do some sort of small final project toward the end of the term. I'm thinking that this may be a group project, where give you a handful of different topics to work on. We'll discuss this in class and revisit this issue during the midterm check-in.
  • Your evaluation will be based roughly as follows:
    Homework 65%
    Class participation, including short exercises to be shared in class. 15%
    Project/final exercise 20%

collaboration vs copying, and other details

Homework

  • Any code that you submit should be uploaded to our shared google drive. Please don't email me code. Thanks.
  • On the one hand, coding is a solitary activity. You need to learn how to write code on your own. On the other hand, coding is a collaborative activity; one often discusses ideas and strategies with friends and colleagues. Additionally, one sometimes grabs snippets of code from the web or even an entire program.
  • Try to do as much coding on your own as possible. Especially in the first half of the course, write from scratch, or by starting with code we work on together in class.
  • Never hesitate to talk about coding ideas or challenges or strategies with others. It's ok to get help debugging, but resist the urge to get help immediately every time. Debugging is an important skill. As the course progresses, you'll get better at it.
  • If you share code with others, that's ok, but I'd encourage you to not do this often. If you do look at others' code and/or look at code on the web, be sure to cite your sources via comments in your code. If at all possible, make sure you understand the code you use. Sometimes that's not possible, in which case you should note as much via a comment in your code.