\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\usetikzlibrary{calc}
\usepackage{xifthen}
\begin{document}
\begin{tikzpicture}[>=latex', node distance=2cm]
\node (X0) {$X_o$};
\pgfmathsetmacro{\N}{4}
\foreach \x in {0,...,\N}
{
\pgfmathtruncatemacro{\nextval}{\x+1}
\ifthenelse{\x = \N}
{\def\speciesName{$X_1$}}
{\def\speciesName{\large $x_\nextval$}}
\node [right of = X\x] (X\nextval) {\speciesName};
\draw [->,ultra thick,blue] (X\x) -- node[above, black] {$v_{\nextval}$} (X\nextval);
}
\end{tikzpicture}
\end{document}
Sunday, December 11, 2022
Experimenting with foreach loops in TikZ to draw biochemical pathways
Tuesday, November 29, 2022
More utter metabolic nonsense
Tuesday, September 27, 2022
Experimenting with GeoGebra
This is an example of using GeoGebra to interactively simulate a two step pathway, S1 -> S2 -> S3 using simple mass-action kinetics in each reaction.
Tuesday, August 16, 2022
Plot of 1/x using pgfplots
I noticed I couldn't find pgfplots version of the $1/x$ plot that describes $e$. I needed one, so here is the LaTeX I used.
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{fillbetween}
\begin{document
\begin{tikzpicture}
\begin{axis}[
ytick = {1,2},
xtick = {0,1,2,3},
xlabel=$x$, ylabel=$y$,
ymax=2.5, xmin=0, ymin=0,
xlabel style = {anchor=north east},
ylabel style = {anchor=north east}
]
\addplot [color = blue, name path=A,domain=0:4, line width = 1.4pt, samples=200] {1/x};
\path [name path=B]
(\pgfkeysvalueof{/pgfplots/xmin},0) --
(\pgfkeysvalueof{/pgfplots/xmax},0);
\addplot [blue!20]
fill between [of=A and B,
soft clip={(1,0) rectangle (2.71,25)},];
\node at (axis cs:1.5,1.2) {$y=1/x$};
\node at (axis cs:1.6,0.31) {Area = $1$};
\node at (axis cs:2.71, 0.82) {$e$};
\addplot[-latex] coordinates
{(2.71,0.75) (2.71,0.45)};
\end{axis}
\end{tikzpicture}
\end{document}
Friday, July 29, 2022
To paraphrase an old saying....
You can lead a modeler to a technical solution, but you can't make them use it.
This rephrasing of an old saying was inspired by our reproducibility work. There exist technical solutions to publishing reproducible results, and yet most studies are still not reproducible because we choose not to use those solutions.
Sunday, June 26, 2022
MCA Rediscovered
It looks like someone has rediscovered metabolic control analysis (MCA).
The analysis is exactly the same as MCA but uses different symbols and they focus on the unscaled sensitivities instead. eg the r symbols are the unscaled elasticities. The core equation (4) can be found in equation (1) of the appendix of the following paper, and I am sure its been published elsewhere too:
Tuesday, April 19, 2022
Lorenz Attractor
I wanted to test out Google's skia 2D library so I wrote a simple interactive Lorenz attractor app over the weekend. Source code and binaries at
https://github.com/hsauro/Lorenz_fmx
Binaries are only for Windows at the moment but hope to have a Mac version in a couple of weeks.
I used Object Pascal to write it but it should be easily translatable to something like C# and WinForms which were modeled after Object Pascal and the VCL. Looks like skia does a better job at antialiasing lines and also it's quite fast.
I use a simple Euler integration scheme to solve the Lorenz ODEs, nothing fancy but it seems to work perfectly well.
Tuesday, April 5, 2022
Analogmachine reborn
I decided to rebuild my blog on blogger. Originally I used my own WordPress site but discovered that maintaining it was quite time-consuming. The main problem was stopping the site from being hacked and corrupted. This happened again recently and it prompted me to move to a more resilient and less demanding platform.
Monday, April 4, 2022
Theory of the Origin, Evolution, and Nature of Life by Andrulis
Ars Technica has an interesting article that I can't avoid bringing up here. The title of the article is:
"How the craziest f#@!ing "theory of everything" got published and promoted"
The Ars Technica article describes a paper (Theory of the Origin, Evolution, and Nature of Life) published by an assistant professor from Case Western. The author of the paper describes a theory of everything which because of a press release from Case Western manages to get amplified out of all proportion even though the content is highly suspect. Just reading the first sentence is enough to raise a big red flag. That sentence is:
"How life abides by the second law of thermodynamics yet evolutionarily complexifies and maintains its intrinsic order is a fundamental mystery in physics, chemistry, and biology [1]."
There is no mystery here as the author suggests. If he had bothered to read up on Prigogine's and Nichols well-known work on non-equilibrium thermodynamics published decades ago he would have an explanation for this "mystery".
Testing Code Formating using hightlight.js
# Python Program to find the area of triangle
if x == True:
pass
a = 5
b = 6
c = 7
# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))
# calculate the semi-perimeter
s = (a + b + c) / 2
# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' %area)
Sunday, April 4, 2021
A note on ex nihilo
In terms of the origin of the universe, "Out of nothing" is something we often hear from theists who argue that something, i.e the universe, cannot come from nothing from which they conclude that it must have come from something, which they call God.
The notion of nothing 'before' the universe however is problematic because what is 'nothing'? It is better to refer to the 'nothing' as something that isn't space-time, rather than a simple negation of space-time. What 'out of nothing' seems to imply is that space-time cannot come from space-time which seems reasonable.
All our notations of cause and effect and the logical absolutes only operate within our own space-time. It is impossible for us to contemplate anything that isn't space-time, so asking questions about creation is extremely difficult if not impossible. Jumping to God as an explanation, however, makes no sense since we can't comprehend anything outside space-time, let alone an all-powerful sentient being to which the bible attaches all sorts of very specific properties.


