Skip to content

Commit 50faac0

Browse files
Update README
1 parent 25ebf77 commit 50faac0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ to better scale to larger systems. You can define derivatives for your own
249249
function via the dispatch:
250250

251251
```julia
252-
ModelingToolkit.Derivative(::typeof(my_function),args,::Val{i})
252+
# `N` arguments are accepted by the relevant method of `my_function`
253+
ModelingToolkit.Derivative(::typeof(my_function), args::NTuple{N,Any}, ::Val{i})
253254
```
254255

255256
where `i` means that it's the derivative of the `i`th argument. `args` is the
@@ -259,7 +260,7 @@ You should return an `Operation` for the derivative of your function.
259260
For example, `sin(t)`'s derivative (by `t`) is given by the following:
260261

261262
```julia
262-
ModelingToolkit.Derivative(::typeof(sin),args,::Val{1}) = cos(args[1])
263+
ModelingToolkit.Derivative(::typeof(sin), args::NTuple{1,Any}, ::Val{1}) = cos(args[1])
263264
```
264265

265266
### Macro-free Usage

0 commit comments

Comments
 (0)