#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Options

# Blog - Petri net programming (part 2)

I did a little editing of David Tanzer's nice article

Namely:

• I changed a bunch of chemical names like H2O to H<sub>2</sub>O, using HTML to produce subscripts.

• I changed a bunch of Greek letters like Gamma to &Gamma;, again using HTML.

• Similarly, I changed a bunch of appearances of -> to &rarr;.

I prefer math to be written in TeX on my blog, so I'll try to persuade David to do that. But something less negotiable is that the blog uses HTML and does not use Markdown, while the wiki uses both... so blog articles should be written on the wiki using HTML, as explained here:

I urge everyone who wants to write articles for the Azimuth blog to read this! Of course I don't mind doing a certain amount of formatting and polishing... I spend a lot of time doing that... but it will make my job easier if people use HTML rather than Markdown to format things like boldface, italics, section headers, etc.

If you don't know HTML, the easiest way to learn what you need is to go to an existing blog article on the wiki and click 'Source' on the bottom to see how things are done. This is also a decent way to learn TeX.

• Options
1.

Hi John, Thanks for taking a look and the good word.

But I wouldn't spend time polishing it now, because it is still in a poorly expressed state -- it is the language of me figuring things out for myself, rather than addressing the reader. Now I have more clarity on the it, and am in the midst of giving it a major overhaul.

Also, I will be doing the conversion of markdown to html myself -- I don't want to give you any extra work here John. I like to start out with markdown, because it is quicker to type and the source is easier to read. Then once the thing congeals more I'll do an html pass.

Thanks

Comment Source:Hi John, Thanks for taking a look and the good word. But I wouldn't spend time polishing it now, because it is still in a poorly expressed state -- it is the language of me figuring things out for myself, rather than addressing the reader. Now I have more clarity on the it, and am in the midst of giving it a major overhaul. Also, I will be doing the conversion of markdown to html myself -- I don't want to give you any extra work here John. I like to start out with markdown, because it is quicker to type and the source is easier to read. Then once the thing congeals more I'll do an html pass. Thanks
• Options
2.

...once I have a reviewable version (ETA = 1 week), I will start a new thread called Blog -- Petri net programming (part 2), and then I will ask people to give it a real review.

Cheers

Comment Source:...once I have a reviewable version (ETA = 1 week), I will start a new thread called Blog -- Petri net programming (part 2), and then I will ask people to give it a real review. Cheers
• Options
3.
edited November 2012

David wrote:

Also, I will be doing the conversion of markdown to html myself – I don’t want to give you any extra work here John. I like to start out with markdown, because it is quicker to type and the source is easier to read. Then once the thing congeals more I’ll do an html pass.

Okay. I mainly just wanted to be sure everyone knows about this HTML issue, so we can save work. We've got a lot of new members here who don't know all the stuff the old-timers worked out.

I write naturally in HTML myself but I don't mean to cramp anyone's style.

[...] I will start a new thread called Blog – Petri net programming (part 2) [...]

Please don't start a new thread with the same title as this one; that gets a bit confusing. You can just let us know here what's going on.

Comment Source:David wrote: > Also, I will be doing the conversion of markdown to html myself – I don’t want to give you any extra work here John. I like to start out with markdown, because it is quicker to type and the source is easier to read. Then once the thing congeals more I’ll do an html pass. Okay. I mainly just wanted to be sure everyone knows about this HTML issue, so we can save work. We've got a lot of new members here who don't know all the stuff the old-timers worked out. I write naturally in HTML myself <img src = "http://math.ucr.edu/home/baez/emoticons/tongue2.gif" alt = ""/> but I don't mean to cramp anyone's style. > [...] I will start a new thread called Blog – Petri net programming (part 2) [...] Please don't start a new thread with the same title as this one; that gets a bit confusing. You can just let us know here what's going on.
• Options
4.

Sure. The reason why I was proposing to make a new thread was because -- I was confused! I missed the fact you had created new thread for Part 2 of the blog, and misread your comments as being tacked on to the end of the discussion of the previous article.

Regarding HTML, my skills need a lot of work, so thanks for your edits, they give me some good examples to work with.

Comment Source:Sure. The reason why I was proposing to make a new thread was because -- I was confused! I missed the fact you had created new thread for Part 2 of the blog, and misread your comments as being tacked on to the end of the discussion of the previous article. Regarding HTML, my skills need a lot of work, so thanks for your edits, they give me some good examples to work with.
• Options
5.

Here's my story. I was all set to write the followup article on stochastic Petri nets, and give the extended simulator. But I discovered in the process of trying to explain the idea of SPN that the subject was deeper and more complex than I had thought at first. I don't want to just present mystery code to the reader. So I've been reading a bunch of articles, and struggling through this material, which is cool and new to me. The upshot is that I'm going to break it up into the following smaller blog articles:

• Introduction to stochastic Petri nets; the rate equation
• Proof of the mass action kinetics, along with discussion of its limitations
• Discussion of the stochastic component of the model, including random processes, Markov chains, and the exponential distribution of inter-reaction arrival times
• Discussion of algorithmic issues for the simulator, along with "literate" presentation of the simulator (extended from the first article)

Even though this involves a lot of theory, it still falls under the "Petri net programming" series, because in the end we want to build the tool and use it for scientific explorations. So the audience will include software developers who aren't expected to have a degree in math. Since we are in the real of scientific programming, such programmers will need to learn about science and math -- just as an application programmer in any domain needs to learn the relevant basics of that domain. Put in other terms, this is part of complete software development, which includes the study of the premises of the application program. In practice, the tool is only useful if the assumptions that it makes conform to the reality that is being modeled. So it behooves the "complete application programmer" to learn about the assumptions on which their code rests. This application, stochastic Petri nets, leads programmers to the doorsteps of math and science.

