r/AskProgramming • u/Positive-Stand2898 • Oct 04 '26
How to get better at algorithms and modeling Math Equations in Code?
I’m not a beginner programmer, but I’m relatively new to scientific programming. I’ve recently started doing scientific research with a professor, and a significant part of my work involves writing simulations, modeling physical systems and mathematical equations computationally, and developing algorithms to analyze or reproduce these systems.
I’m interested in becoming much stronger at this side of programming, particularly in areas like numerical methods, computational physics, mathematical modeling, simulation, and scientific computing.
For those of you with experience in scientific programming, what would you recommend as the best way to build these skills? I’d especially appreciate recommendations for textbooks, courses, projects, libraries, or other resources that helped you make the transition from general programming to scientific/computational programming.
I’m comfortable with programming fundamentals, so I’m primarily looking for resources that go beyond the basics and focus on the actual mathematics, algorithms, and computational techniques behind scientific programming.
Any advice or recommendations would be greatly appreciated!
5
u/pgetreuer Oct 04 '26
As you already said yourself, the key area to dig into is numerical methods. The "Numerical Recipes" book is a popular and accessible starting point.
On the math theory side, you'll get mileage in a variety of numerical methods topics by applying Taylor series and fixed-point iteration, appearing for instance in methods for root finding, interpolation, and ODE solvers.
On the coding side, it's useful to understand how IEEE-754 floating-point numbers work, especially wrt. round-off error. If you'd like a deeper reference, a great book on this topic is Michael L. Overton, "Numerical Computing with IEEE Floating Point Arithmetic".
1
u/KC918273645 Oct 04 '26
The book "Numerical Analysis" by Richard L Burder, Douglas J Faires, Annette M Burdern could become handy for you.
1
u/lukiamagi Oct 04 '26
What type of simulation are you doing? There is a wide range of different simulation families and each has their own extensive library of math
1
u/Bustan2026 Oct 04 '26
I don't know how deeply you intend to go. I work in this space and I'm not sure the programming is very different from other fields, but there's math underneath. Also I've only ever worked in this space, so it could be.
If you want to go all the way, a classic studying order might be:
From there, you enter the jungle of modern numerical schemes. Some popular/representative ones are: Discontinuous Galerkin, Boundary Element Method, high-order Finite Element/DG schemes.
On the pure programming side, GPU, MPI and multi-threading of linear algebra methods to start with.
Optimization (e.g. Newton's method) is also something that's often useful in this context.
If you really want to specialize in this in the long term, as a pure CS person, I think your strongest bet are the parallel computing (HPC) aspects which are not always the strong suit of the people well versed in the topics above. They have notions but not necessarily the know-how to implement production grade algorithms that are effectively parallelized, use GPUs and so on.
Some other programming-specific aspects:
I don't have any sources but you can find good textbooks on all these individual topics, and likely on a range of them at once.
1
u/marrsd Oct 04 '26
Can your professor provide you with access to an introductory mathematical modelling course. Sounds like you've got access to a learning resource there!
1
u/Different_Pain5781 Oct 09 '26
CS50x is solid for getting the basic CS stuff down. For scientific modeling though you’ll probably want more practice actually building algorithms in Python. Boot dev has a pretty good backend path with interactive algorithm and data structure practice plus terminal work before getting into the heavier physics side.
-2
u/Nufflee Oct 04 '26
By pointing an LLM to the source material and having it do the work.