Skip to content

Commit

Permalink
rename to ModelingToolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Mar 18, 2018
1 parent 0543563 commit b36ef70
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ git:

## uncomment the following lines to override the default test script
#script:
# - julia -e 'Pkg.clone(pwd()); Pkg.build("SciCompDSL"); Pkg.test("SciCompDSL"; coverage=true)'
# - julia -e 'Pkg.clone(pwd()); Pkg.build("ModelingToolkit"); Pkg.test("ModelingToolkit"; coverage=true)'
after_success:
# push coverage results to Coveralls
- julia -e 'cd(Pkg.dir("SciCompDSL")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
- julia -e 'cd(Pkg.dir("ModelingToolkit")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'cd(Pkg.dir("SciCompDSL")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
- julia -e 'cd(Pkg.dir("ModelingToolkit")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The SciCompDSL.jl package is licensed under the MIT "Expat" License:
The ModelingToolkit.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2018: Christopher Rackauckas.
>
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SciCompDSL.jl
# ModelingToolkit.jl

[![Build Status](https://travis-ci.org/JuliaDiffEq/SciCompDSL.jl.svg?branch=master)](https://travis-ci.org/JuliaDiffEq/SciCompDSL.jl)
[![Coverage Status](https://coveralls.io/repos/JuliaDiffEq/SciCompDSL.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/JuliaDiffEq/SciCompDSL.jl?branch=master)
[![codecov.io](http://codecov.io/github/JuliaDiffEq/SciCompDSL.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiffEq/SciCompDSL.jl?branch=master)
[![Build Status](https://travis-ci.org/JuliaDiffEq/ModelingToolkit.jl.svg?branch=master)](https://travis-ci.org/JuliaDiffEq/ModelingToolkit.jl)
[![Coverage Status](https://coveralls.io/repos/JuliaDiffEq/ModelingToolkit.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/JuliaDiffEq/ModelingToolkit.jl?branch=master)
[![codecov.io](http://codecov.io/github/JuliaDiffEq/ModelingToolkit.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiffEq/ModelingToolkit.jl?branch=master)

SciCompDSL.jl is an intermediate representation (IR) of computational graphs
ModelingToolkit.jl is an intermediate representation (IR) of computational graphs
for scientific computing problems. Its purpose is to be a common target for
modeling DSLs in order to allow for a common platform for model inspection and
transformation. It uses a tagged variable IR in order to allow specification of
Expand All @@ -25,7 +25,7 @@ system, we need to differentiate between our dependent variables, independent
variables, and parameters. Therefore we label them as follows:

```julia
using SciCompDSL
using ModelingToolkit

# Define some variables
@IVar t
Expand Down Expand Up @@ -57,7 +57,7 @@ This can then generate the function. For example, we can see the
generated code via:

```julia
SciCompDSL.generate_ode_function(de)
ModelingToolkit.generate_ode_function(de)

## Which returns:
:((du, u, p, t)->begin
Expand Down Expand Up @@ -100,14 +100,14 @@ eqs = [0 ~ σ*(y-x),
0 ~ x*-z)-y,
0 ~ x*y - β*z]
ns = NonlinearSystem(eqs)
nlsys_func = SciCompDSL.generate_nlsys_function(ns)
nlsys_func = ModelingToolkit.generate_nlsys_function(ns)
```

which generates:

```julia
(du, u, p)->begin # C:\Users\Chris\.julia\v0.6\SciCompDSL\src\systems.jl, line 51:
begin # C:\Users\Chris\.julia\v0.6\SciCompDSL\src\utils.jl, line 2:
(du, u, p)->begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit\src\systems.jl, line 51:
begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit\src\utils.jl, line 2:
y = u[1]
x = u[2]
z = u[3]
Expand All @@ -131,7 +131,7 @@ f2 = (du,u) -> f(du,u,(10.0,26.0,2.33))

## Core Principles

The core idea behind SciCompDSL.jl is that mathematical equations require
The core idea behind ModelingToolkit.jl is that mathematical equations require
context, and thus any symbolic manipulations and full model specifications
requires the ability to handle such context. When writing DSLs, this fact
comes to light very quickly. Every DSL seems to lower to some intermediate
Expand Down Expand Up @@ -255,7 +255,7 @@ to better scale to larger systems. You can define derivatives for your own
function via the dispatch:

```julia
SciCompDSL.Derivative(::typeof(my_function),args,::Type{Val{i}})
ModelingToolkit.Derivative(::typeof(my_function),args,::Type{Val{i}})
```

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

```julia
SciCompDSL.Derivative(::typeof(sin),args,::Type{Val{1}}) = cos(args[1])
ModelingToolkit.Derivative(::typeof(sin),args,::Type{Val{1}}) = cos(args[1])
```

### Macro-free Usage
Expand Down Expand Up @@ -306,14 +306,14 @@ eqs = [a ~ y-x,
0 ~ x*-z)-y,
0 ~ x*y - β*z]
ns = NonlinearSystem(eqs,[x,y,z],[σ,ρ,β])
nlsys_func = SciCompDSL.generate_nlsys_function(ns)
nlsys_func = ModelingToolkit.generate_nlsys_function(ns)
```

expands to:

```julia
:((du, u, p)->begin # C:\Users\Chris\.julia\v0.6\SciCompDSL\src\systems.jl, line 85:
begin # C:\Users\Chris\.julia\v0.6\SciCompDSL\src\utils.jl, line 2:
:((du, u, p)->begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit\src\systems.jl, line 85:
begin # C:\Users\Chris\.julia\v0.6\ModelingToolkit\src\utils.jl, line 2:
x = u[1]
y = u[2]
z = u[3]
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"SciCompDSL\"); Pkg.build(\"SciCompDSL\")"
Pkg.clone(pwd(), \"ModelingToolkit\"); Pkg.build(\"ModelingToolkit\")"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"SciCompDSL\")"
- C:\projects\julia\bin\julia -e "Pkg.test(\"ModelingToolkit\")"
2 changes: 1 addition & 1 deletion src/SciCompDSL.jl → src/ModelingToolkit.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module SciCompDSL
module ModelingToolkit

using DiffEqBase
import MacroTools: splitdef, combinedef
Expand Down
2 changes: 1 addition & 1 deletion test/ambiguity.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

@IVar t
Expand Down
2 changes: 1 addition & 1 deletion test/basic_variables_and_operations.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

@IVar t
Expand Down
4 changes: 2 additions & 2 deletions test/derivatives.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

# Derivatives
Expand Down Expand Up @@ -30,7 +30,7 @@ eqs = [0 ~ σ*(y-x),
0 ~ x*-z)-y,
0 ~ x*y - β*z]
sys = NonlinearSystem(eqs,[x,y,z],[σ,ρ,β])
jac = SciCompDSL.calculate_jacobian(sys)
jac = ModelingToolkit.calculate_jacobian(sys)
@test jac[1,1] == σ*-1
@test jac[1,2] == σ
@test jac[1,3] == 0
Expand Down
2 changes: 1 addition & 1 deletion test/internal.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

# `Expr`, `Number` -> `Operation`
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL, Base.Test
using ModelingToolkit, Base.Test

@testset "Parsing Test" begin include("variable_parsing.jl") end
@testset "Basic Variables and Operations" begin include("basic_variables_and_operations.jl") end
Expand Down
24 changes: 12 additions & 12 deletions test/system_construction.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

# Define some variables
Expand All @@ -14,9 +14,9 @@ eqs = [D*x ~ σ*(y-x),
D*y ~ x*-z)-y,
D*z ~ x*y - β*z]
de = DiffEqSystem(eqs,[t],[x,y,z],Variable[],[σ,ρ,β])
SciCompDSL.generate_ode_function(de)
jac_expr = SciCompDSL.generate_ode_jacobian(de)
jac = SciCompDSL.calculate_jacobian(de)
ModelingToolkit.generate_ode_function(de)
jac_expr = ModelingToolkit.generate_ode_jacobian(de)
jac = ModelingToolkit.calculate_jacobian(de)
f = DiffEqFunction(de)
W = I - jac
simplify_constants.(inv(W))
Expand Down Expand Up @@ -65,8 +65,8 @@ eqs = [a ~ y-x,
D*y ~ x*-z)-y,
D*z ~ x*y - β*z]
de = DiffEqSystem(eqs,[t],[x,y,z],[a],[σ,ρ,β])
SciCompDSL.generate_ode_function(de)
jac = SciCompDSL.calculate_jacobian(de)
ModelingToolkit.generate_ode_function(de)
jac = ModelingToolkit.calculate_jacobian(de)
f = DiffEqFunction(de)

# Define a nonlinear system
Expand All @@ -81,7 +81,7 @@ for el in (:vs, :ps)
@test names2 == names
end

SciCompDSL.generate_nlsys_function(ns)
ModelingToolkit.generate_nlsys_function(ns)

# Now nonlinear system with only variables
@Var x y z
Expand All @@ -92,8 +92,8 @@ eqs = [0 ~ σ*(y-x),
0 ~ x*-z)-y,
0 ~ x*y - β*z]
ns = NonlinearSystem(eqs)
nlsys_func = SciCompDSL.generate_nlsys_function(ns)
jac = SciCompDSL.generate_nlsys_jacobian(ns)
nlsys_func = ModelingToolkit.generate_nlsys_function(ns)
jac = ModelingToolkit.generate_nlsys_jacobian(ns)
f = @eval eval(nlsys_func)

# Intermediate calculations
Expand All @@ -103,6 +103,6 @@ eqs = [a ~ y-x,
0 ~ x*-z)-y,
0 ~ x*y - β*z]
ns = NonlinearSystem(eqs,[x,y,z],[σ,ρ,β])
nlsys_func = SciCompDSL.generate_nlsys_function(ns)
jac = SciCompDSL.calculate_jacobian(ns)
jac = SciCompDSL.generate_nlsys_jacobian(ns)
nlsys_func = ModelingToolkit.generate_nlsys_function(ns)
jac = ModelingToolkit.calculate_jacobian(ns)
jac = ModelingToolkit.generate_nlsys_jacobian(ns)
2 changes: 1 addition & 1 deletion test/variable_parsing.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using SciCompDSL
using ModelingToolkit
using Base.Test

@Var a=1.0 b
Expand Down

0 comments on commit b36ef70

Please sign in to comment.