I will have to face the challenge of explaining Markovian dynamics to a readership that won't know beforehand about e.g. matrix exponentiation. Well, that's few blog articles down the road, phew.

I probably will need about a week to finish the first one, Introduction to stochastic Petri nets.

I will announce here when I have something that is ready to be reviewed.

Comment Source:Here's my story. I was all set to write the followup article on stochastic Petri nets, and give the extended simulator. But I discovered in the process of trying to explain the idea of SPN that the subject was deeper and more complex than I had thought at first. I don't want to just present mystery code to the reader. So I've been reading a bunch of articles, and struggling through this material, which is cool and new to me. The upshot is that I'm going to break it up into the following smaller blog articles: * Introduction to stochastic Petri nets; the rate equation * Proof of the mass action kinetics, along with discussion of its limitations * Discussion of the stochastic component of the model, including random processes, Markov chains, and the exponential distribution of inter-reaction arrival times * Discussion of algorithmic issues for the simulator, along with "literate" presentation of the simulator (extended from the first article) Even though this involves a lot of theory, it still falls under the "Petri net programming" series, because in the end we want to build the tool and use it for scientific explorations. So the audience will include software developers who aren't expected to have a degree in math. Since we are in the real of scientific programming, such programmers will need to learn about science and math -- just as an application programmer in any domain needs to learn the relevant basics of that domain. Put in other terms, this is part of _complete_ software development, which includes the study of the premises of the application program. In practice, the tool is only useful if the assumptions that it makes conform to the reality that is being modeled. So it behooves the "complete application programmer" to learn about the assumptions on which their code rests. This application, stochastic Petri nets, leads programmers to the doorsteps of math and science. I will have to face the challenge of explaining Markovian dynamics to a readership that won't know beforehand about e.g. matrix exponentiation. Well, that's few blog articles down the road, phew. I probably will need about a week to finish the first one, Introduction to stochastic Petri nets. I will announce here when I have something that is ready to be reviewed.
• Options
6.

the audience will include software developers who aren’t expected to have a degree in math.

Explaining stochastic Petri nets to that part of the audience does seem like a lot of work! But I was a mathematician first and a programmer later, and I don't really know how much maths you can expect a software developer to know. Eg, how much probability theory, how much numerical analysis?

Comment Source:> the audience will include software developers who aren’t expected to have a degree in math. Explaining stochastic Petri nets to that part of the audience does seem like a lot of work! But I was a mathematician first and a programmer later, and I don't really know how much maths you can expect a software developer to know. Eg, how much probability theory, how much numerical analysis?
• Options
7.
edited December 2012

David wrote:

I probably will need about a week to finish the first one, Introduction to stochastic Petri nets.

I will announce here when I have something that is ready to be reviewed.

Great! I sense that you're in danger of letting the project spiral out of control as your prerequisites keep gaining new prerequisites. Don't forget that most folks don't feel they need to understand to understand everything in complete detail.

Comment Source:David wrote: > I probably will need about a week to finish the first one, Introduction to stochastic Petri nets. > I will announce here when I have something that is ready to be reviewed. Great! I sense that you're in danger of letting the project spiral out of control as your prerequisites keep gaining new prerequisites. Don't forget that most folks don't feel they need to understand to understand everything in complete detail.
• Options
8.
edited December 2012

I could see how it might look that way, given the amount of editing I did on that page. The topics did keep expanding as I looked further into them, and I kept splitting off sections into other pieces of future blog articles. But fortunately, once I achieved more clarity, it turned out not to be a bottomless pit after all. The Wilkinson book really brought the whole subject into focus -- systems biology!

So here is my draft of the next article, which is ready to be reviewed for content:

It is an introduction to the subject of stochastic Petri nets.

The formatting is very crude: I essentially used "Ascii art" to draw the reaction networks, and there is Markdown not html. In the next few days I will be cleaning this up, and working to improve the grammar and phrasing.

But I have clearly expressed my intended ideas, so its open for review, suggestions, questions, etc.

Thanks!

Comment Source:I could see how it might look that way, given the amount of editing I did on that page. The topics did keep expanding as I looked further into them, and I kept splitting off sections into other pieces of future blog articles. But fortunately, once I achieved more clarity, it turned out not to be a bottomless pit after all. The Wilkinson book really brought the whole subject into focus -- systems biology! So here is my draft of the next article, which is ready to be reviewed for _content_: * [[Blog - Petri net programming (part 2)]] It is an introduction to the subject of stochastic Petri nets. The formatting is very crude: I essentially used "Ascii art" to draw the reaction networks, and there is Markdown not html. In the next few days I will be cleaning this up, and working to improve the grammar and phrasing. But I have clearly expressed my intended ideas, so its open for review, suggestions, questions, etc. Thanks!
• Options
9.
edited December 2012

David here just quick some comments:

The Combine reaction takes in one H20 token, and outputs an O token and two H tokens. As the diagram indicates, Split is the opposite reaction.

seems not to be in accordance with the diagram

The mass action law applies to both cases, the only difference being that the constant factors of (1/V) used for concentrations will get absorbed into the rate constants.

You haven't mentioned the mass action law before, so eventually one should at least link to it.

A rate constant that is associated with each transition.

A kinetic model, that gives the expected firing rate for each transition as a function of the current marking. Normally, this kinetic function will include the rate constant as a multiplicative factor.

You do not really explain (or did I miss this ?) how the rate constant and the firing rate will be used

