Hi all

I've been searching just to check if what I want to do is feasible with 
sympy. The thing is that I have an expression ('a/b+c/d') for which I want 
to give several sets of values and for each set render the latex without 
evaluating it. I don't know how to avoid automatic evaluation and 
simplification. Any help would be fantastic!

    a,b,c,d = symbols('a b c d')
    fvars = [a,b,c,d] 
    values = [1,4,2,4];  #example: 1/4+2/4
    exp=sympify('a/b + c/d');  #here I define the algebraic expression
    res=nsimplify(exp.evalf(subs = dict(zip(fvars,values))))  #here I get 
the result for later use
    
    straux=urllib.quote(printing.latex(exp))  #urllib is for making the 
expression URL friendly... the thing us that latex(exp)
                                                             #I have tried 
exp.subs(a,1...) and eval (making a=1, b=4... and it gives 3/4, not 1/4 + 
2/4
    
strchart='http://chart.apis.google.com/chart?cht=tx&chs=140x50&chf=bg,s,FFFFFF00&chl='
 
+ straux

Thanks!

-- 
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 sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
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