Lots of good suggestions in the thread.
I've been through quite a lot of iterations: BASIC in high school; FORTRAN-77 and Mathematica in college; C & gnupplot, tikz & LaTeX (with some batch processing), maxima, maple and Python afterwards. All of them could work, but IMO some of them are more productive than others.
I wouldn't use C for general scientific computing. Too low level, and memory allocation and pointers make things difficult. You need to be a competent C programmer (most people aren't, me included) to write good numerical C. I think the mess with the Imperial College pandemic code is a recent and illustrative example. I've seen things like that before, e.g. choosing bisection as equation solving algorithm because the programmer couldn't, for the life of him, implement Newton-Raphson without random crashes or inconsistent output. Yes, there are good numerical libraries available in C, but that takes us to the next point.
I currently use Python +
Numpy +
Scipy +
Matplotlib when I need numerical work done. Just install Python and then install these libraries following the instructions in the webpages (typically, use pip from the command line). There are also portable scientific pythons ready for download, with all the packages bundled.
Python works well. For example, a couple of weeks ago I wanted to do a quick check on period doubling. I implemented the
Rössler attractor in a few minutes, just modifying an example for a simple dynamical system I found with a search engine. The result:
# Parámetros de Rössler.
a = 0.2
b = 0.2
c = 5.7
# Derivada.
def model(v, t):
xp = -v[1] - v[2]
yp = v[0] + a * v[1]
zp = b + v[2] * (v[0] - c)
return [xp, yp, zp]
# Construir solución completa:
def flujo(v0, t):
v = odeint(model, v0, t)
x = np.zeros(len(v))
y = np.zeros(len(v))
z = np.zeros(len(v))
for k in range(0, len(v)):
x[k] = v[k][0]
y[k] = v[k][1]
z[k] = v[k][2]
return [x, y, z]
t = np.linspace(t0, t1, N) # tiempo
a = 0.2
s2 = flujo([-6,-2,0] , t)
fig = plt.figure()
ax = fig.gca(projection='3d')
ax.plot(s2[0], s2[1], s2[2], label='a=0.2')
ax.legend()
plt.show()
The output (can be freely rotated and magnified, and saved to disk):
Note how the
odeint command in Python uses a very customizable and high performance low level library to integrate the ODE. Python just does the gluing.
I've also used Arduino + Python + serial interface + matplotlib to plot, in real time, the output of a 24-bit ADC. Here is a link to a youtuber who does something similar with arduino's 10- ADC:
It's quite easy to do. Python also runs under window, linux and embedded systems, like raspberry pi and friends. You can mix matplotlib graphs and LaTeX if you want high quality formulas in your graphs.
Another example: I've recently used Python to load a .wav sound file captured with a microphone, and analyzed its spectrum for a simple Doppler effect experiment. Just a few lines of code.
And you don't need to be a Python wizard. I'm neither a competent python programmer.