@@ -20,9 +20,11 @@ The full interface available to the solvers is as follows:
20
20
state ` u ` at time ` t ` .
21
21
- ` analytic ` : Defines an analytical solution using ` u0 ` at time ` t ` with ` p `
22
22
which will cause the solvers to return errors. Used for testing.
23
- - ` invW ` : The inverse of ` M - gamma*J ` where ` J ` is the ` jac ` .
24
- - ` invW_t ` : The inverse of ` M/gamma - J ` where ` J ` is the ` jac ` .
23
+ - ` Wfact ` : The LU-factorization of ` M - gamma*J ` where ` J ` is the ` jac ` .
24
+ - ` Wfact_t ` : The LU-factorization of ` M/gamma - J ` where ` J ` is the ` jac ` .
25
25
- ` ggprime ` : See the definition in the SDEProblem page.
26
+ - ` syms ` : Allows you to name your variables for automatic names in plots and
27
+ other output.
26
28
27
29
### ODEFunction
28
30
@@ -33,9 +35,10 @@ function ODEFunction{iip,recompile}(f;
33
35
tgrad= nothing , # (dT,u,p,t) or (u,p,t)
34
36
jac= nothing , # (J,u,p,t) or (u,p,t)
35
37
jac_prototype= nothing , # Type for the Jacobian
36
- invW = nothing , # (iW,u,p,t) or (u,p,t)
37
- invW_t = nothing , # (iW,u,p,t) or (u,p,t)
38
+ Wfact = nothing , # (iW,u,p,gamma, t) or (u,p,gamma ,t)
39
+ Wfact_t = nothing , # (iW,u,p,gamma, t) or (u,p,gamma ,t)
38
40
paramjac = nothing , # (pJ,u,p,t) or (u,p,t)
41
+ colorvec = nothing ,
39
42
syms = nothing ) # collection of names for variables
40
43
```
41
44
@@ -67,10 +70,11 @@ function SDEFunction{iip,recompile}(f,g;
67
70
tgrad= nothing ,
68
71
jac= nothing ,
69
72
jac_prototype= nothing ,
70
- invW = nothing ,
71
- invW_t = nothing ,
73
+ Wfact = nothing ,
74
+ Wfact_t = nothing ,
72
75
paramjac = nothing ,
73
76
ggprime = nothing ,
77
+ colorvec = nothing ,
74
78
syms = nothing )
75
79
```
76
80
@@ -94,9 +98,10 @@ function RODEFunction{iip,recompile}(f;
94
98
tgrad= nothing ,
95
99
jac= nothing ,
96
100
jac_prototype= nothing ,
97
- invW = nothing ,
98
- invW_t = nothing ,
101
+ Wfact = nothing ,
102
+ Wfact_t = nothing ,
99
103
paramjac = nothing ,
104
+ colorvec = nothing ,
100
105
syms = nothing )
101
106
```
102
107
@@ -109,8 +114,8 @@ function DAEFunction{iip,recompile}(f;
109
114
tgrad= nothing ,
110
115
jac= nothing , # (J,du,u,p,gamma,t) or (du,u,p,gamma,t)
111
116
jac_prototype= nothing ,
112
- invW = nothing ,
113
- invW_t = nothing ,
117
+ Wfact = nothing ,
118
+ Wfact_t = nothing ,
114
119
paramjac = nothing ,
115
120
syms = nothing )
116
121
```
@@ -127,9 +132,10 @@ function DDEFunction{iip,recompile}(f;
127
132
tgrad= nothing ,
128
133
jac= nothing ,
129
134
jac_prototype= nothing ,
130
- invW = nothing ,
131
- invW_t = nothing ,
135
+ Wfact = nothing ,
136
+ Wfact_t = nothing ,
132
137
paramjac = nothing ,
138
+ colorvec = nothing ,
133
139
syms = nothing )
134
140
```
135
141
@@ -240,7 +246,7 @@ The Jacobian should be given in the form `gamma*dG/d(du) + dG/du ` where `gamma`
240
246
is given by the solver. This means that the signature is:
241
247
242
248
``` julia
243
- f (:: Type{Val{:jac}} , J,du,u,p,gamma,t)
249
+ f (J,du,u,p,gamma,t)
244
250
```
245
251
246
252
For example, for the equation
255
261
we would define the Jacobian as:
256
262
257
263
``` julia
258
- function testjac (:: Type{Val{:jac}} , J,du,u,p,gamma,t)
264
+ function testjac (J,du,u,p,gamma,t)
259
265
J[1 ,1 ] = gamma - 2.0 + 1.2 * u[2 ]
260
266
J[1 ,2 ] = 1.2 * u[1 ]
261
267
J[2 ,1 ] = - 1 * u[2 ]
266
272
267
273
## Symbolically Calculating the Functions
268
274
269
- ParameterizedFunctions.jl automatically calculates as many of these functions as
270
- possible and generates the ` ODEFunction ` using SymEngine. Thus, for good performance
271
- with the least work, it is one can try ParameterizedFunctions.jl.
272
-
273
- Additionally, an up-and-coming effort in the JuliaDiffEq ecosystem is
274
- ModelingToolkit.jl for performing these calculations more generically.
275
+ See the ` modelingtoolkitize ` function from
276
+ [ ModelingToolkit.jl] ( https://github.com/JuliaDiffEq/ModelingToolkit.jl ) for
277
+ automatically symbolically calculating the Jacobian for numerically-defined
278
+ functions.
0 commit comments