From: Isaac H. D. <anj...@gm...> - 2015-02-04 03:52:20
|
Ok thank you very much. If I understood well I'd be better to use cabs when dealing with complex numbers than abs. I tried cabs in the example I was dealing with, and I got the expected result b^2+a^2. I'll have a look on cabs and abs in Maxima's manual. 2015-02-04 0:40 GMT-03:00 Stavros Macrakis (Σταῦρος Μακράκης) < mac...@al...>: > Maxima distinguishes between abs and cabs. > > abs is a mathematical function with simplifications > abs(%i) => 1 ... abs(1+%i) => sqrt(2) ... abs(a^2+1) => a^2+1 > > cabs is a programmatic function which returns an algebraic expression for > the complex absolute value, assuming that undeclared variables are real: > cabs(log(x)) => sqrt(log(abs(x))^2 + atan2(0,x)^2) > (note that atan2(0,x) is equivalent to (if x>=0 then 0 else > %pi)) > cabs(x) => abs(x) > > It's a bit confusing, but the distinction turns out to be useful.... > > -s > > On Tue, Feb 3, 2015 at 9:14 PM, Isaac Haïk Dunn <anj...@gm...> > wrote: > >> Sorry, I have been misleaded by the website >> http://beige.ucs.indiana.edu/P573/node20.html. >> I have just used "i" instead of "I" and I get exactly the same result: >> Maxima branch_5_34_base_161_g82c673a http://maxima.sourceforge.net >> using Lisp CLISP 2.49 (2010-07-07) >> Distributed under the GNU Public License. See the file COPYING. >> Dedicated to the memory of William Schelter. >> The function bug_report() provides bug reporting information. >> (%i1) declare(a,real); >> (%o1) done >> (%i2) declare(b,real); >> (%o2) done >> (%i3) a+%i*b; >> (%o3) %i b + a >> (%i4) (abs(%))^2; >> 2 >> (%o4) (%i b + a) >> (%i5) ratsimp(%); >> 2 2 >> (%o5) - b + 2 %i a b + a >> >> >> 2015-02-03 22:56 GMT-03:00 Richard Fateman <fa...@be...>: >> >>> On 2/3/2015 4:37 PM, Isaac Haïk Dunn wrote: >>> .... >>> >>>> >>>> So it seems that the problem lies in the step 4. It seems like Maxima >>>> is ignoring the absolute value. Am I missing something? >>>> >>>> There is a difference between %I and %i. The latter is the imaginary >>> unit. %I is nothing special. >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming. The Go Parallel Website, >> sponsored by Intel and developed in partnership with Slashdot Media, is >> your >> hub for all things parallel software development, from weekly thought >> leadership blogs to news, videos, case studies, tutorials and more. Take a >> look and join the conversation now. http://goparallel.sourceforge.net/ >> _______________________________________________ >> Maxima-discuss mailing list >> Max...@li... >> https://lists.sourceforge.net/lists/listinfo/maxima-discuss >> >> > |