Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Courses First course in numerical methods, struggling!

  1. Feb 12, 2012 #1
    I'm currently taking a course in computational physics/numerical methods. My only background in programming is very basic self-learned python (loops and not much else). We use scilab in this course and will be solving nonlinear systems of equations, numerically solving for the roots of an equation, plotting uncertainties. The course is very fast-paced and most of my classmates are in a similar situation. Any general tips on getting up to speed in a programming language if one has the elementary basics of python down? I was looking forward to this course to get some real scientific programming experience but I wasn't expecting it to be this fast paced.
  2. jcsd
  3. Feb 12, 2012 #2


    User Avatar
    Science Advisor

    Hey Lavabug.

    It might help the members here if you tell us what kind of stuff you are dealing specifically and what language/packages/libraries you are using. Also it would help us to have a background of any math courses you have taken as well as your general mathematical maturity.

    It would also be useful for us to know the context of your learning environment: that is how you are doing the course (part of a degree/community college diploma) as well as a summary of the focus of the course.

    Generally the focus will help determine many answers to your questions: for example if you are focusing on mathematical techniques and understanding/implementation of those techniques then the programming part of the course is more or less not going to be as important as the rest of the material.

    If you gave us some of these answers, I am sure that we will be able to give more specific answers to your questions.
  4. Feb 12, 2012 #3
    We're using scilab, which is an open-source "clone" of matlab or so I am told. This is a 3rd year undergraduate physics course at my university.

    My math background includes: courses in linear algebra, calculus/analysis, multivariable/vector calc, ODEs, complex analysis, fourier series, integral transforms and PDE's.

    The course outline looks like this: systems of equations(point iterations, Newton's method), quadrature & numeric differentiation(interpolation, gaussian quadrature...), integration of DE's: boundary and initial value problems (multi-step method, finite difference...), eigenvalues (power, Jacobi, Hyman, and QR methods), probability & simulations (Monte Carlo method).

    For example, in my first class we wrote codes to solve for the roots of cosx*coshx + 1 numerically and the golden ratio to a certain degree of precision using a while loop, among other things.

    The scilab syntax seems easy enough, I know how to handle matrices/arrays and operate with them but I'm struggling with translating a math problem into a code. It's as if my math knowledge becomes irrelevant.
  5. Feb 12, 2012 #4
    Are you using pseudocode to write out the algorithm for solving the problem before trying to code it? If you do this, it just becomes a matter of using the correct syntax. You may want to peruse the mathsci documentation to see if there is a "getting started with the language" manual.

    Sometimes, if you aren't very familiar with a lot of the constructs of a language, you may not always code things in the most efficient way. That being said, if you get something that works, you can always try to go back and make it more efficient as your knowledge of the language grows. Between PF and your instructor/TA, it should be no problem to ask for help coding things.
  6. Feb 17, 2012 #5
    I kinda in the same situation. I signed up for Numerical Methods And Linear Algebra this summer, is this kinda the same class? I have no programming experience but have self taught the beginnings of linear algebra, should I not take this class?

    MATH 2890 - Numerical Methods And Linear Algebra
    Topics include: matrices, characteristic roots, solution of linear and nonlinear equations, curve fitting, integration, differentiation and numerical solution of ordinary differential equations. MATLAB is introduced and used to analyze problems.
  7. Feb 17, 2012 #6
    I'm happy to report that since I made this thread, I've advanced quite a lot. Seeing the prof during office hours + matlab code on the internet are helping substantially.

    I try to do that, I picked that up from fiddling with Labview in one of my lab courses.

    I'm having some trouble translating expressions like point-iteration methods like Aitken's D2 acceleration, I don't see how they're supposed to work. But I picked up the numerical analysis reference text recommended by my prof and it looks like it'll be helpful. It's Schwarz's "Numerical Analysis: Comprehensive Introduction". If anyone could suggest an even more novice-friendly text to complement my understanding of the methods my course will cover(preferably with scilab/matlab examples), I'd appreciate it.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook