1
- # SciCompDSL .jl
1
+ # ModelingToolkit .jl
2
2
3
- [ ![ Build Status] ( https://travis-ci.org/JuliaDiffEq/SciCompDSL .jl.svg?branch=master )] ( https://travis-ci.org/JuliaDiffEq/SciCompDSL .jl )
4
- [ ![ Coverage Status] ( https://coveralls.io/repos/JuliaDiffEq/SciCompDSL .jl/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/JuliaDiffEq/SciCompDSL .jl?branch=master )
5
- [ ![ codecov.io] ( http://codecov.io/github/JuliaDiffEq/SciCompDSL .jl/coverage.svg?branch=master )] ( http://codecov.io/github/JuliaDiffEq/SciCompDSL .jl?branch=master )
3
+ [ ![ Build Status] ( https://travis-ci.org/JuliaDiffEq/ModelingToolkit .jl.svg?branch=master )] ( https://travis-ci.org/JuliaDiffEq/ModelingToolkit .jl )
4
+ [ ![ Coverage Status] ( https://coveralls.io/repos/JuliaDiffEq/ModelingToolkit .jl/badge.svg?branch=master&service=github )] ( https://coveralls.io/github/JuliaDiffEq/ModelingToolkit .jl?branch=master )
5
+ [ ![ codecov.io] ( http://codecov.io/github/JuliaDiffEq/ModelingToolkit .jl/coverage.svg?branch=master )] ( http://codecov.io/github/JuliaDiffEq/ModelingToolkit .jl?branch=master )
6
6
7
- SciCompDSL .jl is an intermediate representation (IR) of computational graphs
7
+ ModelingToolkit .jl is an intermediate representation (IR) of computational graphs
8
8
for scientific computing problems. Its purpose is to be a common target for
9
9
modeling DSLs in order to allow for a common platform for model inspection and
10
10
transformation. It uses a tagged variable IR in order to allow specification of
@@ -25,7 +25,7 @@ system, we need to differentiate between our dependent variables, independent
25
25
variables, and parameters. Therefore we label them as follows:
26
26
27
27
``` julia
28
- using SciCompDSL
28
+ using ModelingToolkit
29
29
30
30
# Define some variables
31
31
@IVar t
@@ -57,7 +57,7 @@ This can then generate the function. For example, we can see the
57
57
generated code via:
58
58
59
59
``` julia
60
- SciCompDSL . generate_ode_function (de)
60
+ ModelingToolkit . generate_ode_function (de)
61
61
62
62
# # Which returns:
63
63
:((du, u, p, t)-> begin
@@ -100,14 +100,14 @@ eqs = [0 ~ σ*(y-x),
100
100
0 ~ x* (ρ- z)- y,
101
101
0 ~ x* y - β* z]
102
102
ns = NonlinearSystem (eqs)
103
- nlsys_func = SciCompDSL . generate_nlsys_function (ns)
103
+ nlsys_func = ModelingToolkit . generate_nlsys_function (ns)
104
104
```
105
105
106
106
which generates:
107
107
108
108
``` julia
109
- (du, u, p)-> begin # C:\Users\Chris\.julia\v0.6\SciCompDSL \src\systems.jl, line 51:
110
- begin # C:\Users\Chris\.julia\v0.6\SciCompDSL \src\utils.jl, line 2:
109
+ (du, u, p)-> begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit \src\systems.jl, line 51:
110
+ begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit \src\utils.jl, line 2:
111
111
y = u[1 ]
112
112
x = u[2 ]
113
113
z = u[3 ]
@@ -131,7 +131,7 @@ f2 = (du,u) -> f(du,u,(10.0,26.0,2.33))
131
131
132
132
## Core Principles
133
133
134
- The core idea behind SciCompDSL .jl is that mathematical equations require
134
+ The core idea behind ModelingToolkit .jl is that mathematical equations require
135
135
context, and thus any symbolic manipulations and full model specifications
136
136
requires the ability to handle such context. When writing DSLs, this fact
137
137
comes to light very quickly. Every DSL seems to lower to some intermediate
@@ -255,7 +255,7 @@ to better scale to larger systems. You can define derivatives for your own
255
255
function via the dispatch:
256
256
257
257
``` julia
258
- SciCompDSL . Derivative (:: typeof (my_function),args,:: Type{Val{i}} )
258
+ ModelingToolkit . Derivative (:: typeof (my_function),args,:: Type{Val{i}} )
259
259
```
260
260
261
261
where ` i ` means that it's the derivative of the ` i ` th argument. ` args ` is the
@@ -265,7 +265,7 @@ You should return an `Operation` for the derivative of your function.
265
265
For example, ` sin(t) ` 's derivative (by ` t ` ) is given by the following:
266
266
267
267
``` julia
268
- SciCompDSL . Derivative (:: typeof (sin),args,:: Type{Val{1}} ) = cos (args[1 ])
268
+ ModelingToolkit . Derivative (:: typeof (sin),args,:: Type{Val{1}} ) = cos (args[1 ])
269
269
```
270
270
271
271
### Macro-free Usage
@@ -306,14 +306,14 @@ eqs = [a ~ y-x,
306
306
0 ~ x* (ρ- z)- y,
307
307
0 ~ x* y - β* z]
308
308
ns = NonlinearSystem (eqs,[x,y,z],[σ,ρ,β])
309
- nlsys_func = SciCompDSL . generate_nlsys_function (ns)
309
+ nlsys_func = ModelingToolkit . generate_nlsys_function (ns)
310
310
```
311
311
312
312
expands to:
313
313
314
314
``` julia
315
- :((du, u, p)-> begin # C:\Users\Chris\.julia\v0.6\SciCompDSL \src\systems.jl, line 85:
316
- begin # C:\Users\Chris\.julia\v0.6\SciCompDSL \src\utils.jl, line 2:
315
+ :((du, u, p)-> begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit \src\systems.jl, line 85:
316
+ begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit \src\utils.jl, line 2:
317
317
x = u[1 ]
318
318
y = u[2 ]
319
319
z = u[3 ]
0 commit comments