1.2.3-SNAPSHOT Arrow_down_16x16
  • (deriv-fn [& args] expr v)
  • (deriv-fn [& args] expr v degree)


Examples:
(use '(incanter core symbolic))

(deriv-fn [x y] (+ (* x y) x) x)

((deriv-fn [x y] (+ (* x y) x) x) 5 9)

(use 'incanter.charts)
(doto (function-plot sin -5 5)
(add-function (deriv-fn [x] (sin x) x) -5 5)
(add-function (deriv-fn [x] (sin x) x 2) -5 5)
view)

(let [f (fn [x] (pow x 2))
df (deriv-fn [x] (pow x 2) x)]
(doto (function-plot f -5 5)
(add-function df -5 5)
view))


(let [f (fn [x] (pow x 3))
df (deriv-fn [x] (pow x 3) x)]
(doto (function-plot f -5 5)
(add-function df -5 5)
view))


;; NOT WORKING YET

(let [f (fn [x] (/ 1 x ))
df (deriv-fn [x] (/ 1 x) x)]
(doto (function-plot f 0.5 5)
(add-function df 0.5 5)
view))


0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/symbolic.clj:263 top

(defmacro deriv-fn
"

  Examples:
    (use '(incanter core symbolic))

    (deriv-fn [x y] (+ (* x y) x) x)

    ((deriv-fn [x y] (+ (* x y) x) x) 5 9)

    (use 'incanter.charts)
    (doto (function-plot sin -5 5)
       (add-function (deriv-fn [x] (sin x) x) -5 5)
       (add-function (deriv-fn [x] (sin x) x 2) -5 5)
       view)

    (let [f (fn [x] (pow x 2))
          df (deriv-fn [x] (pow x 2) x)]
      (doto (function-plot f -5 5)
        (add-function df -5 5)
        view))


    (let [f (fn [x] (pow x 3))
          df (deriv-fn [x] (pow x 3) x)]
      (doto (function-plot f -5 5)
        (add-function df -5 5)
        view))


    ;; NOT WORKING YET

    (let [f (fn [x] (/ 1 x ))
          df (deriv-fn [x] (/ 1 x) x)]
      (doto (function-plot f 0.5 5)
        (add-function df 0.5 5)
        view))


"
([[& args] expr v]
   `(deriv-fn* '[~@args] '~expr '~v 1))
([[& args] expr v degree]
   `(deriv-fn* '[~@args] '~expr '~v ~degree)))
Vars in incanter.symbolic/deriv-fn: defmacro apply concat list seq vector
Used in 0 other vars

Comments top

No comments for deriv-fn. Log in to add a comment.