otherwise I find rather clearly written

Comment Source:David here just quick some comments: >The Combine reaction takes in one H20 token, and outputs an O token and two H tokens. As the diagram indicates, Split is the opposite reaction. seems not to be in accordance with the diagram >The mass action law applies to both cases, the only difference being that the constant factors of (1/V) used for concentrations will get absorbed into the rate constants. You haven't mentioned the mass action law before, so eventually one should at least link to it. >A rate constant that is associated with each transition. >A kinetic model, that gives the expected firing rate for each transition as a function of the current marking. Normally, this kinetic function will include the rate constant as a multiplicative factor. You do not really explain (or did I miss this ?) how the rate constant and the firing rate will be used otherwise I find rather clearly written
• Options
10.

You're right, I got Combine and Split reversed in my description.

The quote about the mass action law is in the section where I was defining the mass action law, so I don't need an external reference. Your question showed me that I need to make the language and definition of the mass action law more clear.

The mass action law is a "standard implementation" of the kinetic model (which can be thought of as an interface). It says, for example, that for a reaction A + B -> C, with rate constant k, the firing rate is k * A * B. And so for a reaction 2 A -> C, the firing rate is k * A * A. Another implementation of the kinetic model -- which becomes pertinent when population sizes are low, and stochastic effects predominate -- uses a model of selection without replacement for the reactions, so that the rate of A + A -> C will be proportional to k * A * (A - 1).

In this post I used the firing rate in the deterministic-continuous limit, when solving for the equilibrium concentrations for a pair of opposite reactions.

It was simply too much to include any investigation of the probabilistic considerations in this initial blog post, which just introduced the definition of an SPN. So I settled for the concrete result of being able to apply the concept of SPN to understanding something about the equilibrium conditions of reaction networks.

I will be clarifying these points in my final surface editing of the text, which is about 50% completed.

Comment Source:Thanks nad. You're right, I got Combine and Split reversed in my description. The quote about the mass action law is in the section where I was defining the mass action law, so I don't need an external reference. Your question showed me that I need to make the language and definition of the mass action law more clear. The mass action law is a "standard implementation" of the kinetic model (which can be thought of as an interface). It says, for example, that for a reaction A + B -> C, with rate constant k, the firing rate is k * A * B. And so for a reaction 2 A -> C, the firing rate is k * A * A. Another implementation of the kinetic model -- which becomes pertinent when population sizes are low, and stochastic effects predominate -- uses a model of selection without replacement for the reactions, so that the rate of A + A -> C will be proportional to k * A * (A - 1). In this post I used the firing rate in the deterministic-continuous limit, when solving for the equilibrium concentrations for a pair of opposite reactions. It was simply too much to include any investigation of the probabilistic considerations in this initial blog post, which just introduced the definition of an SPN. So I settled for the concrete result of being able to apply the concept of SPN to understanding something about the equilibrium conditions of reaction networks. I will be clarifying these points in my final surface editing of the text, which is about 50% completed.
• Options
11.

But I have clearly expressed my intended ideas, so its open for review, suggestions, questions, etc.

I will be clarifying these points in my final surface editing of the text, which is about 50% completed.

??? 50 % of the final editing or 50% of the final text?

Comment Source:>But I have clearly expressed my intended ideas, so its open for review, suggestions, questions, etc. >I will be clarifying these points in my final surface editing of the text, which is about 50% completed. ??? 50 % of the final editing or 50% of the final text?
• Options
12.

basic model of concurrency called Petri nets

I don't understand concurrency'.

“For the reaction A+C → D, an occurrence requires that a molecule of A meet a molecule of C in the reaction, and we take the probability of such an encounter to be proportional to the product $C_A C_C$

You don't explain the $C_A$ notation.

Note that we can easily pass back and forth between speaking of the population counts for the species, and the concentrations of the species, which is just the population count divided by the total volume V ...

I think V should be a total count of something, not a volume.

In the limit, we obtain an approximation for high concentrations,

Should be high population counts'.

Here [A] means the concentration of A.

I think you should stick to C_A or [A], not use both...

To reduce the syntax, we are overloading the species symbol A to also mean the magnitude of A,

... and I wish you wouldn't do that!

Comment Source:David, some comments. > basic model of concurrency called Petri nets I don't understand concurrency'. > “For the reaction A+C → D, an occurrence requires that a molecule of A meet a molecule of C in the reaction, and we take the probability of such an encounter to be proportional to the product $C_A C_C$ You don't explain the $C_A$ notation. > Note that we can easily pass back and forth between speaking of the population counts for the species, and the concentrations of the species, which is just the population count divided by the total volume V ... I think V should be a total count of something, not a volume. > In the limit, we obtain an approximation for high concentrations, Should be high population counts'. > Here [A] means the concentration of A. I think you should stick to C_A or [A], not use both... > To reduce the syntax, we are overloading the species symbol A to also mean the magnitude of A, ... and I wish you wouldn't do that!
• Options
13.

nad, you're right, my sentence was highly ambiguous. I meant that I was half way done with the final editing pass.

Comment Source:nad, you're right, my sentence was highly ambiguous. I meant that I was half way done with the final editing pass.
• Options
14.

Graham,

I don't understand concurrency'.

This is a kind of throw-away phrase that I used to start the discussion, with the intent of conveying the flavor of a Petri net. It is a simple form of concurrent processing, as is a dataflow network -- in the sense that you can picture each transition as a separate thread, and the threads are communicating asynchronously through the token-containers that they share.

You don't explain the $C_A$ notation.

