Skip to content

subs, better printing, copy and for loops

Latest
Compare
Choose a tag to compare
@HugoGranstrom HugoGranstrom released this 02 Sep 17:23
· 9 commits to master since this release
  • subs can be used to substitute parts of an expression with another. For example subs((x - y)^2 + z, x-y, z) gives z^2 + z.
  • A basic taylor expansion using subs behind the scenes. Use it like this: taylor(sin(x), x, 0, 5) to get the 5 first terms of sin's taylor series around x=0 (i.e. the Maclaurin series).
  • Better and more consistent printing
  • You can copy a expression using let newCopy = copy(symExpr) which does a deep copy. On the lower level we have copySymNode (shallow) and copySymTree (deep).
  • Added the ability to loop over expressions. I.e. over the terms in a Add and the factors in a Mul.
  • Check if a SymExpr is a number, symbol, Add, Mul, pow or func using: isNumber, isSymbol, isFunc, isPow, isAdd, isMul.