From 55bc5e3561e82750c5bf6f7b4673aa4c4dd75e1b Mon Sep 17 00:00:00 2001 From: Rob J Goedman Date: Wed, 21 Nov 2018 07:39:58 -0700 Subject: [PATCH] Added test_symata.jl --- test/test_symata.jl | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/test_symata.jl diff --git a/test/test_symata.jl b/test/test_symata.jl new file mode 100644 index 0000000..7c5d5ce --- /dev/null +++ b/test/test_symata.jl @@ -0,0 +1,30 @@ +using Symata, Test + +println() +@sym begin + f(x_) := Sin(x)^Cos(x) + yi = [1, 5, 10] + f1(x_) := Simplify( D(f(x), x, 1) ) + f2(x_) := Simplify( D(f(x), x, 2) ) + SetJ(q, ToString(f1(x))) + SetJ(u, ToString(f2(x))) +end + +@sym Print("f1(x) = ", f1(x)) +println() +@sym Print("f2(x) = ", f2(x)) +println() + +println() +q = @sym ToString(f1(x)); +q |> display +println() +u = @sym ToString(f2(x)); +u |> display +println() + +@eval f1(x) = $(Meta.parse(q)) +@eval f2(x) = $(Meta.parse(u)) + +f1(Complex(4.5)) |> display +f2(Complex(4.5)) |> display