We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea836eb commit 5854180Copy full SHA for 5854180
src/Symbolics.jl
@@ -64,9 +64,10 @@ include("rewrite-helpers.jl")
64
include("complex.jl")
65
66
"""
67
- substitute(expr, s)
+ substitute(expr, s; fold=true)
68
69
Performs the substitution on `expr` according to rule(s) `s`.
70
+If `fold=false`, expressions which can be evaluated won't be evaluated.
71
# Examples
72
```jldoctest
73
julia> @variables t x y z(t)
@@ -79,6 +80,8 @@ julia> ex = x + y + sin(z)
79
80
(x + y) + sin(z(t))
81
julia> substitute(ex, Dict([x => z, sin(z) => z^2]))
82
(z(t) + y) + (z(t) ^ 2)
83
+julia> substitute(sqrt(2x), Dict([x => 1]); fold=false)
84
+sqrt(2)
85
```
86
87
substitute
0 commit comments