Re: [sage-support] Re: solve and numerical answers

2020-09-16 Thread kcrisman
On Tuesday, September 15, 2020 at 3:20:13 PM UTC-4 Emmanuel Charpentier wrote: > sage: L[1].n() > > fails because L1 is an equation, i. e a symbolic expression whose operator > is the built-in “eq”, which has no n() method. > > However, > > sage: PP=-625/1000*t^4 + 2355/100*t^3 - 264051/1000*t

Re: [sage-support] Re: solve and numerical answers

2020-09-15 Thread Emmanuel Charpentier
sage: L[1].n() fails because L1 is an equation, i. e a symbolic expression whose operator is the built-in “eq”, which has no n() method. However, sage: PP=-625/1000*t^4 + 2355/100*t^3 - 264051/1000*t^2 + 10269/10*t - 8538/10 sage: PP.parent() Symbolic Ring sage: L=solve(PP,t) sage: L[1].rhs()

Re: [sage-support] Re: solve and numerical answers

2020-09-15 Thread Fernando Gouvea
Thanks! I've already learned more. What I first did was this: sage: PP -0.625*t^4 + 23.55000*t^3 - 264.0510*t^2 + 1026.900*t - 853.8000 sage: L=solve(PP==0,t) sage: L[1] t == -1/1250*sqrt((390625*(4/1953125*I*sqrt(37468876945450884598)*sqrt(5) - 39

[sage-support] Re: solve and numerical answers

