max time limit for solve



Hello Barton,

Thanks for this great tip!

I have now come up with the following idea, I hope it is general enough:

  ...
  eq : ratsimp(eq),

  /* obtain the  nice expression x + 1/(3*x^3*(y+x)^3)+x^(1+a)/(1+a) */  
  %I3 : partfrac(eq,y),

  /* now get the largest subexpression that does not contain y */
  par : partition(%I3,y)[1],
  
  /* replace subexpression by W */
  eq : subst(W,par,%I3), 

  /* Then solve the equation */
  sol : solve(eq=%c,y),
  
  /* substitute it back */
  sol : subst(par,W,sol), 


it seems to work now:

ode1 : 'diff(y,x) = (x^3*y^4+4*x^4*y^3+6*x^5*y^2+4*x^6*y+x^7)*(x^a+1)-y/x-2;
            
ODE1_LieSolve(ode1,y,x);

[y = -2*(-sqrt(3)*%i/2-1/2)/(3^(1/3)*x*((8*x^(a+1)+(8*a+8)*x)/(a+1)-%c)^(1/3))-x,
 y = -2*(sqrt(3)*%i/2-1/2)/(3^(1/3)*x*((8*x^(a+1)+(8*a+8)*x)/(a+1)-%c)^(1/3))-x,
 y = (-2*9^(1/3)/(x*((8*x^(a+1)+(8*a+8)*x)/(a+1)-%c)^(1/3))-3*x)/3]

Thanks a lot for your help!

Best regards,
Nijso

> To: nijso at hotmail.com
> CC: maxima at math.utexas.edu; maxima-bounces at math.utexas.edu
> Subject: Re: [Maxima] max time limit for solve
> From: willisb at unk.edu
> Date: Wed, 27 Jan 2010 12:36:59 -0600
> 
> Try x^(1+a)/(1+a) --> w
> 
> %i49) eq :  x + 1/(3*x^3*(y+x)^3)+w = %c;
> (%o49) 1/(3*x^3*(y+x)^3)+x+w=%c
> (%i50) sol : solve(eq,y)$
> (%i51) reveal(sol,3);
> (%o51) [y=Sum(2),y=Sum(2),y=Quotient]
> (%i54) ratsimp(sol);
> (%o54) 
> [y=-(2*3^(1/3)*x^2*(x+w-%c)^(1/3)-sqrt(3)*%i-1)/(2*3^(1/3)*x*(x+w-%c)^(1/3)),y=-(2*3^(1/3)*x^2*(x+w-%c)^(1/3)+sqrt(3)*%i-1)/(2*3^(1/3)*x*(x+w-%c)^(1/3)),y=-(3*x^2*(x+w-%c)^(1/3)+9^(1/3))/(3*x*(x+w-%c)^(1/3))](%i49) 
> eq :  x + 1/(3*x^3*(y+x)^3)+w = %c;
> (%o49) 1/(3*x^3*(y+x)^3)+x+w=%c
> (%i50) sol : solve(eq,y)$
> (%i51) reveal(sol,3);
> (%o51) [y=Sum(2),y=Sum(2),y=Quotient]
> (%i54) ratsimp(sol);
> (%o54) 
> [y=-(2*3^(1/3)*x^2*(x+w-%c)^(1/3)-sqrt(3)*%i-1)/(2*3^(1/3)*x*(x+w-%c)^(1/3)),y=-(2*3^(1/3)*x^2*(x+w-%c)^(1/3)+sqrt(3)*%i-1)/(2*3^(1/3)*x*(x+w-%c)^(1/3)),y=-(3*x^2*(x+w-%c)^(1/3)+9^(1/3))/(3*x*(x+w-%c)^(1/3))]
> 
> Without x^(1+a)/(1+a) --> w, Maxima struggles with simplification, I 
> think.
> A little carbon-based computing wins. Of course, maxima should be able to 
> do this without help. 
> 
> Barton
> 
> maxima-bounces at math.utexas.edu wrote on 01/27/2010 12:21:03 PM:
> 
> > [image removed] 
> > 
> > Re: [Maxima] max time limit for solve
> > 
> > nijso beishuizen 
> > 
> > to:
> > 
> > maxima
> > 
> > 01/27/2010 12:20 PM
> > 
> > Sent by:
> > 
> > maxima-bounces at math.utexas.edu
> > 
> > Hi,
> > 
> > The equation I try to solve is the final step in the solution of a 
> > nonlinear ode. The solution in the paper
> > (of Cheb-Terrab and Kolokolnikov, it's on ArXiv) is given in implicit 
> form as:
> > 
> > sol : x + 1/(3*x^3*(y+x)^3)+x^(1+a)/(1+a) = %c;
> > 
> > In the algorithm I manage to get the left hand side of sol [well, 
> > actually I get factor(ratsimp(sol))]. I do not know beforehand that 
> > the solution should remain in implicit form, although you can 
> > rewrite the solution as y(x)=(..) . I then do 
> > 
> > solve(sol,y);
> > 
> > After a couple of minutes it starts returning an answer and it takes
> > 10 minutes to output the answer. 
> > Yesterday I tried it with emacs+maxima and I never got any answer 
> > returned, this is with xmaxima.
> > 
> > Actually, maple finds the 3 compact explicit solutions of the above 
> > equation, and when you solve the original ode, it knows that the 
> > implicit form is somehow more appropriate to return (it returns sol 
> > instead of the result of solve(sol,y)).
> > Instead of killing solve after x minutes, is there a way to improve 
> > the result of solve, or a way of determining beforehand that going 
> > for an explicit solution of sol might be a bad idea?
> > 
> > Regards,
> > Nijso
> > 
> > 
> > 
> > 
> > 
> > Express yourself instantly with MSN Messenger! MSN Messenger
> > _______________________________________________
> > Maxima mailing list
> > Maxima at math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> 
 		 	   		  
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/