Skip to content

Commit

Permalink
Added test_symata.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
goedman committed Nov 21, 2018
1 parent eba05b5 commit 55bc5e3
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 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

0 comments on commit 55bc5e3

Please sign in to comment.