2020-09-15 Thread kcrisman
> I still don't know my way around the Sage documentation... Sorry for the > elementary question. > > Yeah, we are sorry that it never has gotten more organized (though it is actually quite thorough!). You may want to try the French (now in English) Sage book, or Greg Bard's AMS (but free on

[sage-support] Re: Solve this Equation for H: 5260862 = M*H^y % 20876441; know variables y and M.

2020-05-14 Thread rickhg12hs
H = (Mod(20192834, 20876441)^-1 * 5260862).nth_root(17) On Thursday, May 14, 2020 at 3:26:09 PM UTC+2, Madison Adams wrote: > > Solve this Equation for H: 5260862 = M*H^y % 20876441 > > Does anyone happen to know the steps to solve for h: > Equation: 5260862 = M*Hy % 20876441 > > Where y = 17, and

[sage-support] Re: Solve inequality in Sage

2019-10-20 Thread Julian Rüth
Have you had a look at https://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html? Seems to be what you want to do essentially. julian On Sunday, October 20, 2019 at 5:34:37 PM UTC+2, Santanu wrote: > > Hi, > I have inequalities like these: > > 3 x1 + 5 x2 + 2 x3 + 5 x4 + 7 x

Re: [sage-support] Re: Solve equation efficiently

2019-07-30 Thread John Cremona
On Tue, 30 Jul 2019 at 05:56, Kwankyu wrote: > > > On Thursday, July 25, 2019 at 12:08:20 AM UTC+9, chandra chowdhury wrote: >> >> I have matrices B and C of size (m,n) over integer with m>n. >> I know there is matrix A of size (m,m) such that >> AB=C. How to find A efficiently in Sage? >> > Try

[sage-support] Re: Solve equation efficiently

2019-07-29 Thread Kwankyu
On Thursday, July 25, 2019 at 12:08:20 AM UTC+9, chandra chowdhury wrote: > > I have matrices B and C of size (m,n) over integer with m>n. > I know there is matrix A of size (m,m) such that > AB=C. How to find A efficiently in Sage? > I guess there is no special way in Sage to solve your kind

[sage-support] Re: solve() behavior

2019-02-20 Thread Michael Beeson
after solving an equation (or not) for x, I can check if the answer still contains x by ans.has(x). That should weed out any non-explicit solutions. But still: am I guaranteed for any class of equations, e.g. polynomial equations of degree <= 4, that if solve produces an empty list there re

[sage-support] Re: solve() behavior

2019-02-19 Thread John H Palmieri
On Tuesday, February 19, 2019 at 8:56:50 AM UTC-8, Michael Beeson wrote: > > When I try to reproduce Eric's post, I get an error message about an > unexpected keyword argument > (maybe my version of Sage is too old.) But look at this: > > sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x,explicit_so

[sage-support] Re: solve() behavior

2019-02-19 Thread Michael Beeson
When I try to reproduce Eric's post, I get an error message about an unexpected keyword argument (maybe my version of Sage is too old.) But look at this: sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x,explicit_solutions=True) [1/4*I*sqrt(41) + 7/4 == -1/2*sqrt(7/2*I*sqrt(41) + 2), 1/4*I*sqrt(41)

[sage-support] Re: solve() behavior

2019-02-18 Thread Michael Beeson
Eric's post shows me how to get that particular example solved. But my real concern is, when my code (inside some deep loop) calls solve, I want to know (a) if it returns an answer, that answer really is a solution, and (b) if it returns an empty list, there really is no solution. S

[sage-support] Re: solve() behavior

2019-02-18 Thread Eric Gourgoulhon
Hi, Le lundi 18 février 2019 21:56:56 UTC+1, Michael Beeson a écrit : > > sage: solve(*2**(x+sqrt(*1*-x^*2*))-*7*,x) > > [x == -sqrt(-x^2 + 1) + 7/2] > > > sage: version() > > 'SageMath version 8.0, Release Date: 2017-07-21' > > > That doesn't look like a solution to me because x still appears on

[sage-support] Re: solve

2018-10-05 Thread HG
yes exactly what I wanted. Sorry again for the bad explanation of my problem, by the way I hadn't found the wiki you gave the link Thanks Henri Le vendredi 5 octobre 2018 13:05:06 UTC+2, HG a écrit : > > I would like to solve these equations but I don't know how? > > > > t_0=t_p==gamma*(t-V*x/c^2

[sage-support] Re: solve

2018-10-05 Thread slelievre
It seems you want to revert the Lorentz transformation: https://en.wikipedia.org/wiki/Lorentz_factor#Occurrence In this case you have a system of equations relating the various quantities c, ga, t, tt, x, xx, v, where - ga is the gamma factor, c is the speed of light, - v is the relative speed of

[sage-support] Re: solve

2018-10-05 Thread HG
sorry for the bazar ! I don't know how to make latex in the mail I will make it with sage Le vendredi 5 octobre 2018 13:05:06 UTC+2, HG a écrit : > > I would like to solve these equations but I don't know how? > > > > t_0=t_p==gamma*(t-V*x/c^2);show(t_0) > > x_0=x_p==gamma*(x-V*t);show(x_0) > > >

[sage-support] Re: solve

2018-10-05 Thread HG
Sorry for not being clear :) I wonder if I can calculate x'′=γ(x−vt) t′=γ(t−vxc2) γ=11√−v2c2 Le vendredi 5 octobre 2018 13:05:06 UTC+2, HG a écrit : > > I would like to solve these equations but I don't know how? > > > > t'=gamma*(t-vx/c^2);show(t') > > x'=gamma*(x-v*t);show(x') > > > > solve(t_0

[sage-support] Re: solve /desolve

2018-10-05 Thread slelievre
On Wed 2018-10-03, 18:34:51 UTC+2, HG wrote: > I would like to solve these equations but I don't know how? > > t_0=t_p==gamma*(t-V*x/c^2);show(t_0) > x_0=x_p==gamma*(x-V*t);show(x_0) > > solve(t_0,gamma*(t-V*x/c^2)) > desolve(gamma*(t-V*x/c^2)==0,x) > > error desolve() takes at least 2 arguments (

[sage-support] Re: solve() determines incorrect number of roots

2016-11-29 Thread Dima Pasechnik
You are doing inexact computations, and imaginary errors creep in. Indeed, let's first run without assume()'s: sage: s=solve(f(x) == 0,x) sage: [t.rhs().n() for t in s] [0.464973569257452 - 1.11022302462516e-16*I, 0.0267727617252126 + 1.11022302462516e-16*I, 2.00825366901734] so you see a tin

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-10 Thread kcrisman
> > > > Interesting. If you have ideas on how to improve it so that you might > do > > so, please start a thread on sage-devel about that. > > I don't. I have expressed my dislike of AskSage as soon as it was > available. It is just that I don't like all these badges and awards and > I do

Re: [sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-10 Thread John Cremona
Sage has two sources of support, the mailing list sage-support and the AskSage site. Users and helpful developers can use whichever they choose, and I don't think that any of us should be telling anyone which one they ought to use, either as an asker of questions or as a helpful answerer. Of cour

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-10 Thread Simon King
Hi Karl-Dieter, On 2016-11-09, kcrisman wrote: >> > This is a very good question for Ask Sage, would you ask it there? >> >> Why should he? He did ask here. And I, for one, dislike the Ask Sage >> pages to the extent that I wouldn't answer questions there. >> > > Interesting. If you have ide

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-09 Thread kcrisman
> > This is a very good question for Ask Sage, would you ask it there? > > Why should he? He did ask here. And I, for one, dislike the Ask Sage > pages to the extent that I wouldn't answer questions there. > Interesting. If you have ideas on how to improve it so that you might do so, plea

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-09 Thread Emmanuel Charpentier
A bit of numerical analysis (see enclosed Jupyter notebook) proves that this polynomial has at least two real roots, and quite probably four), one of them being positive. This triggers the question : does Sage have built-in facilities for uncertainty computation ("calcul d'erreurs" in French, b

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-09 Thread Simon King
On 2016-11-08, slelievre wrote: > This is a very good question for Ask Sage, would you ask it there? Why should he? He did ask here. And I, for one, dislike the Ask Sage pages to the extent that I wouldn't answer questions there. Cheers, Simon -- You received this message because you are subsc

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-08 Thread slelievre
Sun 2016-11-06 16:00:30 UTC+1, Francis Banks: > I am solving a polynomial which arises from plotting titration cures > in chemistry. The rule of signs suggests it has one positive root. > Find_root seems to find it. Solve with poly_solve=true does not. > Instead it gives 4 complex roots, which don

[sage-support] Re: Solve gives incorrect solutions for polynomial

2016-11-06 Thread Dima Pasechnik
On Sunday, November 6, 2016 at 3:00:30 PM UTC, Francis Banks wrote: > > I am solving a polynomial which arises from plotting titration cures in > chemistry. The rule of signs suggests it has one positive root. Find_root > seems to find it. Solve with poly_solve=true does not. Instead it gives 4

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2015-03-09 Thread platane
thank you, Simon > > many computational aspects, but still human insight is needed to break a > problem up into sub-problems of chewable size, or transform the original > problem into one that is more accessible to automatic solutions. And > even if a computer algebra system (no matter which o

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2015-03-09 Thread platane
> > In fact, the solution is: w=t+t^2 > > Are you sure? Assuming some value for t, plotting the expression > doesn't seem to show a solution at w = t + t^2. > I am sorry. I made a mistake. > best > > Robert Dodier > > -- You received this message because you are subscribed to the Goo

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2015-03-09 Thread Simon King
Hi! On 2015-03-09, platane wrote: > Thanks to Emmanuel Charpentier for the solution. > But the trick is S1[0]^2 that needs human works. Sure. But that's a very common situation. Computers are very good in many computational aspects, but still human insight is needed to break a problem up into su

Re: [sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2015-03-09 Thread platane
Thanks to Emmanuel Charpentier for the solution. But the trick is S1[0]^2 that needs human works. Le samedi 18 octobre 2014 11:58:37 UTC+2, Emmanuel Charpentier a écrit : > > Well, after a bit of sleep, the solution was (semi-)obvious : > > sage: var("w,t") > (w, t) > sage: E1=-(1/2*sqrt((4*w+1)+1

[sage-support] Re: Solve Quadratic Programming in Sage

2015-01-05 Thread Dominique Laurain
Hello guy, Your "question" looks like a modeling math problem, ...and is not related to SAGE. I wouln't try to solve "quadratic" problem using "linear" solvers : LP means "Linear Programming" for definition of LP, read http://www.sagemath.org/doc/reference/numerical/sage/numerical/mip.html

[sage-support] Re: Solve MixedIntegerLinearProgram for variables that are limited to the given set

2014-12-11 Thread pegah Ali
Hello Dima, Thank you for your response. It gave me some ideas :) On Thursday, December 11, 2014 3:19:24 PM UTC+1, pegah Ali wrote: > > Hello everybody, > > I am new to sage and try to solve the following LP with > MixedIntegerLinearProgram: > > > > Maximization: > 3.0 x_0 + 2.0 x_

[sage-support] Re: Solve MixedIntegerLinearProgram for variables that are limited to the given set

2014-12-11 Thread Dima Pasechnik
On 2014-12-11, pegah Ali wrote: > --=_Part_141_146171712.1418307564716 > Content-Type: multipart/alternative; > boundary="=_Part_142_2134155063.1418307564716" > > --=_Part_142_2134155063.1418307564716 > Content-Type: text/plain; charset=UTF-8 > > Hello everybody, > > I am new to

Re: [sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-18 Thread Emmanuel Charpentier
Well, after a bit of sleep, the solution was (semi-)obvious : sage: var("w,t") (w, t) sage: E1=-(1/2*sqrt((4*w+1)+1))*t+w==0 sage: S1=E1.solve(w) sage: S1 [w == 1/2*t*sqrt(4*w + 2)] sage: S2=((S1[0])^2).solve(w) sage: S2 [w == 1/2*t^2 - 1/2*sqrt(t^2 + 2)*t, w == 1/2*t^2 + 1/2*sqrt(t^2 + 2)*t] A n

Re: [sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-17 Thread Emmanuel Charpentier
Le vendredi 17 octobre 2014 16:37:55 UTC+2, vdelecroix a écrit : > > 2014-10-17 10:09 UTC, Emmanuel Charpentier >: > > Ahem ! > > > > On one machine : > > > > sage: sage.version.version > > '6.4.beta4' > > sage: var("w,t") > > (w, t) > > sage: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w) > >

Re: [sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-17 Thread Vincent Delecroix
2014-10-17 10:09 UTC, Emmanuel Charpentier : > Ahem ! > > On one machine : > > sage: sage.version.version > '6.4.beta4' > sage: var("w,t") > (w, t) > sage: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w) > [w == 1/2*t*sqrt(4*w + 2)] This solution is implicit. This is the problem. Vincent -- You received

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-17 Thread Emmanuel Charpentier
Ahem ! On one machine : sage: sage.version.version '6.4.beta4' sage: var("w,t") (w, t) sage: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w) [w == 1/2*t*sqrt(4*w + 2)] sage: maxima.version() '5.34.1' Another one : sage: sage.version.version '6.4.beta1' sage: var("w,t") (w, t) sage: solve(-(1/2*sqrt((4*w

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-16 Thread kcrisman
> > > sage: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w) > > [w == 1/2*sqrt(4*w + 2)*t] > > Well, if I'm not mistaken, Sage punts to Maxima's 'solve' function, > which, I'm sorry to report, is not very strong (it can solve a > relatively narrow range of problems). But I find that Maxima's > 'to_pol

[sage-support] Re: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w)

2014-10-16 Thread Robert Dodier
On 2014-10-15, platane wrote: > solve does not solve ? > > sage: solve(-(1/2*sqrt((4*w+1)+1))*t+w==0,w) > [w == 1/2*sqrt(4*w + 2)*t] Well, if I'm not mistaken, Sage punts to Maxima's 'solve' function, which, I'm sorry to report, is not very strong (it can solve a relatively narrow range of probl

[sage-support] Re: Solve for a function defined in a file?

2014-07-06 Thread David Ingerman
Have zeros of order 2 too, so the sign change doesn't help in general, but may work for some zeros. Thank you!... On Saturday, June 21, 2014 1:21:06 AM UTC-7, Dima Pasechnik wrote: > > On 2014-06-21, David Ingerman > wrote: > > Thank you, that's helpful. Is there a way to get all roots of a P

[sage-support] Re: Solve for a function defined in a file?

2014-06-22 Thread Dima Pasechnik
On 2014-06-22, David Ingerman wrote: > Thank you, that makes sense. My Python function is not continuous though, > has poles, so I'll probably have to plot it to find its zeros... you might perhaps try finding a pole p by solving 1/f(x)=0, and regularise f by multiplying f with (x-p)i^m, for a

[sage-support] Re: Solve for a function defined in a file?

2014-06-21 Thread David Ingerman
Thank you, that makes sense. My Python function is not continuous though, has poles, so I'll probably have to plot it to find its zeros... On Saturday, June 21, 2014 1:21:06 AM UTC-7, Dima Pasechnik wrote: > > On 2014-06-21, David Ingerman > wrote: > > Thank you, that's helpful. Is there a wa

[sage-support] Re: Solve for a function defined in a file?

2014-06-21 Thread Dima Pasechnik
On 2014-06-21, David Ingerman wrote: > Thank you, that's helpful. Is there a way to get all roots of a Python > function on an interval? I never heard of robust procedures for such a task, and doubt they are even possible (think about roots of sin(1/x) on [0,1]). Certainly you can partition t

[sage-support] Re: Solve for a function defined in a file?

2014-06-20 Thread David Ingerman
Thank you, that's helpful. Is there a way to get all roots of a Python function on an interval? On Friday, June 20, 2014 2:10:38 AM UTC-7, Dima Pasechnik wrote: > > On 2014-06-20, David Ingerman > wrote: > > Thank you, so what to do for Python function? Matlab had general > purpose > > 'opt

[sage-support] Re: Solve for a function defined in a file?

2014-06-20 Thread Dima Pasechnik
On 2014-06-20, David Ingerman wrote: > Thank you, so what to do for Python function? Matlab had general purpose > 'optim(f)' if my memory is right... you can e.g. use find_root(); this is a numerical thing that accepts Python functions. Here is an example: sage: def f(x): return x-cos(x)

[sage-support] Re: Solve for a function defined in a file?

2014-06-19 Thread David Ingerman
Thank you, so what to do for Python function? Matlab had general purpose 'optim(f)' if my memory is right... On Wednesday, June 11, 2014 1:50:10 AM UTC-7, Dima Pasechnik wrote: > > On 2014-06-10, David Ingerman > wrote: > > > > How to solve([f(x)==0],x) for a function "f(x)" defined in a

[sage-support] Re: Solve for a function defined in a file?

2014-06-11 Thread Dima Pasechnik
On 2014-06-10, David Ingerman wrote: > > How to solve([f(x)==0],x) for a function "f(x)" defined in a .sage file? > > The error message: TypeError: Cannot evaluate symbolic expression to a > numeric value. what is f(x) ? solve() won't work for a Python function, it needs a symbolic expressi

Re: [sage-support] Re: solve() free variable substitution

2013-06-13 Thread kcrisman
I've opened http://trac.sagemath.org/sage_trac/ticket/14738 for a lot of this stuff. It's all related to keywords not being sufficiently happy. > There is a ticket for adding a lot of that to the main 'solve?' but Trac > seems to be down right now so I can't find it... > http://trac.sagemath

Re: [sage-support] Re: solve() free variable substitution

2013-06-13 Thread kcrisman
> > > Sorry to keep on here, but I've > got three other related queries: > > (1) "solve?" gives me " solve(sin(x)==x,x,explicit_solutions=True)" > as an example which returns an empty list of solutions. > But x=0 surely counts as an explicit solution? I guess my > interpretation of an empt

Re: [sage-support] Re: solve() free variable substitution

2013-06-12 Thread robin hankin
On Thu, Jun 13, 2013 at 12:45 PM, kcrisman wrote: > >> Smells like a bug... > > > Not exactly. The documentation for solve makes it clear (I hope!) in the > examples that these are "generic" variables generated by Maxima which we do > not make "Sage" variables. They just mean, "any old integer"

[sage-support] Re: solve() free variable substitution

2013-06-12 Thread leif
kcrisman wrote: On Wednesday, June 12, 2013 8:09:02 PM UTC-4, leif wrote: robin hankin wrote: > hello, sage 5.9 > > If solve() gives an unspecificed integer, how do I substitute a > particular value into the expression? > > subs() does not work as expected/desi

[sage-support] Re: solve() free variable substitution

2013-06-12 Thread kcrisman
On Wednesday, June 12, 2013 8:09:02 PM UTC-4, leif wrote: > > robin hankin wrote: > > hello, sage 5.9 > > > > If solve() gives an unspecificed integer, how do I substitute a > > particular value into the expression? > > > > subs() does not work as expected/desired because the free variable

[sage-support] Re: solve() free variable substitution

2013-06-12 Thread leif
leif wrote: robin hankin wrote: hello, sage 5.9 If solve() gives an unspecificed integer, how do I substitute a particular value into the expression? subs() does not work as expected/desired because the free variables don't seem to be defined. sage: a=solve(sin(x)==0,x,to_poly_solve='force')

[sage-support] Re: solve() free variable substitution

2013-06-12 Thread leif
robin hankin wrote: hello, sage 5.9 If solve() gives an unspecificed integer, how do I substitute a particular value into the expression? subs() does not work as expected/desired because the free variables don't seem to be defined. sage: a=solve(sin(x)==0,x,to_poly_solve='force');a [x == 2*pi

Re: Re: [sage-support] Re: Solve system of non linear equations

2012-12-08 Thread Martin Albrecht
We are talking about the Boolean polynomial ring here, right? So an F4 style algorithm is used by default (subject to some heuristics). To emphasise you'd have to construct your ring using the BooleanPolynomialRing constructor. On Saturday 08 Dec 2012, john_perry_usm wrote: > On Saturday, Decemb

Re: [sage-support] Re: Solve system of non linear equations

2012-12-08 Thread john_perry_usm
On Saturday, December 8, 2012 11:07:31 AM UTC-6, Santanu wrote: > > Thank you. But when I try to solve > f1=x1 + x2 + x4 + x10 + x31 + x43 + x56 , > f2=x2 + x3 + x5 + x11 + x32 +x44 + x57, > > it becomes very slow. Is there any faster approach like > F4 algorithm available in Sage? > F4 is not

Re: [sage-support] Re: Solve system of non linear equations

2012-12-08 Thread Santanu Sarkar
Thank you. But when I try to solve f1=x1 + x2 + x4 + x10 + x31 + x43 + x56 , f2=x2 + x3 + x5 + x11 + x32 +x44 + x57, it becomes very slow. Is there any faster approach like F4 algorithm available in Sage? On 8 December 2012 17:25, Martin Albrecht wrote: > Or compute a Gröbner basis: > > sage:

Re: [sage-support] Re: Solve system of non linear equations

2012-12-08 Thread Martin Albrecht
Or compute a Gröbner basis: sage: P. = BooleanPolynomialRing() sage: Ideal(x^2 + y^2).groebner_basis() [x + y] sage: Ideal(x^2 + y^2).variety() [{y: 0, x: 0}, {y: 1, x: 1}] On Saturday 08 Dec 2012, Volker Braun wrote: > I take it you mean polynomial equations: > > sage: AA. = AffineSpace(

[sage-support] Re: Solve system of non linear equations

2012-12-08 Thread Volker Braun
I take it you mean polynomial equations: sage: AA. = AffineSpace(GF(2),2) sage: S = AA.subscheme(x^2+y^2) sage: S.point_set().points() [(0, 0), (1, 1)] On Saturday, December 8, 2012 6:14:19 AM UTC, Santanu wrote: > > I have a system of non linear equations over GF(2). How to solve > them in Sa

[sage-support] Re: solve( ..., solution_dict=True) does not always return a list

2011-07-29 Thread kcrisman
On Jul 21, 9:03 pm, Marshall Hampton wrote: > Ticket 8553 doesn't fix this, so while it is a related issue this will > need a ticket of its own.  Looking at the source its not clear to me > why your last example doesn't return a list. > > I createdhttp://trac.sagemath.org/sage_trac/ticket/11618t

Re: [sage-support] Re: solve() gives incorrect answers for nonlinear system?

2011-07-21 Thread Craig Jolley
Thanks, this at least gives a reasonable answer and will work in the short-term. I'm still confused about why solve() didn't work, though. On Thu, Jul 21, 2011 at 11:44 PM, achrzesz wrote: > > Try something like this: > > from mpmath import * > mp.dps = 30; mp.pretty = True > > f=[lambda s00, s

[sage-support] Re: solve( ..., solution_dict=True) does not always return a list

2011-07-21 Thread Marshall Hampton
Ticket 8553 doesn't fix this, so while it is a related issue this will need a ticket of its own. Looking at the source its not clear to me why your last example doesn't return a list. I created http://trac.sagemath.org/sage_trac/ticket/11618 to address this. Hopefully someone from 8553 can fix t

[sage-support] Re: solve() gives incorrect answers for nonlinear system?

2011-07-21 Thread achrzesz
Try something like this: from mpmath import * mp.dps = 30; mp.pretty = True f=[lambda s00, s01, s10, s11, k, p:0.55*k*s00 + 0.6*k*s01 + 0.6*k*s10 + 0.6*p*s01 + 0.6*p*s10 +0.55*p*s11 + 33*s00 + 33*s01 + 33*s10 + 33*s11 - 33.0, lambda s00, s01, s10, s11, k, p:0.55*k*s00 + 0.6*k*s01 + 0.6*k*s10 + 3

Re: [sage-support] Re: solve() exception when variable names contain brackets

2011-07-01 Thread Michael Orlitzky
On 06/29/11 16:28, Jason Grout wrote: > On 6/29/11 3:22 PM, Michael Orlitzky wrote: >> This is probably just a case of "don't do that," but I thought I'd check: >> >>sage: c = [ var('c[0]') ] >>sage: system = c[0]*x == 1 >>sage: solve(system, c[0]) >> >>... >>TypeError: unab

[sage-support] Re: solve() exception when variable names contain brackets

2011-06-29 Thread Volker Braun
Thats http://trac.sagemath.org/sage_trac/ticket/7496 and its scheduled for sage-4.7.2 -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://grou

[sage-support] Re: solve() exception when variable names contain brackets

2011-06-29 Thread Jason Grout
On 6/29/11 3:22 PM, Michael Orlitzky wrote: This is probably just a case of "don't do that," but I thought I'd check: sage: c = [ var('c[0]') ] sage: system = c[0]*x == 1 sage: solve(system, c[0]) ... TypeError: unable to make sense of Maxima expression '[c[0]==1/x]' in Sag

[sage-support] Re: solve does not consider all a_x which are in the equation

2011-05-31 Thread Jakob Lombacher
So, with 4.7 it doesn't work either. But if I do some transformation by hand, and square both sides (I'm not completely sure if that's allowed), then I get the solution. f_2 = ((1/4*a^2*t^4 + a_x*t^3*v_x + a_x*t^2*x + t^2*v_x^2 + t^2*v_y^2 + 2*t*v_x*x + 2*t*v_y*y + x^2 + y^2 -m)/(t^3*v_y + t^2

[sage-support] Re: solve does not consider all a_x which are in the equation

2011-05-31 Thread ancienthart
Normally solve(e == m, a_x, to_poly_solve='force') works, but interestingly, not for your equation. Joal Heagney -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visi

[sage-support] Re: solve does not consider all a_x which are in the equation

2011-05-30 Thread Jakob Lombacher
Btw. I use sage 4.6.2. I wasn't aware that 4.7 allready exists. I will try out if the issue still exists in 4.7. -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit t

[sage-support] Re: solve(eqts, solution_dict=True) gives IndexError if there's no solution for eqts

2011-05-18 Thread kcrisman
On May 18, 9:17 am, tvn wrote: > so is there someway we can do so that this patch or temporary solution be > pushed into the next Sage release ?   Well, *you* can do that yourself - see, for instance, http://www.sagemath.org/doc/developer/walk_through.html#reviewing-a-patch Unfortunately, unti

[sage-support] Re: solve(eqts, solution_dict=True) gives IndexError if there's no solution for eqts

2011-05-18 Thread tvn
so is there someway we can do so that this patch or temporary solution be pushed into the next Sage release ? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit t

[sage-support] Re: solve(eqts, solution_dict=True) gives IndexError if there's no solution for eqts

2011-05-18 Thread kcrisman
On May 18, 2:21 am, zsharon wrote: > This is already mentioned > here:http://www.mail-archive.com/sage-support@googlegroups.com/msg20832.html > (It seems from that thread that this may not be a problem with Sage > itself.) > > It should be reported as a bug if it hasn't been already. It is htt

[sage-support] Re: solve(eqts, solution_dict=True) gives IndexError if there's no solution for eqts

2011-05-17 Thread zsharon
This is already mentioned here: http://www.mail-archive.com/sage-support@googlegroups.com/msg20832.html (It seems from that thread that this may not be a problem with Sage itself.) It should be reported as a bug if it hasn't been already. On May 17, 12:20 pm, tvn wrote: > shouldn't this be take

[sage-support] Re: solve -- an easy issue with solution_dict=True)

2010-10-19 Thread kcrisman
On Oct 19, 5:23 am, Robert Samal wrote: > Speaking about solve(), is there a place to report equations it cannot > solve > (and I believe it should?). > > I suppose putting it on the same Trac ticket is wrong practice? But > should > it be another ticket, or some yet other place? > Since for no

[sage-support] Re: solve -- an easy issue with solution_dict=True)

2010-10-19 Thread Robert Samal
Speaking about solve(), is there a place to report equations it cannot solve (and I believe it should?). I suppose putting it on the same Trac ticket is wrong practice? But should it be another ticket, or some yet other place? Robert > Yup.  solve() probably needs a general overhaul (and has for

[sage-support] Re: solve -- an easy issue with solution_dict=True)

2010-10-12 Thread Rolandb
On 13 okt, 03:39, kcrisman wrote: > On Oct 12, 6:37 pm, Robert Samal wrote: > > > > > I observed that solve behaves inconsistently in the following regards: > > > sage: solve([x==1,x==-1],x) > > [] > > > (this is as expected) > > However: > > > solve([x==1,x==-1],x, solution_dict=True) > > > pr

[sage-support] Re: solve -- an easy issue with solution_dict=True)

2010-10-12 Thread kcrisman
On Oct 12, 6:37 pm, Robert Samal wrote: > I observed that solve behaves inconsistently in the following regards: > > sage: solve([x==1,x==-1],x) > [] > > (this is as expected) > However: > > solve([x==1,x==-1],x, solution_dict=True) > > produces an error message. Easy to live with, but I was sca

Re: [sage-support] Re: solve() problem

2010-08-23 Thread robin hankin
Hello everyone thanks for the help here. In Mathematica, Reduce[] works like Solve, except that it returns a Boolean list of possible solutions. I use it to check what the necessary conditions for the"real" solution to work: MMA> Reduce[a*x == b, {x}] MMA> (b == 0 && a == 0) || (a != 0 &&

[sage-support] Re: solve() problem

2010-08-19 Thread kcrisman
On Aug 19, 5:39 pm, robin hankin wrote: > Hello Simon > > thanks for this. One problem > with the solution you mention is that I can't do the > general case.  What I need is the sage equivalent > of mathematica's Reduce[] function. > I think that solve() is the closest that comes to this (thoug

Re: [sage-support] Re: solve() problem

2010-08-19 Thread robin hankin
Hello Simon thanks for this. One problem with the solution you mention is that I can't do the general case. What I need is the sage equivalent of mathematica's Reduce[] function. Is there one? rksh On Thu, Aug 19, 2010 at 10:06 PM, Simon King wrote: > Hi! > > On 19 Aug., 22:41, robin hankin

[sage-support] Re: solve() problem

2010-08-19 Thread Simon King
Hi! On 19 Aug., 22:41, robin hankin wrote: > sage>solve([a*b==15*I-5,a*conjugate(b)==-13*I+9],[a,b]) > [] > > So, from the first two lines I know that a=2+I, b=1+7I should > be a solution to the system in the third, yet solve()  returns empty. Admittedly I am no expert for symbolics, and I don't

Re: [sage-support] Re: solve polynomial limit?

2010-04-16 Thread Mike Hansen
On Fri, Apr 16, 2010 at 9:57 AM, Owen wrote: >> Is there another method approach I could take?  I'd like to reach 6 at >> least.  My homework depends on it!  :) There's also the to_poly_solve argument to solve which cause non-exact answers to be returned: sage: solve([x^5 - x^4 - x^3 - x^2 - x -

[sage-support] Re: solve polynomial limit?

2010-04-16 Thread Owen
Gak! I found it a work around: find_root() seems fine. Sorry for the interruption! On Apr 16, 10:47 am, Owen wrote: > I'm solving recurrence relations for a k-SAT algorithm, and have run > up against an apparent limit in solve.  I'm running: > solutions = solve([x^3 - x^2 - x - 1 == 0], x, solu

[sage-support] Re: solve issue

2010-03-31 Thread ma...@mendelu.cz
The problem related to conversion of h1into maxima has been reported at http://trac.sagemath.org/sage_trac/ticket/8634 Robert -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more op

Re: [sage-support] Re: solve issue

2010-03-31 Thread Mike Hansen
You can also use find_root: sage: h1 = var('h1') sage: eq = (6000*(h1/2)/(((1/12)*0.1125*(h1^3)) - ((1/12)*(0.1125-0.012)*((h1-(2*0.012))^3 == 8928880.28799800 sage: eq.find_root(-1.2, -0.8) -0.96594148395195312 sage: eq.find_root(-0.8, 0.2) 0.00033054212748907948 sage: eq.find_root(.2, 1) 0.3

[sage-support] Re: solve issue

2010-03-31 Thread ma...@mendelu.cz
Mike wrote: Thanks for the reply. Using the exact same setup I changed "h1" to "p" and it worked out fine. Well not fine exactly but at least I'm getting some kind of answer. It's giving me some kind of "I" variable. Anyway this seems like kind of a major bug. Is there a way to add this into the t

[sage-support] Re: solve issue

2010-03-30 Thread ma...@mendelu.cz
Try to_poly_solve=True sage: h1=var('h1') sage: solve ([(6000*(h1/2)/(((1/12)*0.1125*(h1^3)) - ((1/12)*(0.1125-0.012)*((h1-(2*0.012))^3 == 8928880.28799800], h1,to_poly_solve=True) [x^k*binomial(n, k) == -0.965941485371, x^k*binomial(n, k) == 0.000330542127524, x^k*binomial(n, k) == 0.3626109

[sage-support] Re: Solve fails for a cubic

2010-03-02 Thread Sharpie
On Mar 2, 8:10 pm, Sharpie wrote: > So I guess at this point my question is: is there another way to > convert from a symbolic polynomial equation to a Polynomial Ring?  I > The methods I used feel very hacky and I don't trust them. Ok, so I think I found something in the manual page "Conversion

[sage-support] Re: Solve fails for a cubic

2010-03-02 Thread Sharpie
On Mar 2, 2:34 pm, Alex Ghitza wrote: > The way I see it, it is not actually a question about the variable > representing a real number; it is more a question of using polynomials > and their specialised built-in roots() method rather than symbolic > functions and the general-purpose solve(). > >

Re: [sage-support] Re: Solve fails for a cubic

2010-03-02 Thread Alex Ghitza
On Tue, 2 Mar 2010 05:27:45 -0800 (PST), Sharpie wrote: > Thanks for the reply Alex. I think I understand that by choosing a > variable of the appropriate type, in this case one that is restricted > to the real numbers, the roots can be determined in a straight-forward > manner. The way I see it,

[sage-support] Re: Solve fails for a cubic

2010-03-02 Thread Sharpie
On Mar 1, 3:02 am, Alex Ghitza wrote: > On Sun, 28 Feb 2010 23:02:08 -0800 (PST), Sharpie > wrote: > > However, tonight I have been trying to solve an open channel flow > > problem which requires me to find the roots of: > > >   y^3 - 1.39027132807289 * y^2 + 0.090610488164005 == 0 > > > find_ro

[sage-support] Re: Solve recurrences using Sage ?

2010-02-15 Thread Nathann Cohen
Should we create a ticket for this ? I'd have done it if not for my doubt on the section I should pick for this... :-) Nathann On Feb 10, 1:42 pm, Harald Schilly wrote: > On Feb 10, 11:16 am, Simon King wrote: > > > sage: f = y(n+2) - y(n+1) - y(n) > > ahh ... ok. now i get it ^^ > When I look

Re: [sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread David Joyner
On Wed, Feb 10, 2010 at 8:50 AM, Walking Randomly wrote: > Regarding namespace pollution.  Mathematica has thousands of function > names in it's global namespace but it never causes programmers a > problem because they have a convention.  All mathematica functions > start with a capital: Integrate

[sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Harald Schilly
On Feb 10, 2:48 pm, Nathann Cohen wrote: > I mentionned having to import simpy.*... nonono, rsolve should be a new sage function, inside of it it only imports the really necessary sympy classes. how is integrate(algorithm='sympy') done? i think that's a good starting point. see calculus/calculus.

Re: [sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Robert Schwarz
I think you always mean from sympy import * Don't get it confused with simpy, which is another software package for simulation (versus symbolic computation). On 02/10/2010 02:48 PM, Nathann Cohen wrote: > I mentionned having to import simpy.*, which included classes like > Symbol or Function, a

[sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Walking Randomly
Regarding namespace pollution. Mathematica has thousands of function names in it's global namespace but it never causes programmers a problem because they have a convention. All mathematica functions start with a capital: Integrate, Plot, ListPlot etc. So, stick to lower case variables and you d

Re: [sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Nathann Cohen
I mentionned having to import simpy.*, which included classes like Symbol or Function, and having to use those types. I wouldn't personally mind if I had to import rsolve from some Sage class... Why should it necessarily imported by default (namespace kept clean)? Nathann -- To post to this grou

[sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Harald Schilly
On Feb 10, 11:16 am, Simon King wrote: > sage: f = y(n+2) - y(n+1) - y(n) ahh ... ok. now i get it ^^ When I look into sympy/solvers/recurr.py right the first thing rsolve does is to compute lhs - rhs. So, f = y(n) == y(n-1) - y(n-2) *should* work. But it doesn't, because that equation doesn't ge

Re: [sage-support] Re: Solve recurrences using Sage ?

2010-02-10 Thread Minh Nguyen
Hi Nathann, On Wed, Feb 10, 2010 at 9:25 PM, Nathann Cohen wrote: > Well, for example : > > - You need to import simpy to use it One either directly import the functionalities of a third-party package, or have them imported automatically at Sage startup. But consider for a moment, the implicatio

  1   2   >