Hi,

 Sympy seems is rather  advanced and useful project.

  I've tried to test it using jhepwork, and even included it into
 http://jwork.org/jhepwork/download/
 (version 2.0) for test purpose (directory python/packages)

 Apparently, one can run sympy using Jython (v2.5) and Java !
 A code snipped is below.  Load it into the jHepWork IDE
 editor and press the button  [run].

 However, there is on feature I want to understand. To plot a function
 as in the example below using F1D class, I need to pass a string
 representing this function. However,  simpy cannot accept strings for
the
 statements such as diff() or integral(). In the below example, what I
want
 to do is to type "diff(func,x)".

 Further, if I want to plot the result of "diff"  or integration, I
need again a string
 representing the output function and pass it to the F1D class as in
the example.
 How can I do this?

 thanks, Sergei

********************************************************
# jHepWork Jython example

from java.awt import Font,Color
from jhplot  import *

c1 = HPlot("Canvas")
c1.setAutoRange()

c1.setGTitle("Example", Color.red)
c1.setNameX("X")
c1.setNameY("Y")
c1.setName("Simpy example")
c1.visible()
c1.setAutoRange()

# draw function
func="2*exp(-x*x/50)+sin(pi*x)/x"
f1 = F1D(func, -2.0, 5.0)
c1.draw(f1)

# use sympy
from sympy import *
x = Symbol('x')
print diff(2*exp(-x*x/50)+sin(pi*x)/x, x)

# how to get string with the result
# to build F1D with results for drawing?

# export to some image (png,eps,pdf,jpeg...)
# c1.export(Editor.DocMasterName()+".png")

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to