|
1 | 1 | # [Chemistry-related functionality](@id chemistry_functionality)
|
2 | 2 |
|
3 | 3 | While Catalyst has primarily been designed around the modelling of biological systems, reaction network models are also common across chemistry. This section describes two types of functionality, that while of general interest, should be especially useful in the modelling of chemical systems.
|
4 |
| -- The `@compound` option, allowing the user to designate that a specific species is composed of certain subspecies. |
5 |
| -- The `balance_reaction` function enabling the user to balance a reaction so the same number of components occur on both sides. |
| 4 | +- The `@compound` option, which enables the user to designate that a specific species is composed of certain subspecies. |
| 5 | +- The `balance_reaction` function, which enables the user to balance a reaction so the same number of components occur on both sides. |
6 | 6 |
|
7 | 7 | ## Modelling with compound species
|
8 | 8 |
|
9 | 9 | #### Creating compound species programmatically
|
10 |
| -We will first show how to create compound species through [programmatic construction](@ref programmatic_CRN_construction), and then demonstrate using the DSL. To create a compound species, use the `@compound` macro, first designating the compound, followed by its components (and stoichiometries). In this example, we will create a CO₂ molecule, consisting of one C atom and two O atoms. First, we create species corresponding to the components: |
| 10 | +We will first show how to create compound species through [programmatic model construction](@ref programmatic_CRN_construction), and then demonstrate using the DSL. To create a compound species, use the `@compound` macro, first designating the compound, followed by its components (and their stoichiometries). In this example, we will create a CO₂ molecule, consisting of one C atom and two O atoms. First, we create species corresponding to the components: |
11 | 11 | ```@example chem1
|
12 | 12 | using Catalyst
|
13 | 13 | @variables t
|
@@ -53,7 +53,7 @@ When multiple compounds are created, they can be created simultaneously using th
|
53 | 53 | end
|
54 | 54 | ```
|
55 | 55 |
|
56 |
| -#### Creating compound species programmatically |
| 56 | +#### Creating compound species within the DSL |
57 | 57 | It is also possible to declare species as compound species within the `@reaction_network` DSL, using the `@compounds` options:
|
58 | 58 | ```@example chem1
|
59 | 59 | rn = @reaction_network begin
|
@@ -88,7 +88,7 @@ Default values are designated using `=`, and provided directly after the compoun
|
88 | 88 | ```@example chem1
|
89 | 89 | @compound (CO2 = 2.0) ~ C + 2O
|
90 | 90 | ```
|
91 |
| -If both default values and meta data are provided, the metadata is provided after teh default value: |
| 91 | +If both default values and meta data are provided, the metadata is provided after the default value: |
92 | 92 | ```@example chem1
|
93 | 93 | @compound (CO2 = 2.0, [unit="mol"]) ~ C + 2O
|
94 | 94 | ```
|
|
0 commit comments