The best articles by Ciro Santilli Updated +Created
These are the best articles ever authored by Ciro Santilli, most of them in the format of Stack Overflow answers.
Ciro posts update about new articles on his Twitter accounts.
A chronological list of all articles is also kept at: Section "Updates".
Some random generally less technical in-tree essays will be present at: Section "Essays by Ciro Santilli".
Computational physics Updated +Created
The intersection of two beautiful arts: coding and physics!
Computational physics is a good way to get valuable intuition about the key equations of physics, and train your numerical analysis skills:
FreeFem Updated +Created
Started in 1987 and written in Pascal, by the French from Pierre and Marie Curie University, the French are really strong in numerical analysis.
Ciro wasn't expecting it to be as old. Ported to C++ in 1992.
The fact that French wrote it can be seen in the documentation, for example doc.freefem.org/tutorials/index.html uses file extension mycode.edp instead of mycode.pde where dep stands for "Équation aux dérivées partielles".
Besides the painful build, using FreeFem is relatively simple, as can be seen from the examples on the website.
They do use a domain-specific language on the examples, which appears to be the main/only interface, which is a bad thing, Ciro would rather have a Python API as the "main API", which is more the approach taken by the FEniCS Project, but so be it. This domain-specific language business means that you always stumble upon basic stuff you want to do but can't, and then you have to think about how to share data between the simulation and the plotting. The plotting notably is super complex and they can't implement all of what people want, upstream examples often offload that to gnuplot. This is potentially a big advantage of FEniCS Project.
It nice though that they do have some graphics out of the box, as that allows to quickly debug common problems.
Uses variational formulation of a partial differential equation, which is not immediately obvious to beginners? The introduction doc.freefem.org/tutorials/poisson.html gives an ultra quick example, but your are mostly on your own with that.
On Ubuntu 20.04, the freefem is a bit out-of-date (3.5.8, there isn't even a tag for that in the GitHub repo, and refs/tags/release_3_10 is from 2010!) and fails to run the examples from the website. It did work with the example package though, but the output does not have color, which makes me sad :-)
sudo apt install freefem freefem-examples
freefem /usr/share/doc/freefem-examples/heat.pde
So let's just compile the latest v4.6 it from source, on Ubuntu 20.04:
sudo apt build-dep freefem
git clone https://github.com/FreeFem/FreeFem-sources
cd FreeFem-sources
# Post v4.6 with some fixes.
git checkout 3df0e2370d9752801ac744b11307b14e16743a44

# Won't apply automatically due to tab hell.
# https://superuser.com/questions/607410/how-to-copy-paste-tab-characters-via-the-clipboard-into-terminal-session-on-gnom
git apply <<'EOS'
diff --git a/3rdparty/ff-petsc/Makefile b/3rdparty/ff-petsc/Makefile
index dc62ab06..13cd3253 100644
--- a/3rdparty/ff-petsc/Makefile
+++ b/3rdparty/ff-petsc/Makefile
@@ -204,7 +204,7 @@ $(SRCDIR)/tag-make-real:$(SRCDIR)/tag-conf-real
 $(SRCDIR)/tag-install-real :$(SRCDIR)/tag-make-real
     cd $(SRCDIR) && $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=fr install
     -test -x "`type -p otool`" && make changer
-    cd $(SRCDIR) && $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=fr check
+    #cd $(SRCDIR) && $(MAKE) PETSC_DIR=$(PETSC_DIR) PETSC_ARCH=fr check
     test -e $(DIR_INSTALL_REAL)/include/petsc.h
     test -e $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables
     touch $@
@@ -293,7 +293,6 @@ $(SRCDIR)/tag-tar:$(PACKAGE)
     -tar xzf $(PACKAGE)
     patch -p1 < petsc-hpddm.patch
 ifeq ($(WIN32DLLTARGET),)
-    patch -p1 < petsc-metis.patch
 endif
     touch $@
 $(PACKAGE):
EOS

autoreconf -i
./configure --enable-download --enable-optim --prefix="$(pwd)/../FreeFem-install"
./3rdparty/getall -a
cd 3rdparty/ff-petsc
make petsc-slepc
cd -
./reconfigure
make -j`nproc`
make install
cd ../FreeFem-install
PATH="${PATH}:$(pwd)/bin" ./bin/FreeFem++ ../FreeFem-sources/examples/tutorial/
Ciro's initial build experience was a bit painful, possibly because it was done on a relatively new Ubuntu 20.04 as of June 2020, but in the end it worked: github.com/FreeFem/FreeFem-sources/issues/141
The main/only dependency appears to be PETSc which is used by default, which is a good sign, as that library appears to automatically parallelize a single input to several backends (single CPU, MPI, GPU) so you know things will scale up as you reach simulations.
The problem is that it compiling such a complex dependency opens up much more room for hard to solve compilation errors, and takes a lot more time.
Hans Bethe Updated +Created
Head of the theoretical division at the Los Alamos Laboratory during the Manhattan Project.
Richard Feynman was working under him there, and was promoted to team lead by him because Richard impressed Hans.
He was also the person under which Freeman Dyson was originally under when he moved from the United Kingdom to the United States.
And Hans also impressed Feynman, both were problem solvers, and liked solving mental arithmetic and numerical analysis.
This relationship is what brought Feynman to Cornell University after World War II, Hans' institution, which is where Feynman did the main part of his Nobel prize winning work on quantum electrodynamics.
Hans must have been the perfect PhD advisor. He's always smiling, and he seemed so approachable. And he was incredibly capable, notably in his calculation skills, which were much more important in those pre-computer days.
Hyperparameter Updated +Created
A parameter that you choose which determines how the algorithm will perform.
In the case of machine learning in particular, it is not part of the training data set.
Hyperparameters can also be considered in domains outside of machine learning however, e.g. the step size in partial differential equation solver is entirely independent from the problem itself and could be considered a hyperparamter. One difference from machine learning however is that step size hyperparameters in numerical analysis are clearly better if smaller at a higher computational cost. In machine learning however, there is often an optimum somewhere, beyond which overfitting becomes excessive.