True. This is a quote from Feinberg, who uses that notation, which I would prefer to avoid, because, especially in large formulas, it would fill up the page with lots of uninformative capital C's. I will find a way to paraphrase that part of his quote, or if I can't do this in a natural way, I will define $C_A$.

I think V should be a total count of something, not a volume.

A total count of what? At any moment you have total counts for each of the populations, but these can vary over time, and in general there is no overall total that is required to be preserved (think of a non-conservative process that generates new tokens).

In a physical chemistry situation where we are talking about concentrations, we mean of course the number of entities per unit volume. The model is that there is some kind of container with a definite volume. So V is a good candidate to represent this volume, and it is natural to write concentration = population / V.

Should be high population counts'.

Agreed.

I think you should stick to C_A or [A], not use both...

Agreed.

... and I wish you wouldn't do that!

Thanks

Comment Source:Graham, > I don't understand concurrency'. This is a kind of throw-away phrase that I used to start the discussion, with the intent of conveying the flavor of a Petri net. It is a simple form of concurrent processing, as is a dataflow network -- in the sense that you can picture each transition as a separate thread, and the threads are communicating asynchronously through the token-containers that they share. > You don't explain the $C_A$ notation. True. This is a quote from Feinberg, who uses that notation, which I would prefer to avoid, because, especially in large formulas, it would fill up the page with lots of uninformative capital C's. I will find a way to paraphrase that part of his quote, or if I can't do this in a natural way, I will define $C_A$. > I think V should be a total count of something, not a volume. A total count of what? At any moment you have total counts for each of the populations, but these can vary over time, and in general there is no overall total that is required to be preserved (think of a non-conservative process that generates new tokens). In a physical chemistry situation where we are talking about concentrations, we mean of course the number of entities per unit volume. The model is that there is some kind of container with a definite volume. So V is a good candidate to represent this volume, and it is natural to write concentration = population / V. > Should be high population counts'. Agreed. > I think you should stick to C_A or [A], not use both... Agreed. > ... and I wish you wouldn't do that! Ok, I don't have a strong feeling about this. Thanks
• Options
15.

Comment Source:I agree about V now I've thought about it.
• Options
16.
edited December 2012

John, I am finished with this article, and am submitting it for your review. And of course for review by anyone else. Thanks.

There is one section that I wanted to run by the group. I have pasted it below. Because I don't know a lot about chemistry, I want to make sure that my statements about the example chemical reaction networks are correct. I chose the formation of carbonic acid as an example, because it pertains to the environmental concern about ocean acidification. I tried to understate the case just a bit, to avoid any noisy arguments on the blog about ocean acidification -- especially since I don't know enough about it to argue the case. In the context of this article on Petri nets, I feel that it is sufficient for the reader to make the connection that Petri nets can be relevant to real environmental concerns, and that, at the very least, increased atmospheric carbon dioxide is of concern to any aquatic lifeforms that are sensitive to the PH level of the water -- a concern that deserves to be thoroughly investigated, and not preemptively dismissed.

If anyone has suggestions for tightening up or otherwise improving this passage, let me know.

From the blog article:

By the way, this reaction is not physically realistic, because one doesn't find isolated H and O atoms traveling around and meeting up to form water molecules. This is the actual reaction pair that predominates in water:

2 H2O ↔ (OH-) + (H3O+)

Here, a hydrogen nucleus H+, with one unit of positive charge, gets removed from one of the H2O molecules, leaving behind the hydroxide ion OH-. In the same stroke, this H+ gets re-attached to a negatively charged site on the other H2O molecule, which thereby becomes a positively charged H3O+ molecule (the hydronium ion).

For a more detailed example, consider this reaction chain, which is of concern to the ocean environment:

CO2 + H2O ↔ H2CO3 ↔ H+ + HCO3-

This shows the formation of carbonic acid H2CO3 from water and carbon dioxide. The next reaction represents the splitting of carbonic acid into ions. (The reverse reactions are also present.) When CO2 from the atmosphere gets dissolved into the ocean, it reacts with the H2O molecules to form carbonic acid. The acidity of the water is increased by the injection of H+ ions into the solution. Hence any increase of atmospheric C02 is of concern, because there are entire food chains in the sea that are highly sensitive to increases in acidity.

Comment Source:Nad and Graham, thanks for your very helpful comments. I have revised the article, taking all of your points into consideration. John, I am finished with this article, and am submitting it for your review. And of course for review by anyone else. Thanks. There is one section that I wanted to run by the group. I have pasted it below. Because I don't know a lot about chemistry, I want to make sure that my statements about the example chemical reaction networks are correct. I chose the formation of carbonic acid as an example, because it pertains to the environmental concern about ocean acidification. I tried to understate the case just a bit, to avoid any noisy arguments on the blog about ocean acidification -- especially since I don't know enough about it to argue the case. In the context of this article on Petri nets, I feel that it is sufficient for the reader to make the connection that Petri nets _can_ be relevant to real environmental concerns, and that, at the very least, increased atmospheric carbon dioxide is of _concern_ to any aquatic lifeforms that are sensitive to the PH level of the water -- a concern that deserves to be thoroughly investigated, and not preemptively dismissed. If anyone has suggestions for tightening up or otherwise improving this passage, let me know. ----------- From the blog article: By the way, this reaction is not physically realistic, because one doesn't find isolated H and O atoms traveling around and meeting up to form water molecules. This is the actual reaction pair that predominates in water: 2 H<sub>2</sub>O &harr; (OH<sup>-</sup>) + (H<sub>3</sub>O<sup>+</sup>) Here, a hydrogen nucleus H<sup>+</sup>, with one unit of positive charge, gets removed from one of the H<sub>2</sub>O molecules, leaving behind the hydroxide ion OH<sup>-</sup>. In the same stroke, this H+ gets re-attached to a negatively charged site on the other H<sub>2</sub>O molecule, which thereby becomes a positively charged H3O+ molecule (the hydronium ion). For a more detailed example, consider this reaction chain, which is of concern to the ocean environment: CO<sub>2</sub> + H<sub>2</sub>O &harr; H<sub>2</sub>CO<sub>3</sub> &harr; H<sup>+</sup> + HCO<sub>3</sub><sup>-</sup> This shows the formation of carbonic acid H<sub>2</sub>CO<sub>3</sub> from water and carbon dioxide. The next reaction represents the splitting of carbonic acid into ions. (The reverse reactions are also present.) When CO<sub>2</sub> from the atmosphere gets dissolved into the ocean, it reacts with the H<sub>2</sub>O molecules to form carbonic acid. The acidity of the water is increased by the injection of H<sup>+</sup> ions into the solution. Hence any increase of atmospheric C0<sub>2</sub> is of concern, because there are entire food chains in the sea that are highly sensitive to increases in acidity.
• Options
17.

