Skip to content

Commit 9017fbf

Browse files
docs: update documentation for bounds metadata
1 parent 085358b commit 9017fbf

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

docs/src/basics/Variable_metadata.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,44 @@ hasbounds(u)
8686
getbounds(u)
8787
```
8888

89+
Bounds can also be specified for array variables. A scalar array bound is applied to each
90+
element of the array. A bound may also be specified as an array, in which case the size of
91+
the array must match the size of the symbolic variable.
92+
93+
```@example metadata
94+
@variables x[1:2, 1:2] [bounds = (-1, 1)]
95+
hasbounds(x)
96+
```
97+
98+
```@example metadata
99+
getbounds(x)
100+
```
101+
102+
```@example metadata
103+
getbounds(x[1, 1])
104+
```
105+
106+
```@example metadata
107+
getbounds(x[1:2, 1])
108+
```
109+
110+
```@example metadata
111+
@variables x[1:2] [bounds = (-Inf, [1.0, Inf])]
112+
hasbounds(x)
113+
```
114+
115+
```@example metadata
116+
getbounds(x)
117+
```
118+
119+
```@example metadata
120+
getbounds(x[2])
121+
```
122+
123+
```@example metadata
124+
hasbounds(x[2])
125+
```
126+
89127
## Guess
90128

91129
Specify an initial guess for custom initial conditions of an `ODESystem`.

0 commit comments

Comments
 (0)