Hi, Thank you, the old idea you gave me to change '[' by ')' and ']' by ')' in the mathematica string is working. I'm trying now to change the limit memory of maxima.
On 19 août, 11:10, Viny <hje...@hotmail.com> wrote: > I have got the same problem of memory with maxima than Mani Chandra > few days ago and I decided to make an interface to mathematica for > solving the symbolic linear system which demand too much memory. The > expression in my former mail, it's the symbolic answer expression of > this linear system with mathematica. > This memory limit it's a big problem. Maxima can't use the whole 12 > giga of RAM of my system while mathematica can. That why i turned > toward mathematica. > If I don't understand very well how to get away with? Sorry it' quite > diffucult to me to write and understand english very well i'm from > France.Is there something to change in maxima source files or a > function to put in the code for reallocation of memory?? Is it > possible to put this function in a .sage file writting with python? > > Thankx > > On 19 août, 10:22, Robert Bradshaw <rober...@math.washington.edu> > wrote: > > > On Aug 19, 2009, at 12:48 AM, Viny wrote: > > > > Hi ! > > > > phi, v, u, Cxy are functions of (x,y). I use the command sage_eval > > > (string, locals = { 'E':E, 'u':u, 'v':u, 'phi'=phi, ......}). string > > > it's the expression. It's the only way i found for chang it to > > > expression but it generate an error. Perhaps this come from the > > > function the eval of phi[x,y], v[x,y], > > > Ah, so this is a Mathematica string where a[x,y] is actually a > > function application. You might be able to get away with > > > s.replace("[", "(").replace("]", ")") > > > > On 18 août, 11:02, Robert Bradshaw <rober...@math.washington.edu> > > > wrote: > > >> On Aug 17, 2009, at 3:45 AM, Viny wrote: > > > >>> Hello! > > > >>> Is it possible to have the equivalent sage expression of the > > >>> following > > >>> string, by using sage_eval() or another function without getting > > >>> this > > >>> error in while the transcription : > > > >> There was talk a while back about x[1] giving a sub-scripted x, but I > > >> don't think anything concrete came of it (IIRC there were bigger > > >> symbolic changes going on at the time). What is phi, v, etc. in your > > >> context? > > > >>> /lib/python2.6/site-packages/sage/misc/sage_eval.py", line 199, in > > >>> sage_eval return eval(source, sage.all.__dict__, locals) File > > >>> "<string>", line 1, in <module> TypeError: > > >>> 'sage.symbolic.expression.Expression' object is unsubscriptable > > > >>> A part of the string is: > > > >>> [(dx**4*dy**4*E**(2*phi[0, 0])*epsr**2* ((16*ni*(Cxy[0, 0] + (phi[0, > > >>> -1] - 2*phi[0, 0] + phi[0, 1])/dy**2 + (phi[-1, 0] - 2*phi[0, 0] + > > >>> phi[1, 0])/dx**2 + (ni*(-(E**phi[0, 0]*u[0, 0]) + v[0, 0]/E**phi > > >>> [0, > > >>> 0]))/epsr))/ (E**phi[0, 0]*epsr) + (8*(dx**2 + dy**2)* (dx**2* > > >>> ((-4 + > > >>> phi[0, -1] - phi[0, 1])*v[0, -1] + 8*v[0, 0] + (-4 - phi[0, -1] > > >>> + phi > > >>> [0, 1])*v[0, 1]) + dy**2*((-4 + phi[-1, 0] - phi[1, 0])*v[-1, 0] + > > >>> 8*v[0, 0] + (-4 - phi[-1, 0] + phi[1, 0])*v[1, 0])))/ > > >>> (dx**4*dy**4) + > > >>> ((-4 + phi[0, 0] - phi[0, 2])* (dx**2*((-4 + phi[0, 0] - phi[0, > > >>> 2])*v > > >>> [0, 0] + 8*v[0, 1] + (-4 - phi[0, 0] + phi[0, 2])*v[0, 2]) + > > >>> dy**2* > > >>> ((-4 + phi[-1, 1] - phi[1, 1])*v[-1, 1] + 8*v[0, 1] + (-4 - phi[-1, > > >>> 1] + phi[1, 1])*v[1, 1])))/(dx**2*dy**4) + ((-4 + phi[0, 0] - phi > > >>> [2, > > >>> 0])* (dx**2*((-4 + phi[1, -1] - phi[1, 1])*v[1, -1] + 8*v[1, 0] > > >>> + (-4 > > >>> - phi[1, -1] + phi[1, 1])*v[1, 1]) + dy**2*((-4 + phi[0, 0] - > > >>> phi[2, > > >>> 0])*v[0, 0] + 8*v[1, 0] + (-4 - phi[0, 0] + phi[2, 0])*v[2, 0])))/ > > >>> (dx**4*dy**2)))/ (2*dx**4*(-8*dy**2*E**phi[0, 0]*epsr*ni*(2 + > > >>> dy**2*Cxy[0, 0] + phi[0, -1] - 2*phi[0, 0] + phi[0, 1]) - > > >>> 16*dy**4*ni**2*v[0, 0] + E**(2*phi[0, 0])*epsr**2*((-4 + phi[0, > > >>> 0] - > > >>> phi[0, 2])*v[0, 0] + 4*v[0, 1] + (-phi[0, 0] + phi[0, 2])*v[0, > > >>> 2])) > > >>> + dx**2*dy**2*E**phi[0, 0]*epsr*(-16*dy**2*ni*(2 + phi[-1, 0] - > > >>> 2*phi > > >>> [0, 0] + phi[1, 0]) + E**phi[0, 0]*epsr*((-4 + phi[-1, 1] - phi[1, > > >>> 1])* v[-1, 1] + 8*v[0, 1] + (-4 + phi[1, -1] - phi[1, 1])*v[1, -1] + > > >>> 8*v[1, 0] - (8 + phi[-1, 1] + phi[1, -1] - 2*phi[1, 1])*v[1, 1])) + > > >>> 2*dy**4*E**(2*phi[0, 0])*epsr**2*((-4 + phi[0, 0] - phi[2, 0])*v > > >>> [0, 0] > > >>> + 4*v[1, 0] + (-phi[0, 0] + phi[2, 0])*v[2, 0])) - > > >>> (dx**4*dy**4*E** > > >>> (2*phi[0, 0])*epsr**2*(64*(dx**(-2) + dy**(-2))**2 + (16*ni**2)/ > > >>> (E** > > >>> (2*phi[0, 0])*epsr**2) + (4 - phi[0, 0] + phi[0, 2])**2/ dy**4 + > > >>> (4 - > > >>> phi[0, 0] + phi[2, 0])**2/dx**4)* (-(((ni**2*(16/dx**4 + 16/dy**4 > > >>> + (u > > >>> [0, 0] - u[0, 2])**2/dy**4 + (u[0, 0] - u[2, 0])**2/dx**4 + > > >>> (16*ni*(- > > >>> (E**phi[0, 0]*u[0, 0]) + v[0, 0]/E**phi[0, 0])*(Cxy[0, 0] + (phi[0, > > >>> -1] - 2*phi[0, 0] + phi[0, 1])/dy**2 + (phi[-1, 0] - 2*phi[0, 0] + > > >>> phi[1, 0])/dx** 2 + (ni*(-(E**phi[0, 0]*u[0, 0]) + v[0, 0]/E**phi > > >>> [0, > > >>> 0]))/ epsr))/epsr + 16*(2/dx**2 + 2/dy**2 + (E**phi[0, 0]*ni*u[0, 0] > > >>> + (ni*v[0, 0])/E**phi[0, 0])/epsr)**2 + (v[0, 0] - v[0, 2])**2/ > > >>> dy**4 + (v[0, 0] - v[2, 0])**2/dx**4))/(4*epsr**2) + ((2*dx**4* > > >>> (8*dy**2*E**phi[0, 0]*epsr*ni*(2 - phi[0, -1] + 2*phi[0, 0] - phi > > >>> [0, > > >>> 1]) + 8*dy**4*E**phi[0, 0]*ni*(-(epsr*Cxy[0, 0]) + 2* E**phi[0, 0] > > >>> *ni*u[0, 0]) + epsr**2*((4 + phi[0, 0] - phi[0, 2])* u[0, 0] - > > >>> 4*u[0, > > >>> 1] + (-phi[0, 0] + phi[0, 2])*u[0, 2])) + dx**2*dy**2*epsr* > > >>> (16*dy**2*E**phi[0, 0]*ni*(2 - phi[-1, 0] + 2* phi[0, 0] - phi > > >>> [1, 0]) > > >>> + epsr*((4 + phi[-1, 1] - phi[1, 1])* u[-1, 1] - 8*u[0, 1] + (4 > > >>> + phi > > >>> [1, -1] - phi[1, 1])* u[1, -1] - 8*u[1, 0] - (phi[-1, 1] + phi > > >>> [1, -1] > > >>> - 2*(4 + phi[1, 1]))*u[1, 1])) + 2*dy**4*epsr**2* ((4 + phi[0, 0] - > > >>> phi[2, 0])*u[0, 0] - 4*u[1, 0] + (-phi[0, 0] + phi[2, 0])*u[2, > > >>> 0]))* > > >>> (2*dx**4*(-8*dy**2*E**phi[0, 0]*epsr*ni*(2 + dy**2*Cxy[0, 0] + phi > > >>> [0, -1] - 2*phi[0, 0] + phi[0, 1]) - 16*dy**4*ni**2*v[0, 0] + > > >>> E** > > >>> (2*phi[0, 0])*epsr**2*((-4 + phi[0, 0] - phi[0, 2])*v[0, 0] + 4* > > >>> v[0, > > >>> 1] + (-phi[0, 0] + phi[0, 2])*v[0, 2])) + dx**2*dy**2*E**phi[0, 0] > > >>> *epsr*(-16*dy**2*ni*(2 + phi[-1, 0] - 2* phi[0, 0] + phi[1, 0]) + > > >>> E**phi[0, 0]*epsr* ((-4 + phi[-1, 1] - phi[1, 1])*v[-1, 1] + 8*v > > >>> [0, 1] > > >>> + (-4 + phi[1, -1] - phi[1, 1])*v[1, -1] + 8*v[1, 0] - (8 + phi > > >>> [-1, > > >>> 1] + phi[1, -1] - 2*phi[1, 1])*v[1, 1])) + 2*dy**4*E**(2*phi[0, > > >>> 0]) > > >>> *epsr**2*((-4 + phi[0, 0] - phi[2, 0])* v[0, 0] + 4*v[1, 0] + (- > > >>> phi[0, > > >>> 0] + phi[2, 0])*v[2, 0])))/ (64*dx**8*dy**8*E**(2*phi[0, 0]) > > >>> *epsr**4)) > > >>> * ((((-8*(dx**2 + dy**2)*(dx**2*((4 + phi[0, -1] - phi[0, 1])*u > > >>> [0, -1] > > >>> - 8*u[0, 0] + (4 - phi[0, -1] + phi[0, 1])*u[0, 1]) + dy**2*((4 + > > >>> phi[-1, 0] - phi[1, 0])*u[-1, 0] - 8*u[0, 0] + (4 - phi[-1, 0] + phi > > >>> [1, 0])*u[1, 0])))/(dx**4*dy**4) + ((4 + phi[0, 0] - phi[0, 2])* > > >>> (dx**2* > > >>> ((4 + phi[0, 0] - phi[0, 2])* u[0, 0] - 8*u[0, 1] + (4 - phi[0, 0] + > > >>> phi[0, 2])*u[0, 2]) + dy**2*((4 + phi[-1, 1] - phi[1, 1])*u[-1, > > >>> 1] - > > >>> 8*u[0, 1] + (4 - phi[-1, 1] + phi[1, 1])*u[1, 1])))/(dx**2*dy**4) > > >>> + ((4 + phi[0, 0] - phi[2, 0])*(dx**2*((4 + phi[1, -1] - phi[1, > > >>> 1])* > > >>> u[1, -1] - 8*u[1, 0] + (4 - phi[1, -1] + phi[1, 1])* u[1, 1]) + > > >>> dy**2* > > >>> ((4 + phi[0, 0] - phi[2, 0])*u[0, 0] - 8*u[1, 0] + (4 - phi[0, > > >>> 0] + > > >>> phi[2, 0])*u[2, 0])))/ (dx**4*dy**2) - (16*E**phi[0, 0]*ni*(Cxy > > >>> [0, 0] > > >>> + (phi[0, -1] - 2*phi[0, 0] + phi[0, 1])/dy**2 + (phi[-1, 0] - > > >>> 2*phi > > >>> [0, 0] + phi[1, 0])/dx**2 + (ni*(-(E**phi[0, 0]*u[0, 0]) + v[0, > > >>> 0]/ > > >>> E**phi[0, 0]))/epsr))/epsr)* (2*dx**4*(-8*dy**2*E**phi[0, 0] > > >>> *epsr*ni* > > >>> (2 + dy**2*Cxy[0, 0] + phi[0, -1] - 2*phi[0, 0] + phi[0, 1]) - > > >>> 16*dy**4*ni**2*v[0, 0] + E**(2*phi[0, 0])*epsr**2*((-4 + phi[0, > > >>> 0] - > > >>> phi[0, 2])*v[0, 0] + 4* v[0, 1] + (-phi[0, 0] + phi[0, 2])*v[0, > > >>> 2])) > > >>> + dx**2*dy**2*E**phi[0, 0]*epsr*(-16*dy**2*ni*(2 + phi[-1, 0] - 2* > > >>> phi[0, 0] + phi[1, 0]) + E**phi[0, 0]*epsr* ((-4 + phi[-1, 1] - > > >>> phi[1, > > >>> 1])*v[-1, 1] + 8*v[0, 1] + (-4 + phi[1, -1] - phi[1, 1])*v[1, -1] + > > >>> 8*v[1, 0] - (8 + phi[-1, 1] + phi[1, -1] - 2*phi[1, 1])*v[1, 1])) + > > >>> 2*dy**4*E**(2*phi[0, 0])*epsr**2*((-4 + phi[0, 0] - phi[2, 0])* v[0, > > >>> 0] + 4*v[1, 0] + (-phi[0, 0] + phi[2, 0])*v[2, 0])))/ > > >>> (64*dx**4*dy**4*E**(2*phi[0, 0])*epsr**2) - ((2*dx**4* > > >>> (8*dy**2*E**phi > > >>> [0, 0]*epsr*ni*(2 - phi[0, -1] + 2*phi[0, 0] - phi[0, 1]) + > > >>> 8*dy**4*E**phi[0, 0]*ni*(-(epsr*Cxy[0, 0]) + 2* E**phi[0, 0]*ni*u > > >>> [0, > > >>> 0]) + epsr**2*((4 + phi[0, 0] - phi[0, 2])* u[0, 0] - 4*u[0, 1] > > >>> + (- > > >>> phi[0, 0] + phi[0, 2])*u[0, 2])) + dx**2*dy**2*epsr* > > >>> (16*dy**2*E**phi > > >>> [0, 0]*ni*(2 - phi[-1, 0] + 2* phi[0, 0] - phi[1, 0]) + epsr*((4 + > > >>> phi > > >>> [-1, 1] - phi[1, 1])* u[-1, 1] - 8*u[0, 1] + (4 + phi[1, -1] - > > >>> phi[1, > > >>> 1])* u[1, -1] - 8*u[1, 0] - (phi[-1, 1] + phi[1, -1] - 2*(4 + > > >>> phi[1, > > >>> 1]))*u[1, 1])) + 2*dy**4*epsr**2* ((4 + phi[0, 0] - phi[2, 0])*u > > >>> [0, 0] > > >>> - 4*u[1, 0] + (-phi[0, 0] + phi[2, 0])*u[2, 0]))* ((16*ni*(Cxy > > >>> [0, 0] > > >>> + (phi[0, -1] - 2*phi[0, 0] + phi[0, 1])/dy**2 + (phi[-1, 0] - > > >>> 2*phi > > >>> [0, 0] + phi[1, 0])/dx**2 + (ni*(-(E**phi[0, 0]*u[0, 0]) + v[0, 0]/ > > >>> E**phi[0, 0]))/epsr))/ (E**phi[0, 0]*epsr) + (8*(dx**2 + dy**2)* > > >>> (dx**2*((-4 + phi[0, -1] - phi[0, 1])*v[0, -1] + 8*v[0, 0] + (-4 - > > >>> phi[0, -1] + phi[0, 1])*v[0, 1]) + dy**2*((-4 + phi[-1, 0] - phi[1, > > >>> 0])*v[-1, 0] + 8*v[0, 0] + (-4 - phi[-1, 0] + phi[1, 0])*v[1, > > >>> 0])))/ > > ... > > plus de détails » --~--~---------~--~----~------------~-------~--~----~ 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://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---