# Useful Classes for Computational Physics?

1. Feb 8, 2014

### esuna

I'm an undergraduate Physics major. By next semester I'll be three classes away from a Computer Science minor. I've taken a few programming classes and really enjoyed them(java and C#), so I will most likely be going the theoretical/computational route for grad school.

I've selected some classes to choose from which seem to me like they would be helpful in the computational field. I would be delighted for anyone with experience in the field of Computational Physics to weigh in on which classes may be the most useful:

Numerical Analysis I. Introduction to theory & techniques for computation with digital computers. Topics include: solution of nonlinear equations; interpolation & approximation; solution of systems of linear equations; numerical integration. Students will use MATLAB to study the numerical performance of the algorithms introduced in the course.

Introduction to the Design and Analysis of Algorithms. A detailed treatment of the design, analysis, and complexity of algorithms, including greedy algorithms, divide and conquer, dynamic programming, and limitations of algorithms as problems get larger or more complex.

Optimization Techniques. Introduction to algorithms for finding extreme values of nonlinear multivariable functions with or without constraints. Topics include: convex sets and functions; the arithmetic-geometric mean inequality; Taylor's theorem for multivariable functions; positive definite, negative definite, and indefinite matrices; iterative methods for unconstrained optimization.

Linear Programming. Introduction to finding extreme values of linear functionals subject to linear constraints. Topics include: recognition, formulation, and solution of real problems via the simplex algorithm; development of the simplex algorithm; artificial variables; the dual problem and duality theorem; complementary slackness; sensitivity analysis; and selected applications of linear programming.

Linux/UNIX Programming. This course will prepare students to develop software in and for Linux/UNIX environments. Topics to be covered include basic operating system concepts, effective command line usage, shell programming, the C language, programming development tools, system programming, network programming (client-server model and sockets), and GUI programming.

Software Engineering. Principles, practices and methodology for development of large software systems. Object-oriented principles, design notations, design patterns and coping with changing requirements in the software process. Experiences with modern development tools and methodologies. A team project is an integral part of this course.

Computer Graphics. Principles and techniques of computer graphics. Interactive graphics software development using a modern graphics standard. Topics include: primitives, transforms, clipping, modeling, viewing, rendering, texture, animation and ray tracing. A group project is an integral part of this course.

Thank you in advance. I've been trying to decide which three to take from these courses. Or if anyone has any possible suggestions for classes I did not think of, that is perfectly welcome too.

2. Feb 8, 2014

### Hypersphere

Do you have an idea of what field of physics you are interested in applying the computational methods to? That can affect how likely you are to work with large software systems, how advanced optimization techniques you need or whether you will need to know techniques for parallel computing, for example. That said, a lot of computational physics is basically numerical analysis. If there is a second course in that sequence, consider it as well.

3. Feb 8, 2014

### esuna

At this point I'm thinking probably condensed matter/materials physics. There is a second class on numerical analysis but it looks like it always gets canceled. :(

Out of curiosity, which field of physics relies most heavily on computational methods?

4. Feb 8, 2014

### AlephZero

My pick would be Numerical Analysis, and two from Algorithms, Optimization, and Software Engineering.

"Optimization" is more generally useful than its name might suggest. "Solve the equation(s) Ax = b" and "find the value of x that minimizes |Ax - b|" are two ways of stating the same problem, in real world numerical methods.

Linear Programming isn't very useful for anything except, erm, linear programming. More relevant for econometrics and/or production engineering than physics, IMO.

Linux and Computer Graphics, again, are about those specific topics, and the details will probably be out of date compared with anything you do in real life. Unless you are particularly interested in graphics (and visualization of large data sets is an important practical aspect of experimentation, of course) you can probably pick up what you need later on.

One thing seems to be missing from your course list: numerical methods for solving ODEs and PDEs should be a course on its own, IMO (and if it was, I would pick it).

5. Feb 8, 2014

### esuna

These were the classes I was leaning toward. I haven't read up too much on optimization, but I think you're right about the linux/graphics classes. I could probably just pick that stuff up on my own.

I'll definitely be taking Numerical Analysis, and Algorithms is a pre req for just about all the upper-division CS classes, including Software Engineering, so that is a must as well.

That's the 2nd semester of Numerical Analysis that, according to the schedule, hasn't made in a few years. I'm still hoping to get the chance to take it though.

I'm going to go ahead and plan to squeeze in Numerical Analysis I&II, Algorithms, Optimization, and Software Engineering over the next two years. If I need more time for work or undergrad research than either Optimization or Software Engineering will probably be axed. Thanks for the response!

6. Feb 8, 2014

### Dr Transport

numerical analysis, optimization and linear programming are the only ones i would suggest. the others are topics of interest, but as a professional computational physicist, I'd not recommend them.

7. Feb 8, 2014

### esuna