You could refer to Ocean acidification.

Comment Source:You could refer to [[Ocean acidification]].
• Options
18.

The mechanism and how to calculate equilibrium for this reaction is well-presented here. Hth.

Comment Source:The mechanism and how to calculate equilibrium for this reaction is well-presented [here](http://ion.chem.usu.edu/~sbialkow/Classes/3650/Carbonate/Carbonic%20Acid.html). Hth.
• Options
19.
edited December 2012

(Not trying to be formal, but "David" is ambiguous here, and so is "David T.")

I'll go through it soon and edit it a bit and let you know I did that before posting it, so you can change things back if you don't like stuff I did.

Comment Source:Thanks for writing this article, David Tanzer! (Not trying to be formal, but "David" is ambiguous here, and so is "David T.") I'll go through it soon and edit it a bit and let you know I did that before posting it, so you can change things back if you don't like stuff I did.
• Options
20.
edited December 2012

Okay - the article looks great! Since it's really nice, I only made some small changes, mainly formatting but also a few stylistic ones. For example:

• when discussing chemistry, "the positive square root" is a lot less ambiguous than "the positive radical"! So, I changed that. You could reinstate "the positive radical" if you wanted to make a joke, like: "Oddly enough, in chemistry only positive radicals are allowed." Or maybe you were making a joke but it was too subtle for me?

• chemists don't put parentheses around radicals in formulas like this:

2 H2O ↔ OH- + H3O+

so I removed them.

• I have a bunch of fussy rules about bibliographical references, so I imposed those.

I did not check the math near the end.

So: let me know if the article looks okay, and I'll post it.

I just posted one about Teaching the math of climate science, so I'd like to leave that up for a couple of days before posting yours. On Friday I'll go on a road trip to some Anasazi archaeological sites like Canyon de Chelly and Chaco Canyon, so I'd like to at least put the article onto the blog before then, and publish it either at that time, or a bit later. ('Publishing' it just takes one click.)

Comment Source:Okay - the article looks great! Since it's really nice, I only made some small changes, mainly formatting but also a few stylistic ones. For example: &bull; when discussing chemistry, "the positive square root" is a lot less ambiguous than "the positive radical"! So, I changed that. You could reinstate "the positive radical" if you wanted to make a joke, like: "Oddly enough, in chemistry only positive radicals are allowed." Or maybe you _were_ making a joke but it was too subtle for me? &bull; chemists don't put parentheses around radicals in formulas like this: 2 H<sub>2</sub>O &harr; OH<sup>-</sup> + H<sub>3</sub>O<sup>+</sup> so I removed them. &bull; I have a bunch of [fussy rules about bibliographical references](http://www.azimuthproject.org/azimuth/show/How+to#References), so I imposed those. I did not check the math near the end. So: **let me know if the article looks okay, and I'll post it**. I just posted one about [Teaching the math of climate science](https://johncarlosbaez.wordpress.com/2012/12/18/teaching-the-math-of-climate-science/), so I'd like to leave that up for a couple of days before posting yours. On Friday I'll go on a road trip to some Anasazi archaeological sites like Canyon de Chelly and Chaco Canyon, so I'd like to at least put the article onto the blog before then, and publish it either at that time, or a bit later. ('Publishing' it just takes one click.)
• Options
21.

I did not incorporate the suggestions made by Graham or Jim regarding the carbonate reaction. Harte's book Consider a Spherical Cow has a good section on that reaction. The Azimuth Wiki entry mentioned by Graham is mainly a record of my confusion about how that reaction works.

Comment Source:I did not incorporate the suggestions made by Graham or Jim regarding the carbonate reaction. Harte's book _Consider a Spherical Cow_ has a good section on that reaction. The Azimuth Wiki entry mentioned by Graham is mainly a record of my confusion about how that reaction works.
• Options
22.

I did not check the math near the end.

without guarantee it seemed OK.

A stochastic model, which defines the probability distribution of the time intervals between firing events. This specific distribution of the firing intervals for a transition will be a function of the expected firing rate in the current marking.

Here we will be exploring this continuous deterministic formulation of Petri nets, under what is known as the mass action kinetics.... Under the mass action kinetics, the firing rate of a transition is proportional to the product of the concentrations of its input species.

I would at least write one sentence that you are going to cover the firing rate later, because some might wonder that you introduce it and then stop mention it.

Comment Source:>I did not check the math near the end. without guarantee it seemed OK. >A stochastic model, which defines the probability distribution of the time intervals between firing events. This specific distribution of the firing intervals for a transition will be a function of the expected firing rate in the current marking. >Here we will be exploring this continuous deterministic formulation of Petri nets, under what is known as the mass action kinetics.... >Under the mass action kinetics, the firing rate of a transition is proportional to the product of the concentrations of its input species. I would at least write one sentence that you are going to cover the firing rate later, because some might wonder that you introduce it and then stop mention it.
• Options
23.

John your edits were good, and made it flow better. Especially I like the way you formulated the references.

I agree that square root is more natural sounding than radical in that sentence.

I did one more editing pass:

• A couple of grammar / phrasing revisions

• Fleshed out the description of ocean acidification, after reading the web page that Jim Stuttard posted about in this thread. Added a reference to that web page, and a reference to the WIkipedia page on Ocean Acidification (which makes a fairly pointed case about the seriousness of the issue).

• Added a paragraph at the end of the section "Stochastic Petri nets" (right before the section on mass action kinetics), which tries to address nad's request that I clarify the direction of the paper with the reader.

I think it is good to go now, but if there is anything else, or you have any further changes, let me know.

Thanks!

Comment Source:Cool, thanks John. And thanks nad for giving it another reading. John your edits were good, and made it flow better. Especially I like the way you formulated the references. I agree that square root is more natural sounding than radical in that sentence. I did one more editing pass: * A couple of grammar / phrasing revisions * Fleshed out the description of ocean acidification, after reading the web page that Jim Stuttard posted about in this thread. Added a reference to that web page, and a reference to the WIkipedia page on Ocean Acidification (which makes a fairly pointed case about the seriousness of the issue). * Added a paragraph at the end of the section "Stochastic Petri nets" (right before the section on mass action kinetics), which tries to address nad's request that I clarify the direction of the paper with the reader. I think it is good to go now, but if there is anything else, or you have any further changes, let me know. Thanks!
• Options
24.

My browser says you're editing the page now, David. When you stop I'll publish the article!

Comment Source:My browser says you're editing the page now, David. When you stop I'll publish the article!
• Options
25.

Yes :)

I just made a couple of phrasing changes, and add the paragraphs below to the end of the section "Review of basic Petri nets."

Now I am done.

Thanks!

An important application of Petri nets is to the modeling of biochemical reaction networks, which include the gene regulatory networks. Since genes and enzymes are molecules, and their binding interactions are chemical reactions, the Petri net model is directly applicable. For example, consider a transition that inputs one gene G, one enzyme E, and outputs the molecular form G.E in which E is bound to a site on G. The Wilkinson book, cited above, gives a good introduction to this subject.

Applications of Petri nets may differ widely in terms of the population sizes involved in the model. In general chemistry reactions, the populations are measured in units of moles (which equals 6.022 * 1023 entities). In gene regulatory networks, on the other hand, there may only be a handful of genes and enzymes involved in a reaction.

This difference in scale leads to a qualitative difference in the modelling. With small population sizes, the stochastic effects will predominate, but with large populations, a continuous, deterministic, average-based approximation can be used.

Comment Source:Yes :) I just made a couple of phrasing changes, and add the paragraphs below to the end of the section "Review of basic Petri nets." Now I am done. Thanks! ------------------ An important application of Petri nets is to the modeling of <i>biochemical</i> reaction networks, which include the gene regulatory networks. Since genes and enzymes are molecules, and their binding interactions are chemical reactions, the Petri net model is directly applicable. For example, consider a transition that inputs one gene G, one enzyme E, and outputs the molecular form G.E in which E is bound to a site on G. The Wilkinson book, cited above, gives a good introduction to this subject. Applications of Petri nets may differ widely in terms of the population sizes involved in the model. In general chemistry reactions, the populations are measured in units of moles (which equals 6.022 * 10<sup>23</sup> entities). In gene regulatory networks, on the other hand, there may only be a handful of genes and enzymes involved in a reaction. This difference in scale leads to a qualitative difference in the modelling. With small population sizes, the stochastic effects will predominate, but with large populations, a continuous, deterministic, average-based approximation can be used.
• Options
26.

