Skip to content

Commit efe1d97

Browse files
Remove "operator" terminology
1 parent b7a88c2 commit efe1d97

File tree

4 files changed

+10
-16
lines changed

4 files changed

+10
-16
lines changed

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ context-aware single variable of the IR. Its fields are described as follows:
163163
to set units or denote a variable as being of higher precision.
164164
- `subtype`: the main denotation of context. Variables within systems
165165
are grouped according to their `subtype`.
166-
- `diff`: the operator objects attached to the variable
166+
- `diff`: the `Differential` object representing the quantity the variable is differentiated with respect to, or `nothing`
167167
- `dependents`: the vector of variables on which the current variable
168168
is dependent. For example, `u(t,x)` has dependents `[t,x]`. Derivatives thus
169169
require this information in order to simplify down.
@@ -182,19 +182,14 @@ context-aware single variable of the IR. Its fields are described as follows:
182182
### Operations
183183

184184
Operations are the basic composition of variables and puts together the pieces
185-
with a function. The operator `~` is a special operator which denotes equality
185+
with a function. The `~` function denotes equality
186186
between the arguments.
187187

188-
### Operators
188+
### Differentials
189189

190-
An operator is an object which modifies variables via `*`. It adds the operator
191-
to the `diff` field of the variable and changes the interpretation of the variable.
192-
The current operators are:
193-
194-
- `Differential`: a differential denotes the derivative with respect to a given
195-
variable. It can be expanded via `expand_derivatives` which symbolically
196-
differentiates expressions recursively and cancels out appropriate constant
197-
variables.
190+
A `Differential` denotes the derivative with respect to a given variable. It can
191+
be expanded via `expand_derivatives`, which symbolically differentiates
192+
expressions recursively and cancels out appropriate constant variables.
198193

199194
### Systems
200195

src/ModelingToolkit.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import MacroTools: splitdef, combinedef
88

99
abstract type Expression <: Number end
1010
abstract type AbstractOperation <: Expression end
11-
abstract type AbstractOperator <: Expression end
1211
abstract type AbstractComponent <: Expression end
1312
abstract type AbstractSystem end
1413
abstract type AbstractDomain end
@@ -26,14 +25,14 @@ function caclulate_jacobian end
2625
@enum FunctionVersions ArrayFunction=1 SArrayFunction=2
2726

2827
include("operations.jl")
29-
include("operators.jl")
28+
include("differentials.jl")
3029
include("systems/diffeqs/diffeqsystem.jl")
3130
include("systems/diffeqs/first_order_transform.jl")
3231
include("systems/nonlinear/nonlinear_system.jl")
3332
include("function_registration.jl")
3433
include("simplify.jl")
3534
include("utils.jl")
3635

37-
export Operation, Expression, AbstractOperator, AbstractComponent, AbstractDomain
36+
export Operation, Expression, AbstractComponent, AbstractDomain
3837
export @register
3938
end # module

src/operators.jl renamed to src/differentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
struct Differential <: AbstractOperator
1+
struct Differential
22
x::Union{Variable,Operation}
33
order::Int
44
end

src/variables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mutable struct Variable <: Expression
33
value
44
value_type::DataType
55
subtype::Symbol
6-
diff::Union{AbstractOperator,Nothing}
6+
diff::Union{Differential,Nothing}
77
dependents::Vector{Variable}
88
description::String
99
flow::Bool

0 commit comments

Comments
 (0)