Thank you for the advice. I've been able to narrow down the most important classes in this area quite significantly. Now, however, I have been given conflicting opinions about linear programming. Since you are a professional in computational physics, would you mind elaborating on the usefulness or importance of any topics that may be learned in the linear programming and optimization classes, to your everyday work?

8. Feb 8, 2014

### AlephZero

I'm a mathematician turned engineer working in industry (with a lot of experience developing software for computational mechanics), not a physicist, so I'm willing to stand corrected on LP.

FWIW, this www.cs.princeton.edu/~rs/AlgsDS07/22LinearProgramming.pdf gives a list of applications - and the only two that I don't even understand what the words mean are the physics and plasma physics ones

9. Feb 8, 2014

### D H

Staff Emeritus
My recommendation: Numerical analysis and algorithms at the top. After that, it's a tossup between optimization and software engineering.

I work with physicists, engineers, and computer scientists. The computer programmers as a group are worse than lousy when it comes to programming anything related to physics and mathematics. The scientists and engineers as a group are lousy when it comes to programming, period. You want to separate yourself from both. Take the numerical analysis class so you can learn the basics of physical / mathematical programming, take the algorithms class so you can learn the basics of computer science.

With regard to linear programming, it's something you can learn if you need it and if you have learned the basics. The mathematics is simple: There exists some cost function that is a linear function of some number of independent variables. There also exist some constraints that are also linear functions of the independent variables. The constraints mean the problem is constrained to a polytope, and the cost function in turn means the optimum occur at vertices (or at polyfaces of the polytope, but you can pretty much ignore that). So it's just a matter of finding an efficient algorithm to find the optimum. The simplex algorithm had long stood as that algorithm. There are better ones now, but simplex is still pretty good.

10. Feb 8, 2014

### Staff: Mentor

Data structures is good too since larger computational models may require some organizational work with the generated data.

11. Feb 8, 2014

### D H

Staff Emeritus
That class is called "data structures" at some schools, "data structures and algorithms" at others, and "algorithms" at yet others. From what I've seen, they're all pretty much the same, with but minor variations.

12. Feb 8, 2014

### Staff: Mentor

and sometimes they are split into two separate classes.

13. Feb 9, 2014

### esuna

So what I gather is that basically numerical analysis is the most important. After that the other classes can't hurt/depend on my personal interests. I'll most likely take the algorithms course next semester. I can't take numerical analysis at all next year because it conflicts with EM I&II on the schedule. Have to wait until senior year. I think I'll take optimization techniques instead of software engineering. Might try to squeeze in linear programming, but it will be tough.

I'm in a class right now called "programming with data structures" that deals with stacks, lists, etc.

You've all helped me narrow my decision down to what will probably be the most useful classes to choose for a minor if I wish to do computational physics. Thank you.

14. Feb 9, 2014

### Dr Transport

we do optimization studies all the time, matter a fact, about 75% of my time is programming for optimized designs, you are always looking for the sweet spot in a design/trade space. As for linear programming, almost all problems must be bounded, this is where it comes in handy.

Not to say that the other topics are not important, but I tend not to look at refining algorithms until I have a solution, then I go about being more elegant and using other techniques to either refine the answer or reduce execution time.

Software engineering, in my line of work, we don't do a lot of that, it is a very small community that uses the codes I develop or help to maintain. Half of the team members are helping to expand the codes and the other half are finding issues that need to be addressed. I tend to look at software engineering as a requirement when you have large teams working a production tool that will be commercialized.

Unix/Linux and computer graphics: you learn them when you need them.....

15. Feb 10, 2014

### esuna

Thank you for taking the time to elaborate. After doing some reading up on optimization, I've decided I will most likely take that class. Looks useful in and out of physics.

16. Feb 10, 2014

### D H

Staff Emeritus
So are algorithms and software engineering.

I'd argue that both are more useful outside of physics (you do have plans for a career outside of physics, don't you?) From what I've seen, they're much harder topics for engineers, scientists, and mathematicians to understand than is optimization. Optimization is easy to self-learn if you have a mathematically oriented mind. As a group, engineers, scientists, and mathematicians write horrendous code. Case in point: The singular value decomposition algorithm in the second edition of Numerical Recipes in C. With a cyclomatic complexity of 73, it is impossible to test all paths through this monstrosity.

17. Feb 10, 2014

### esuna

I see your point. Like I said, I'll be taking algorithms next semester(or at least planning on it). I wasn't suggesting those classes weren't useful. In my still rather short experience as a college student I have noticed that most of the engineering/math/science students I'm in class with blow off their programming courses. The programming students I'm in class with live for computer stuff/programming but hate science and math. I feel sort of like an odd duck having strong interest in both.

So yes I would like to "differentiate myself" from both groups, as you say, and stand out. The plan is also to gain marketable programming skills.