Made one more phrasing change...now I swear I'm done!

Comment Source:Made one more phrasing change...now I swear I'm done!
• Options
27.

I posted the article a while ago - not sure if I did it before or after your very last changes. The blog version is here. If there are changes that need to be made on the blog version, tell me what they are. Putting it on the blog always requires a lot of format adjustments when it comes to TeX, so I may have introduced new errors.

Congratulations! The baby is born!

Comment Source:I posted the article a while ago - not sure if I did it before or after your very last changes. The blog version is [here](http://johncarlosbaez.wordpress.com/2012/12/20/petri-net-programming-part-2/). If there are changes that need to be made on the blog version, tell me what they are. Putting it on the blog always requires a lot of format adjustments when it comes to TeX, so I may have introduced new errors. Congratulations! The baby is born!
• Options
28.

Great -- thanks very much.

We must have just crossed paths, because the blog is one revision behind. It just amounts to adding two paragraphs after the paragraph about gene regulatory networks, and a couple of sentence fix-ups in the paragraph that precedes the section on mass action kinetics.

Have a great vacation.

Comment Source:Great -- thanks very much. We must have just crossed paths, because the blog is one revision behind. It just amounts to adding two paragraphs after the paragraph about gene regulatory networks, and a couple of sentence fix-ups in the paragraph that precedes the section on mass action kinetics. Have a great vacation.
• Options
29.

Hi John, When you're back from vacation and settled in, can you change the blog article to refer to Wilkinson's second edition:

Wilkinson, D. J. (2011) Stochastic modelling for systems biology, second edition, Boca Raton, Florida: Chapman and Hall/CRC Press.

For the articles that I write in the future I will pay closer attention to supplying the bibliographic details.

Thanks

Comment Source:Hi John, When you're back from vacation and settled in, can you change the blog article to refer to Wilkinson's second edition: Wilkinson, D. J. (2011) Stochastic modelling for systems biology, second edition, Boca Raton, Florida: Chapman and Hall/CRC Press. For the articles that I write in the future I will pay closer attention to supplying the bibliographic details. Thanks
• Options
30.

David wrote:

can you change the blog article to refer to Wilkinson’s second edition?

Done!

Comment Source:David wrote: > can you change the blog article to refer to Wilkinson’s second edition? Done!
• Options
31.

David wrote:

We must have just crossed paths, because the blog is one revision behind. It just amounts to adding two paragraphs after the paragraph about gene regulatory networks, and a couple of sentence fix-ups in the paragraph that precedes the section on mass action kinetics.

Right now I tried to fix these - you can see if I succeeded. Sorry to take so long - I started my road trip right after posting your article!

I know that urge to keep polishing things after I say to myself the article is done.

Comment Source:David wrote: > We must have just crossed paths, because the blog is one revision behind. It just amounts to adding two paragraphs after the paragraph about gene regulatory networks, and a couple of sentence fix-ups in the paragraph that precedes the section on mass action kinetics. Right now I tried to fix these - you can see if I succeeded. Sorry to take so long - I started my road trip right after posting your article! I know that urge to keep polishing things after I say to myself the article is done.
• Options
32.
edited January 2013

Thanks for making the changes -- welcome back.

I'll be posting a draft of "Petri net programming (part 3): The rate equation" in the next few days. It's one more blog on theory, before getting back to the programming. It starts with a challenge to the reader: in what direction is a specific reaction network moving, given an initial condition. It's a toy example, but just complex enough that one actually has to go through the analysis for it. That is followed by the general derivation of the rate equation, which I'm trying to make as friendly as possible to the audience of developers who aren't experienced with linear algebra, calculus, etc. Then I'll talk about the Euler method, and promise that in the next blog we will do something with these ideas.

What I have in mind for that next blog is expository programming for an Euler solver, with applications to finding equilibrium and periodic solutions (e.g. from Lotka Volterra), with some graphs of the outputs.

I'll start an new thread when there is something worth reading -- what's on the wiki now is just old notes.

Comment Source:Thanks for making the changes -- welcome back. I'll be posting a draft of "Petri net programming (part 3): The rate equation" in the next few days. It's one more blog on theory, before getting back to the programming. It starts with a challenge to the reader: in what direction is a specific reaction network moving, given an initial condition. It's a toy example, but just complex enough that one actually has to go through the analysis for it. That is followed by the general derivation of the rate equation, which I'm trying to make as friendly as possible to the audience of developers who aren't experienced with linear algebra, calculus, etc. Then I'll talk about the Euler method, and promise that in the next blog we will _do_ something with these ideas. What I have in mind for that next blog is expository programming for an Euler solver, with applications to finding equilibrium and periodic solutions (e.g. from Lotka Volterra), with some graphs of the outputs. I'll start an new thread when there is something worth reading -- what's on the wiki now is just old notes.
• Options
33.

Okay, great! I'm glad you seem to have what it takes to keep cranking out articles! All of this stuff sounds like fun. Including pictures may help people.

Comment Source:Okay, great! I'm glad you seem to have what it takes to keep cranking out articles! All of this stuff sounds like fun. Including pictures may help people.
• Options
34.

James Juniper posted the following comment to my blog article on stochastic Petri nets:

As a Post Keynesian economist, I am interested in how weighted Petri nets could be used to simulate processes of economic production and reproduction along Classical rather than Neoclassical lines. Kurz and Salvadori draw a useful distinction between neoclassical modelling and the multi-sectoral modelling approach developed by Sraffa, Leontieff, and Von Neumann. The latter two researchers also made notable contributions to the theory of automatons.To represent Classical systems, Von Neumann’s input-output systems (which can readily be represented by Petri nets) would have to be augmented with cost information for each transition (along with time-related storage costs for tokens at each place). These costs would have to include rates of profit for each industry. A secondary process would also have to be modeled – the equalization of the rate of profit across each sector achieved through the flow of capital out of low profit sectors into high profit sectors. Sraffa argued that Marx was constrained through lack of access to linear algebra. You could also claim that Sraffa was constrained by lack of access to process algebra or coalgebra! Your thoughts on this would be much appreciated.

It sounds like an interesting idea, but I don't know enough about the specifics here to say much more than, sounds interesting, can you give me some references, and further elaborate your idea.

Anyone here who has some relevant knowledge and/or insight, please feel free to chime in on the blog, or here. If you come up with some good nuggets here, I will quote you there.

Thanks!

Comment Source:James Juniper posted the following comment to my [blog article](http://johncarlosbaez.wordpress.com/2012/12/20/petri-net-programming-part-2/) on stochastic Petri nets: > As a Post Keynesian economist, I am interested in how weighted Petri nets could be used to simulate processes of economic production and reproduction along Classical rather than Neoclassical lines. Kurz and Salvadori draw a useful distinction between neoclassical modelling and the multi-sectoral modelling approach developed by Sraffa, Leontieff, and Von Neumann. The latter two researchers also made notable contributions to the theory of automatons.To represent Classical systems, Von Neumann’s input-output systems (which can readily be represented by Petri nets) would have to be augmented with cost information for each transition (along with time-related storage costs for tokens at each place). These costs would have to include rates of profit for each industry. A secondary process would also have to be modeled – the equalization of the rate of profit across each sector achieved through the flow of capital out of low profit sectors into high profit sectors. Sraffa argued that Marx was constrained through lack of access to linear algebra. You could also claim that Sraffa was constrained by lack of access to process algebra or coalgebra! Your thoughts on this would be much appreciated. It sounds like an interesting idea, but I don't know enough about the specifics here to say much more than, sounds interesting, can you give me some references, and further elaborate your idea. Anyone here who has some relevant knowledge and/or insight, please feel free to chime in on the blog, or here. If you come up with some good nuggets here, I will quote you there. Thanks!
• Options
35.
edited February 2013

If I were you, David, I'd just ask him questions! When you "don't know enough", that's when questions are called for.

I'll ask some myself. Somehow I missed that comment. Thanks for pointing it out!

Comment Source:If I were you, David, I'd just ask him questions! When you "don't know enough", that's when questions are called for. I'll ask some myself. Somehow I missed that comment. Thanks for pointing it out!
• Options
36.

My questions have elicited some helpful remarks from James Juniper here. If you're interested in talking to him, David Tanzer, now is the time!

Comment Source:My questions have elicited some helpful remarks from James Juniper [here](http://johncarlosbaez.wordpress.com/2012/12/20/petri-net-programming-part-2/#comment-25745). If you're interested in talking to him, David Tanzer, now is the time!
• Options
37.

Great, thanks for covering the blog there. I'm going to read those papers he referred to and try to catch up.

On a personal note, I've been preoccupied with some structural problems -- cracked joists in our house, some of which are supporting the real weight of the kitchen above. I sent pictures to a structural engineer, and he said not to walk on those parts of the floor! Well they shored it up, and we had a contractor put in joist hangars, and replace a badly cracked trimming beam. The latest is that the new trimming beam, just put in place yesterday, has long fissures, about 1/2 inch deep. So I sent out more photos, and am inquiring whether they were there to begin with (then why?) or whether they are a response to the load from above. There is even more to the story, but I'll stop now :)

Then I mistakenly tried to give myself a break from all of this by studying category theory -- which just gave me an abstract headache on top of my concrete ones :) I should have taken time off from work on gone on some bicycle rides! When my head is clear I will return to it (starting with the Sassone paper), but I realize now that it's going to be a longer haul before I gain any real traction. In the near and medium term future I should work on things like: home structural engineering (!), programming for employers, and, more enjoyably, blogging on Petri net programming.

Cheers

Comment Source:Great, thanks for covering the blog there. I'm going to read those papers he referred to and try to catch up. On a personal note, I've been preoccupied with some structural problems -- cracked joists in our house, some of which are supporting the real weight of the kitchen above. I sent pictures to a structural engineer, and he said not to walk on those parts of the floor! Well they shored it up, and we had a contractor put in joist hangars, and replace a badly cracked trimming beam. The latest is that the _new_ trimming beam, just put in place yesterday, has long fissures, about 1/2 inch deep. So I sent out more photos, and am inquiring whether they were there to begin with (then why?) or whether they are a response to the load from above. There is even more to the story, but I'll stop now :) Then I mistakenly tried to give myself a break from all of this by studying category theory -- which just gave me an abstract headache on top of my concrete ones :) I should have taken time off from work on gone on some bicycle rides! When my head is clear I will return to it (starting with the Sassone paper), but I realize now that it's going to be a longer haul before I gain any real traction. In the near and medium term future I should work on things like: home structural engineering (!), programming for employers, and, more enjoyably, blogging on Petri net programming. Cheers
• Options
38.

Okay, good luck with your house. It sounds horrifying!

Then I mistakenly tried to give myself a break from all of this by studying category theory – which just gave me an abstract headache on top of my concrete ones :)

