Maxima Digest, Vol 27, Issue 62 (Re: Re:solve "abs(x)=2", and question in "print")



> From: Stavros Macrakis> 2. Re: question in solve "abs(x)=2" (Adam Majewski)> 3. Re: Test suite failures with cvs version? (Dieter Kaiser)> 4. Re: Test suite failures with cvs version? (Raymond Toy)> 5. Re: Test suite failures with cvs version? (Dieter Kaiser)> 6. Bug? (akim)> 7. Another observation (akim)> > > ----------------------------------------------------------------------> > > > Message: 2> Date: Mon, 27 Oct 2008 18:29:27 +0100> From: Adam Majewski <adammaj1 at o2.pl>> Subject: Re: [Maxima] question in solve "abs(x)=2"> To: maxima at math.utexas.edu> Message-ID: <ge4tpm$c71$1 at ger.gmane.org>> Content-Type: text/plain; charset=Big5> > Hi,> > Solve is for algebraic equations,> your equation is not algebraic ( abs ).> > This is not an proper answer to your question, but gives graphical solution:> > load(implicit_plot);> z:x+y*%i;> implicit_plot (abs(z) = 2, [x, -4, 4], [y, -4, 4]);> > > Regards> > Adam
========================================
Dear Adam 
         thanks your solution. but this question is a algebraic equation.
|x|=2
it solution is x=2, -2
---------------------------------------------------------
the next solution is from Professor  Barton Willis (willisb at unk.edu)
 
The undocumented function to_poly_solve can solve this equation.To use to_poly_solve, you'll need to load the file "topoly_solver."An example: (%i4) load("topoly_solver")$ (%i5) to_poly_solve(abs(x)=2,x);(%o5) [[x=2],[x=-2]] If you want to find all complex solutions, to_poly_solve doesn't work: (%i6) declare(x,complex)$ (%i7) to_poly_solve(abs(x)=2,x);(%o7) [[x=2],[x=-2]]
=======================================> > > > > 2. the print function that has "new line " (i.e skip line ) function ??> > as follow : I want to give a question and it have 2 sub items > > > > A:[1,2], B:[3,4],C:[8,7],solve > > (1) the mid p oint of A,,B> > (2) the gravity point of the triangle ABC> > > > I usually typing :> > print ("A:[1,2], B:[3,4],C:[8,7],solve (1) the mid p oint of A,,B (2) the gravity point of the triangle ABC");
 
----------------Question in print----------------------------------- 
so, the visual effects are not good-looking
How to skip to the next line?
Does the "print " function include "skip" function"?
 
 > > _________________________________________________________________> > ?????????????????B?v???B?????p?u???M???R?M???A?????q?X?A???v ?X Windows Live Spaces> > http://spaces.live.com/>; > > > > > ------------------------------------------------------------------------> > > > _______________________________________________> > Maxima mailing list> > Maxima at math.utexas.edu> > http://www.math.utexas.edu/mailman/listinfo/maxima>; > > > ------------------------------> > Message: 3> Date: Mon, 27 Oct 2008 20:59:05 +0100> From: defun expintegral-ei (z> (+> (- (expintegral-e 1 (- z)))> ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))> (cond > ((not (= (imagpart z) 0))> ;; Complex value. Add phase %i*%pi.> (complex 0 (float pi)))> ((> (realpart z) 0)> ;; Positive real value. Add phase -%i*pi.> (complex 0 (- (float pi))))> ;; Negative real value. No phase factor.> (t 0))))> > To be complete here are the different cases and the results:> > (%i6) expintegral_ei(1.0);> (%o6) 1.895117816355937> > (%i7) expintegral_ei(-1.0);> (%o7) -0.21938393439552> > (%i8) expintegral_ei(1.0+%i);> (%o8) 2.387769851510522*%i+1.764625985563854> > (%i9) expintegral_ei(-1.0+%i);> (%o9) 2.962268118550434*%i-2.8162445198177954E-4> > These values I have checked against wolfram.functions.com. Because the> Exponential Integral Ei has mirror symmetry the results for the arguments 1.0-%i> and -1.0-%i differ only by the sign of the imaginary part.> > Later I will add this cases to the testsuite.> > Dieter Kaiser> > -----Urspr?ngliche Nachricht---
