source: project/release/4/derivative/trunk/tests/run.scm @ 30617

Last change on this file since 30617 was 30617, checked in by Ivan Raikov, 7 years ago

initial import of derivative, a library for computing the symbolic derivative of an arithmetic expression

File size: 701 bytes
Line 
1(use derivative)
2
3(pp (derivative-expr `(* 5 w)))
4
5(pp (derivative-expr `(* 5 (pow x 2))))
6(pp (derivative-expr `(+ (* 5 (pow x 2)) (* 2 (pow y 3)))))
7(pp (derivative-expr `(+ (* 2 x) (* 5 (* x y)))))
8(pp (derivative-expr `(/ t tau)))
9(pp (derivative-expr `(* w (- (exp (/ t tau)) (exp (/ t taus))))))
10
11(print (let ((expr `(+ (* 2 x) 5)))
12         (newton-search (cons expr (derivative-expr expr))
13                        0.0 1e-4 1)))
14
15;;(pp (derivative-expr `(exp (neg (/ (- t (const t_i)) (const tau))))))
16(pp (derivative-expr `(* (const w) 
17                         (- (exp (neg (/ (- t (const t_i)) (const tau))))
18                            (exp (neg (/ (- t (const t_i)) (const taus))))))))
19
20
21
Note: See TracBrowser for help on using the repository browser.