This remark, along with your comments about structural engineering, reminds me that the word 'concrete' has both an abstract and a concrete definition... which is the basis of a joke found in some math book:

To the student drowning in a sea of abstraction, we will now toss a concrete life preserver.

Comment Source:Okay, good luck with your house. It sounds horrifying! > Then I mistakenly tried to give myself a break from all of this by studying category theory – which just gave me an abstract headache on top of my concrete ones :) This remark, along with your comments about structural engineering, reminds me that the word 'concrete' has both an abstract and a concrete definition... which is the basis of a joke found in some math book: _To the student drowning in a sea of abstraction, we will now toss a concrete life preserver._
• Options
39.

"In theory, theory and practice are the same. In practice, they are not." Lawrence Peter Berra :-).

Comment Source:"In theory, theory and practice are the same. In practice, they are not." Lawrence Peter Berra :-).
• Options
40.

Actually that's very similar to a quote by Kafka.

Comment Source:Actually that's very similar to a quote by Kafka.
• Options
41.

I thought Yogi was the original? Where was the Kafka quote?

Comment Source:I thought Yogi was the original? Where was the Kafka quote?
• Options
42.

Dave, You might find http://www.haskell.org/haskellwiki/Typeclassopedia helpful. I've wanted to find out what John might make of it for some time.

Comment Source:Dave, You might find http://www.haskell.org/haskellwiki/Typeclassopedia helpful. I've wanted to find out what John might make of it for some time.
• Options
43.

John, thanks for the good luck wish. So far it's working:)

Jim thanks for the reference. Will investigate.

Comment Source:John, thanks for the good luck wish. So far it's working:) Jim thanks for the reference. Will investigate.