Troubles simplifying expressions



Dear all,

Yes, there are ways to get an "explicit" curve as the solution to this problem.  I've worked on this problem myself.  My code for "Watt's linkage" is below, which I'm sure you can adapt to your problem.

This code does take some time to execute.  I suggest, for the first few runs at least, you use specific values for the constants *before* you solve the system!

I hope this helps.

Chris Sangwin

/************************************************************************/
kill(all);

load("format/coeflist");
load("format/format");
load("Grobner/grobner.lisp");

poly_depends_varsp(ex,vars):=block([sov],sov:setify(listofvars(ex)),vars:setify(vars),subsetp(sov,vars))$

/* Takes a list of polynomials (Grobner basis) gb, and */
/* a list of variables vars, and returns the expressions in gb which depend only on the vars */
poly_isolate(gb,vars):= if listp(gb) then
                          if gb#[] then 
                                if poly_depends_varsp(first(gb),vars) 
                                then append([first(gb)],poly_isolate(rest(gb),vars)) 
                                else poly_isolate(rest(gb),vars)
                          else []
                        else []$


/* Watt type linkages in Maxima */
/* Equations for general Watt, four bar linkages */
P1:(x1-x2)^2+(y1-y2)^2-r1^2;
P2:(x2-x3)^2+(y2-y3)^2-r2^2;
P3:(x3-x4)^2+(y3-y4)^2-r3^2;
P4:(x4-x1)^2+(y4-y1)^2-r4^2;

P5:x+a*x2+b*x3;
P6:y+a*y2+b*y3;


x1:-4;
x4:4; 
y1:0;
y4:0;
/*r1:10;r2:4;r3:10;r4:8;*/
/*a:-1;*/
/*b:-1;*/

sgen:ev([P1,P2,P3,P5,P6]);
print(sgen);
listify(setify(flatten(map(listofvars,sgen))));

/* This is general and takes ages!*/
/* Evaluation took 436.98 seconds (436.98 elapsed) = 8 mins*/
   showtime:true$
   gb:poly_reduced_grobner(sgen,[x2,y2,x3,y3,a,b,r1,r2,r3,x,y])$
   showtime:false$
   sol:poly_isolate(gb,[x,y,r1,r2,r3,a,b]);
   sol:sol[1];

/* This is cheating, but worth recording...*/
/*sol:y^6+3*x^2*y^4+8*b*x*y^4-8*a*x*y^4-2*b^2*r3^2*y^4-2*a*b*r3^2*y^4+2*a*b*r2^2*y^4-2*a*b*r1^2*y^4-2*a^2*r1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a^5*x+16*b^6*r3^4+64*a*b^5*r3^4+96*a^2*b^4*r3^4+64*a^3*b^3*r3^4+16*a^4*b^2*r3^4+32*a*b^5*r2^2*r3^2+32*a^2*b^4*r2^2*r3^2-32*a^3*b^3*r2^2*r3^2-32*a^4*b^2*r2^2*r3^2-32*a*b^5*r1^2*r3^2-128*a^2*b^4*r1^2*r3^2-192*a^3*b^3*r1^2*r3^2-128*a^4*b^2*r1^2*r3^2-32*a^5*b*r1^2*r3^2-512*b^6*r3^2-1536*a*b^5*r3^2-1024*a^2*b^4*r3^2+1024*a^3*b^3*r3^2+1536*a^4*b^2*r3^2+512*a^5*b*r3^2+16*a^2*b^4*r2^4-32*a^3*b^3*r2^4+16*a^4*b^2*r2^4-32*a^2*b^4*r1^2*r2^2-32*a^3*b^3*r1^2*r2^2+32*a^4*b^2*r1^2*r2^2+32*a^5*b*r1^2*r2^2-512*a*b^5*r2^2+1024*a^3*b^3*r2^2-512*a^5*b*r2^2+16*a^2*b^4*r1^4+64*a^3*b^3*r1^4+96*a^4*b^2*r1^4+64*a^5*b*r1^4+16*a^6*r1^4+512*a*b^5*r1^2+1536*a^2*b^4*r1^2+1024*a^3*b^3*r1^2-1024*a^4*b^2*r1^2-1536*a^5*b*r1^2-512*a^6*r1^2+4096*b^6+8192*a*b^5-4096*a^2*b^4-16384*a^3*b^3-4096*a^4*b^2+8192*a^5*b+4096*a^6$*/

/* Chebyshev's crossed parallelogram. */
ev(sol,r1=10,r2=4,r3=10,a=-1,b=-1);