Skip to content

Commit 2b8a844

Browse files
committed
Update, proofread and crosscheck docs for first release
1 parent 325224b commit 2b8a844

File tree

2 files changed

+27
-16
lines changed

2 files changed

+27
-16
lines changed

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,22 @@
66
[![codecov](https://codecov.io/gh/JuliaDynamics/ProcessBasedModelling.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaDynamics/ProcessBasedModelling.jl)
77
[![Package Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/ProcessBasedModelling)](https://pkgs.genieframework.com?packages=ProcessBasedModelling)
88

9-
ProcessBasedModelling.jl is an extension to [ModelingToolkit.jl](https://docs.sciml.ai/ModelingToolkit/stable/) (MTK).
10-
It is an alternative framework to MTK's
11-
native component-based modelling, but, instead of components, there are "processes".
12-
This modelling approach is useful in the modelling of physical/biological/whatever systems, where each variable corresponds to particular physical concept or observable and there are few (or any) duplicate variables to make the definition of MTK "factories" worthwhile.
13-
In many modelling scenarios this follows the line of reasoning in the researcher's head.
9+
ProcessBasedModelling.jl is an extension to [ModelingToolkit.jl](https://docs.sciml.ai/ModelingToolkit/stable/) (MTK) for building a model of equations using symbolic expressions.
10+
It is an alternative framework to MTK's [native component-based modelling](https://docs.sciml.ai/ModelingToolkit/stable/tutorials/acausal_components/), but, instead of components, there are "processes".
11+
This approach is useful in the modelling of physical/biological/whatever systems, where each variable corresponds to particular physical concept or observable and there are few (or any) duplicate variables to make the definition of MTK "factories" worthwhile, while, there plenty of different physical representations, or _processes_ to represent the given physical concept.
12+
In many fields this approach parallels modelling reasoning line of the researcher more closely than the "components" approach.
1413

15-
Beyond this reasoning style, the biggest strength of ProcessBasedModelling.jl is the informative errors it provides regarding incorrect/incomplete equations. When building the MTK model via ProcessBasedModelling.jl the user provides a vector of "processes": equations or custom types that have a well defined and single left-hand-side variable.
16-
This allows ProcessBasedModelling.jl to achieve the following:
14+
Beyond this reasoning style, the biggest strength of ProcessBasedModelling.jl is the **informative errors and automation** it provides regarding incorrect/incomplete equations. When building the MTK model via ProcessBasedModelling.jl the user provides a vector of "processes": equations or custom types that have a well defined and single left-hand-side variable.
15+
This allows ProcessBasedModelling.jl to:
1716

18-
1. Iterates over the processes and collects _new_ variables that have been introduced by a provided process but do not themselves have a process assigned to them.
17+
1. Iterate over the processes and collect _new_ variables that have been introduced by a provided process but do not themselves have a process assigned to them.
1918
2. For these collected "process-less" variables:
20-
- If there is a default process defined, it incorporates this one into the model
21-
- If there is no default process but the variable has a default value, it equates the variable to a _parameter_ that has the same default value and throws an informative warning.
22-
- Else, it throws an informative error saying exactly which originally provided variable introduced this new "process-less" variable.
23-
3. Also throws an informative error if a variable has two processes assigned to it (by mistake).
19+
- If there is a default process defined, incorporate this one into the model
20+
- If there is no default process but the variable has a default value, equate the variable to a _parameter_ that has the same default value and throw an informative warning.
21+
- Else, throw an informative error saying exactly which originally provided variable introduced this new "process-less" variable.
22+
3. Throw an informative error if a variable has two processes assigned to it (by mistake).
2423

25-
In our experience, and as we also highlight explicitly in the online documentation, this approach typically yields simpler, less ambiguous and more targeted warning/error messages than the native MTK one's, leading to faster identification and resolution of the problems with the composed equations.
24+
In our experience, and as we also highlight explicitly in the online documentation, this approach typically yields simpler, less ambiguous and more targeted warning or error messages than the native MTK one's, leading to faster identification and resolution of the problems with the composed equations.
2625

2726
ProcessBasedModelling.jl is particularly suited for developing a model about a physical/biological/whatever system and being able to try various physical "rules" (couplings, feedbacks, mechanisms, ...) for a given physical observable efficiently.
2827
This means switching arbitrarily between different processes that correspond to the same variable.

docs/src/index.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ ProcessBasedModelling
88

99
## Usage
1010

11-
In ProcessBasedModelling.jl, each variable is governed by a "process", which in code is just a symbolic expression from ModellingToolkit.jl.
12-
To coupled the variable with the process it is governed by, a user either defines simple equations of the form `variable ~ expression`, or creates an instance of [`Process`](@ref) if the left-hand-side of the equation needs to be anything more complex.
13-
Once all the processes about the physical system are collected, they are given as a `Vector` to the [`processes_to_mtkmodel`](@ref) central function. This function also defines what quantifies as a "process".
11+
In ProcessBasedModelling.jl, each variable is governed by a "process".
12+
Conceptually this is just an equation that _defines_ the given variable.
13+
To couple the variable with the process it is governed by, a user either defines simple equations of the form "variable = expression", or creates an instance of [`Process`](@ref) if the left-hand-side of the equation needs to be anything more complex. In either case, the variable and the expression are both _symbolic expressions_ created via ModellingToolkit.jl (more specifically, via Symbolics.jl).
14+
15+
Once all the processes about the physical system are collected, they are given as a `Vector` to the [`processes_to_mtkmodel`](@ref) central function. This function also defines what quantifies as a "process" in more specificity.
1416

1517
## Example
1618

@@ -109,6 +111,16 @@ equations(model)
109111
parameters(model)
110112
```
111113

114+
Lastly, [`processes_to_mtkmodel`](@ref) also allows the concept of "default" processes, that can be used for introduced "process-less" variables.
115+
For example,
116+
117+
```@example MAIN
118+
model = processes_to_mtkmodel(processes[1:2], processes[3:3])
119+
equations(model)
120+
```
121+
122+
does not throw any warnings as it obtained a process for ``y`` from the given default processes.
123+
112124
### Special handling of timescales
113125

114126
In dynamical systems modelling the timescale associated with a process is a special parameter. That is why, if a timescale is given for either the [`TimeDerivative`](@ref) or [`ExpRelaxation`](@ref) processes, it is converted to a named `@parameter` by default:

0 commit comments

Comments
 (0)