[sage-support] Re: convert string to sage expression

2008-08-30 Thread geir egeland
Thank you for all the help. With your input, I managed to do what I wanted in Sage, and can now finish my paper before the deadline:) regards, Geir Egeland phone +47 906 40 507 email: [EMAIL PROTECTED] PhD Candidate University of Stavanger and Research Scientist Telenor R&I On 30 Aug 2008, at

[sage-support] Re: convert string to sage expression

2008-08-29 Thread William Stein
On Fri, Aug 29, 2008 at 5:12 PM, Simon King <[EMAIL PROTECTED]> wrote: > > Hi Geir, > > If you really want to use strings, it may work like that: > sage: var('x y') > (x, y) > sage: EqL=['y==x**%d-%d'%(i,i) for i in range(10)] > sage: for X in EqL: > : print X > : print solve(eval(

[sage-support] Re: convert string to sage expression

2008-08-29 Thread Simon King
Hi Geir, If you really want to use strings, it may work like that: sage: var('x y') (x, y) sage: EqL=['y==x**%d-%d'%(i,i) for i in range(10)] sage: for X in EqL: : print X : print solve(eval(X)) : y==x**0-0 [ y == 1 ] y==x**1-1 [

[sage-support] Re: convert string to sage expression

2008-08-29 Thread Mike Hansen
Hello, On Fri, Aug 29, 2008 at 4:00 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to construct a set of equations using strings. For example: > > for i in range(0,10): > eq1="eq=x^"+str(i)+"-"+str(i) Is there a reason why you wanted to do it using strings? It's a bit cleaner/easier