Skip to content

Commit 42034e9

Browse files
refactor: mark common t* and D* as public
1 parent d4f4af6 commit 42034e9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

docs/src/API/model_building.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,29 @@
33
This page lists functionality and utilities related to building hierarchical models. It is
44
recommended to read the page on the [`System`](@ref System_type) before this.
55

6+
## Common definitions of `t` and `D`
7+
8+
ModelingToolkit provides common definitions for the independent variable `t` (time) and the
9+
derivative with respect to it `D`.
10+
11+
```@docs
12+
ModelingToolkit.t_nounits
13+
ModelingToolkit.D_nounits
14+
ModelingToolkit.t
15+
ModelingToolkit.D
16+
ModelingToolkit.t_unitful
17+
ModelingToolkit.D_unitful
18+
```
19+
20+
Users are recommended to use the appropriate common definition in their models. The required
21+
definitions can be imported with convenient aliased names. For example:
22+
23+
```julia
24+
using ModelingToolkit: t_nounits as t, D_nounits as D
25+
```
26+
27+
Allows using `t` and `D` to refer to `t_nounits` and `D_nounits` respectively.
28+
629
## Hierarchical model composition
730

831
The `System` data structure can represent a tree-like hierarchy of systems for building models

src/ModelingToolkit.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export DynamicOptSolution
337337
@public similarity_transform, inputs, outputs, bound_inputs, unbound_inputs, bound_outputs
338338
@public unbound_outputs, is_bound
339339
@public AbstractSystem, CheckAll, CheckNone, CheckComponents, CheckUnits
340+
@public t, D, t_nounits, D_nounits, t_unitful, D_unitful
340341

341342
for prop in [SYS_PROPS; [:continuous_events, :discrete_events]]
342343
getter = Symbol(:get_, prop)

0 commit comments

Comments
 (0)