-----maxima-bounces at math.utexas.edu wrote: -----
>>?(2)?The?function?solve?does?not?handle?equations?that?involve?a?variable
>and its?conjugate.
>
>Ok?but,?is?there?other?ways?to?solve?such?a?system??
The alternative package to_poly_solver is able to automatically solve some equations that
involve a variable and its conjugate. When that doesn't work, you can introduce
the real and imaginary parts of the variable and solve (and maybe use a numerical method).
But you'll need to filter the solution to eliminate solutions with a nonreal real or imaginary
part (numerically easy, but symbolically, not easy in general).
>The?following?system?should?have?a?solution?(i=1.4-2.8*%i)?
>
>(%i1)?declare(ix,complex)$
>(%i2)?declare(iy,complex)$
>(%i3)?declare(v,complex)$
>(%i4)?declare(i,complex)$
>(%i5)?[va,vb,za,zb,s]:[80,70,1+2*%i,1+%i,100+200*%i];
>(%i6)?e1:va-za*ix=v;
>(%i7)?e2:vb-zb*iy=v;
>(%i8)?e3:ix+iy=i;
>(%i9)?e4:v*conjugate(i)=s;
>(%i10)?solve([e1,e2,e3,e4],[ix,iy,v,i]);
There seems to be at least two solutions: (without the call to rootscontract, the solution is correct,
I'd guess, but it's a messy conditional that doesn't simplify without help; also, setting algebraic
to true simplifies complex numbers to a rectangular form--but algebraic : true, gcd : spmod fails to do
a bug.
(%i1) load("to_poly_solver")$
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009/06/02 07:49:49 $
(%i2) sol : (declare([ix,iy,v,i], complex),
[va,vb,za,zb,s]:[80,70,1+2*%i,1+%i,100+200*%i],
e1:va-za*ix=v,
e2:vb-zb*iy=v,
e3:ix+iy=i,
e4:v*conjugate(i)=s,
block([algebraic : true, gcd : 'red], rootscontract(%solve([e1,e2,e3,e4],[ix,iy,v,i]))));
(%o2) %union([i=((67*sqrt(431681)-48013)*%i-51*sqrt(431681)+35489)/1418,ix=((193*sqrt(431681)-159047)*%i-94*sqrt(431681)+78896)/9217,iy=((485*sqrt(431681)-306075)*%i-475*sqrt(431681)+303565)/18434,v=-((5*sqrt(431681)-1255)*%i-480*sqrt(431681)-340370)/9217],[i=-((67*sqrt(431681)+48013)*%i-51*sqrt(431681)-35489)/1418,ix=-((193*sqrt(431681)+159047)*%i-94*sqrt(431681)-78896)/9217,iy=-((485*sqrt(431681)+306075)*%i-475*sqrt(431681)-303565)/18434,v=((5*sqrt(431681)+1255)*%i-480*sqrt(431681)+340370)/9217])
Check--always check.
(%i3) makelist(expand(subst(sk, map(lambda([s], rhs(s)-lhs(s)), [e1,e2,e3,e4]))),sk, args(sol));
(%o3) [[0,0,0,0],[0,0,0,0]]
(%i4) expand(float(sol));
(%o4) %union([i=48.65813962349394-64.90383048576655*%i,ix=15.26052827936178-31.01363785017898*%i,iy=33.39761134413216-33.89019263558757*%i,v=0.49258129145541*%i+2.712196020280274],[i=1.396867428692242-2.815492504360393*%i,ix=1.859141895315447-3.498025380807247*%i,iy=0.68253287644685*%i-0.4622744666232,v=71.14480734307006-0.22025840982365*%i])
--Barton (author of to_poly_solver).