--> Von: raymond.toy at ericsson.com [mailto:raymond.toy at ericsson.com] > Gesendet: Montag, 27. Oktober 2008 14:44> An: Dieter Kaiser> Cc: maxima at math.utexas.edu> Betreff: Re: [Maxima] Test suite failures with cvs version?> > Dieter Kaiser wrote:> > > > (defun expintegral-ei (z)> > (+> > (- (expintegral-e 1 (- z)))> > ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))> > (if (and (= (imagpart z) 0) (> (realpart z) 0))> > ;; Positive real value. Add a phase factor -%pi*%i> > (complex 0 (- (float pi)))> > ;; For all other values. No phase factor.> > 0)))> > I was getting ready to check in all the changes we had done last week,> but I was looking at this expression. I must be stupid. I don't see> how f(z) = 1/2*(log(z)-log(1/z)) - log(-z) simplifies that way. For> real z, yes, I see f(z) is -%i*%pi for positive z and 0 for negative z.> But for complex z, not on the real axis, I always get %i*%pi (or> -%i*%pi, depending on how you want to write -1).> > Help!> > Ray> > > > > > ------------------------------> > Message: 4> Date: Mon, 27 Oct 2008 16:06:14 -0400> From: defun expintegral-ei (z> >> (+> >> (- (expintegral-e 1 (- z)))> >> ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))> >> (if (and (= (imagpart z) 0) (> (realpart z) 0))> >> ;; Positive real value. Add a phase factor -%pi*%i> >> (complex 0 (- (float pi)))> >> ;; For all other values. No phase factor.> >> 0)))> > Raymond> I was getting ready to check in all the changes we had done last week,> Raymond> but I was looking at this expression. I must be stupid. I don't see> Raymond> how f(z) = 1/2*(log(z)-log(1/z)) - log(-z) simplifies that way. For> Raymond> real z, yes, I see f(z) is -%i*%pi f
or positive z and 0 for negative z.> Raymond> But for complex z, not on the real axis, I always get %i*%pi (or> Raymond> -%i*%pi, depending on how you want to write -1).> > As best as I can tell f(z) = -%i*%pi for all z except the negative> real axis where it is 0.> > However, if we use this version, we get weird results, assuming> expintegral_ei is continuous in the right half plane:> > expintegral_ei(1.0) -> 1.895 - 6.283185307179586*%i> expintegral_ei(1.0+1d-8*%i) -> 1.895 - 3.14159*%i> expintegral_ei(1.0-1d-8*%i) -> 1.895 + 3.14159*%i> > If we use the actual expression f(z), we get something that seems> reasonable:> > expintegral_ei(1.0) -> 1.895> expintegral_ei(1.0+1d-8*%i) -> 1.895 - 2.71828d-8*%i> expintegral_ei(1.0-1d-8*%i) -> 1.895 + 2.71828d-8*%i> > But this depends on expintegral-e returning the correct complex> values, and I'm not quite sure about that yet.> > Ray> > > > ------------------------------> > Message: 5> Date: Mon, 27 Oct 2008 21:45:47 +0100> From: defun expintegral-ei (z> (+> (- (expintegral-e 1 (- z)))> ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))> (cond > ((> (imagpart z) 0)> ;; Positive imaginary part. Add phase %i*%pi.> (complex 0 (float pi)))> ((< (imagpart z) 0)> ;; Negative imaginary part. Add phase -%i*%pi.> (complex 0 (- (float pi))))> ((> (realpart z) 0)> ;; Positive real value. Add phase -%i*pi.> (complex 0 (- (float pi))))> ;; Negative real value. No phase factor.> (t 0))))> > Again the results I obtained with GCL:> > (%i9) expintegral_ei(1.0);> (%o9) 1.895117816355937> (%i10) expintegral_ei(-1.0);> (%o
10) -0.21938393439552> (%i11) expintegral_ei(1.0 + %i);> (%o11) 2.387769851510522*%i+1.764625985563854> (%i12) expintegral_ei(1.0 - %i);> (%o12) 1.764625985563854-2.387769851510522*%i> (%i13) expintegral_ei(-1.0 + %i);> (%o13) 2.962268118550434*%i-2.8162445198177954E-4> (%i14) expintegral_ei(-1.0 - %i);> (%o14) -2.962268118550434*%i-2.8162445198177954E-4> > This results including the conjugate values are correct for the expintegral_ei.> The testsuite includes some further tests for conjugate values which know work> as expected.> > Dieter Kaiser> > -----Urspr?ngliche Nachricht-----> Von: raymond.toy at ericsson.com [mailto:raymond.toy at ericsson.com] > Gesendet: Montag, 27. Oktober 2008 21:06> An: Dieter Kaiser> Cc: maxima at math.utexas.edu> Betreff: Re: [Maxima] Test suite failures with cvs version?> > >>>>> "Raymond" == Raymond Toy <raymond.toy at ericsson.com> writes:> > Raymond> Dieter Kaiser wrote:> >> > >> (defun expintegral-ei (z)> >> (+> >> (- (expintegral-e 1 (- z)))> >> ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))> >> (if (and (= (imagpart z) 0) (> (realpart z) 0))> >> ;; Positive real value. Add a phase factor -%pi*%i> >> (complex 0 (- (float pi)))> >> ;; For all other values. No phase factor.> >> 0)))> > Raymond> I was getting ready to check in all the changes we had done last> week,> Raymond> but I was looking at this expression. I must be stupid. I don't> see> Raymond> how f(z) = 1/2*(log(z)-log(1/z)) - log(-z) simplifies that way.> For> Raymond> real z, yes, I see f(z) is -%i*%pi for positive z and 0 for> negative z.> Raymond> But for complex z, not on the real axis, I always get %i*%pi (or> Raymond> -%i*%pi, depending on how you want to write -1).> > As best as I can tell f(z) = -%i*%pi for all z except the negative> real axis where it is 0.> > However, if we use this version, we get weird results, assuming> expintegral_ei is continuous in the right half plane:> > expintegral_ei(1.0) -> 1.895 - 6.283185307179586*%i> expintegral_ei(1.0+1d-8*%i) -> 1.895 - 3.14159*%i> expintegral_ei(1.0-1d-8*%i) -> 1.8
95 + 3.14159*%i> > If we use the actual expression f(z), we get something that seems> reasonable:> > expintegral_ei(1.0) -> 1.895> expintegral_ei(1.0+1d-8*%i) -> 1.895 - 2.71828d-8*%i> expintegral_ei(1.0-1d-8*%i) -> 1.895 + 2.71828d-8*%i> > But this depends on expintegral-e returning the correct complex> values, and I'm not quite sure about that yet.> > Ray> > > > > ------------------------------> > Message: 6> Date: Sun, 26 Oct 2008 15:53:30 +0100> From: (x^2+1/x, x); (or do it with the grafical way calculus>differentiate) the answer is> 2-((x^2+1)/x^2).> > Why doesn't it show the shortest answer 1-(1/x^2) ?> > But when I type expand(diff((x^2+1)/x, x)); it shows the shortest answer 1-(1/x^2) > > What is this "expand" ? Can I acces to it via the grafical wxmaxima menu, that the answer of everything I differentiate is the shortest?> > Best regards> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20081026/145d5af8/attachment.htm > > ------------------------------> > Message: 7> Date: Sun, 26 Oct 2008 16:37:28 +0100> From: "akim" <akim.l at hotmail.fr>> Subject: Another observation> To: <maxima at math.utexas.edu>> Message-ID: <BAY125-DS6284C9962308DD82B2F81F6250 at phx.gbl>> Content-Type: text/plain; charset="iso-8859-1"> > Hi,> > try to solve x^2+4*x+4 = 0> > answer:> > x = sqrt(0)-2 > > or > > x = -sqrt(0)-2> > why not just x = -2 ?> > Best regards> -------------- next part --------------> An HTML attachment was scrubbed...> URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20081026/6e646d7a/attachment.htm > > ------------------------------> > _______________________________________________> Maxima mailing list> Maxima at math.utexas.edu> http://www.math.utexas.edu/mailman/listinfo
/maxima> > > End of Maxima Digest, Vol 27, Issue 62> **************************************
_________________________________________________________________
?H???? Windows Live Messenger ?M Hotmail?A???????a?x?????T???b???? ?X Windows Live for Mobile 
http://www.msn.com.tw/msnmobile/