4
votes
Transform a list of rules into a list of function definitions
rules = {f[x] -> a + 3 h[x], g[x] -> 2 a + c + 6 h[x]}
...
4
votes
Accepted
3
votes
Transform a list of rules into a list of function definitions
To achieve this, we need to manipulate the "DownValues" of the function names. We use "Scan" to operate on all elements of the rule list. As "DownValues" has the ...
2
votes
Transform a list of rules into a list of function definitions
If the left-hand sides of each rule depend on the same variable, @Craig Carter's solution is sufficient, but if not, we can generalize this process using ReplaceAll ...
1
vote
Accepted
How to put prime before value during a substitution?
One approach to get your desired result, of course, is to just put the time dependence explicitly,
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
replacement × 1666list-manipulation × 295
pattern-matching × 243
rule × 196
simplifying-expressions × 103
functions × 86
expression-manipulation × 77
matrix × 75
evaluation × 65
calculus-and-analysis × 59
string-manipulation × 59
equation-solving × 57
function-construction × 54
symbolic × 51
differential-equations × 40
performance-tuning × 38
algebraic-manipulation × 35
hold × 33
plotting × 29
syntax × 24
associations × 24
conditional × 23
output-formatting × 21
polynomials × 21
scoping × 21