Happy New Year to all,

I'm a newb with SymPy so may need some hand holding in its appropriate 
use.  Warning ego boost forthcoming: Sympy a most impressive addition to 
Python, and deserves many prestigious accolades for what it can accomplish 
within the Python framework.  My hat off to all its developers.  

Anyways on to the point of this posting:

*Request for additional documentation*
*Personal Objective: *simplify generated equations using 
Leaf nodes, for example:
'X','1.0'
and unary/binary "functions", for example:
'+','-','*','%','SIN','COS','EXP','LOG'
such that the result is a finite real number for equations of one variable 
(x).
SymPy Issues:
Its not clear how to:
1) enforce that the formula' symbol simplification always result in a 
non-imaginary equation (ie A+B*i is not ideal) and
2) whether the result of a variable substitution (eg x=2) can cause the 
formula to equation to a certain type and/or value range (ie it must always 
be a real result, but if its infinite or undefined allow conditional 
testing of the result type).  

*Example session from SymPy Shell (showing substitution of x with 2, gives 
an imaginary result):*

>>> 
((log(((sin(1.0)-x)+(cos(1.0)%exp(x))))%(((1.0*1.0)%cos(1.0))*log(sin(1.0))))-sin((exp((cos(1.0)+1.0))%(cos(cos(x))-(log(x)*exp(x))))))
*Result (NB: super-text alignment for "power" and mult operators were lost 
in copy/paste):*
−sin(Mod(4.66600061716673,−1.0exlog(x)+1.0cos(cos(x))))+Mod(1.0log(−x+Mod(0.54030230586814,1.0ex)+0.841470984807897),−0.0793455441584221)

>>> x=2.0
>>> 
((log(((sin(1.0)-x)+(cos(1.0)%exp(x))))%(((1.0*1.0)%cos(1.0))*log(sin(1.0))))-sin((exp((cos(1.0)+1.0))%(cos(cos(x))-(log(x)*exp(x))))))
*Result: (ditto)*
−1.0Mod(0.00482678027827896−1.0iπ,0.0793455441584221)−0.570000843230427


*Documentation Issues:*
In some documentation "assume" is used to apparently refine the type or 
range of numbers in equations (on 
http://code.google.com/p/sympy/wiki/SympyResearch This is a well written 
page but apparently has been transferred to another location and may no 
longer be valid by nature of it being "research").
However, trying this information in "SymPy shell" did not work.
Refencing http://docs.sympy.org/latest/modules/assumptions/assume.html only 
adds to the confusion.
That is, the examples there don't work within the popup 'SymPy shell'! 
Ticket #2722 entered (on 
https://github.com/sympy/sympy/issues?page=1&state=open)

*"How to" Questions (request for examples):*
1) when/if would you use "assume"?
2) Are all the param names still valid in the current release? (from the 
google code research page given above)
3) How do we constrain the simplification of formula to use non imaginary 
results?
4) More specifically how do we simplify an equation so it stays as real 
only.
5) How do we test for SymPy specific types eg Infinity "oo"?

I'm assuming all questions are unrelated, but please re-organize if they 
are indeed related?

Thanks,

Evan


-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to